Slack Channel Management Bot

A lightweight, serverless Slack bot designed for moderation and administration. Built for speed and security on Cloudflare Workers.

Cloudflare Workers Slack Events API Node.js
Note: Sensitive information such as user IDs, internal URLs, and tokens has been replaced with placeholders in the repository for security.

Features

Smart Message Clearing

Efficiently delete recent messages for yourself or the entire channel with admin privileges.

Reaction Archiving

Confirm archiving tasks via emoji reactions. Safe, interactive, and transparent moderation.

Channel Creation

Automated channel provisioning with instant owner invitations via slash commands.

Staff Resources

Quick access buttons for internal staff lists and organizational websites.

Slash Commands

/clear [all]

Without arguments, it deletes your own recent messages. Use all (Admins only) to wipe the channel history.

/createchannel [name]

Instantly creates a new channel and invites you to it. Example: /createchannel dev-squad.

/delchannel [number]

Opens an interactive menu or triggers a confirmation message to archive specific channels.

Reaction-Based Confirmation

Prevent accidental data loss. Every archive request requires a manual seal of approval.

🟢

Confirm

Proceed with archiving

🔴

Cancel

Abort the operation

Tech Stack

JavaScript
Slack API
Cloudflare
Serverless

Environment Variables

Configure these in your Cloudflare dashboard or .dev.vars file.

SLACK_BOT_TOKEN=your_slack_bot_token
ADMIN_USER_ID=slack_admin_user_id
Security Alert: Never commit your .env or secrets to public repositories.

Slack App Setup

1

Create App

Head to api.slack.com and create a new bot from scratch.

2

Events

Enable "Event Subscriptions" and point to /events on your worker. Subscribe to reaction_added.

3

Slash Commands

Register /clear, /createchannel, /delchannel, /stafflist, and /website.