This Slack bot integrates seamlessly with Slack and offers the following exclusive features:
- Retrieve the names of all channels for a specific user within your organization.
- Bulk add or remove users from any channel efficiently.
Here are the available commands for interacting with the bot:
add @user_name #channel_name: Adds a user to a specified channel.remove @user_name #channel_name: Removes a user from a specified channel.get_channels @user_name: Retrieves the list of channels a user is part of.
Before setting up the Slack bot, ensure you have met the following requirements:
-
Create a Slack App:
- Visit the Slack API website to create your app.
-
Assign Permissions:
- Ensure the bot has the necessary permissions for the tasks it will perform.
-
Generate and Store Tokens:
- Copy the following keys and create a
.envfile:USER_TOKENBOT_TOKENSIGNING_SECRETSLACK_API_TOKENSLACK_CLIENT_IDSLACK_CLIENT_SECRETFLASK_SECRET_KEY(Generate from Terminal)
- Copy the following keys and create a
-
Install Required Libraries:
- Install all necessary libraries as listed here.
-
Set Up HTTP Tunnel:
- Create an HTTP tunnel using ngrok and configure it in your Event Subscription settings. Ensure necessary Bot events are subscribed to.
-
Add the App to Your Channel:
- Ensure the app is added to your Slack channel before running the code.
To install and set up the Slack bot, follow these steps:
-
Clone the Repository:
git clone https://github.com/yourusername/slack-bot.git cd slack-bot
