ChatGPT-in-Slack icon indicating copy to clipboard operation
ChatGPT-in-Slack copied to clipboard

Restrict bot usage to specific channels or users

Open PeterDaveHello opened this issue 7 months ago • 0 comments

Related to #32

Add access control feature to restrict bot usage to specific channels or users.

  • Environment Variables: Add ALLOWED_CHANNELS and ALLOWED_USERS environment variables in main.py and main_prod.py to specify allowed channels and users.
  • Middleware: Update middleware in main.py and main_prod.py to check if the bot is allowed in the channel or by the user.
  • Access Control Function: Add is_bot_allowed function in app/bolt_listeners.py to check if the bot is allowed to respond based on the specified channels and users.
  • Event Handlers: Update respond_to_app_mention and respond_to_new_message in app/bolt_listeners.py to use is_bot_allowed function.
  • Documentation: Update README.md to include instructions on how to configure the ALLOWED_CHANNELS and ALLOWED_USERS environment variables.

For more details, open the Copilot Workspace session.

PeterDaveHello avatar Jul 05 '24 12:07 PeterDaveHello