/slackbot-py

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

A basic slackbot.

Environment Requirements

  1. Python >= 3.10

Slack Permission Requirements

OAuth & Permissions > Scopes > Bot Token Scopes

  1. channels:history
  2. chat:write
  3. reactions:read
  4. users:read

Event Subscriptions > Subscribe to bot events

  1. message.channels
  2. reaction_added

Development

  1. Follow the instructions here to create and install a new app and get your secret tokens.
  2. $ python3 -m venv .venv
  3. $ source .venv/bin/activate
  4. $ pip install -r requirements.txt
  5. $ cp secrets-template.json secrets.json and fill in your secrets
  6. $ npm install -g localtunnel or locally if you want
  7. $ lt --port 3000 --subdomain yoursubdomainhere
  8. $ python3 app.py
  9. Enable events at https://api.slack.com/apps/<your_workplace>/event-subscriptions?
  10. Fill in the request URL as https://yoursubdomainhere.loca.lt/slack/events
  11. Test & save changes
  12. Your bot should now be able to respond to commands!