This is a python framework to create slack bots.
It abstract most of the boilerplate code to interact with slack and encapsulate slack json data in nice native classes.
Install Antibot
pip install antibotInstall plugins in the same python environment. Antibot will detect them during startup.
You need to create a new app on https://api.slack.com/apps.
-
Go to OAuth & Permissions, set scopes (at least),
- users:read
- users:read.email
- files:write
and install OAuth Tokens
-
Launch Antibot with the following environment variables:
- SLACK_BOT_USER_TOKEN : can be found under
Bot User OAuth Access TokeninOAuth & Permissionspage - SIGNING_SECRET : can be found in the
Basic Informationpage - WS_API_KEY : is a random secret of you choice to call non-slack related api on your bot
- MONGO_URI : Mongo connection string to an accessible mongo instance
- DEV=true while in development
- SLACK_BOT_USER_TOKEN : can be found under
-
Make Antibot accessible with a public URL (in development you can use http://localhost.run/, but you will need to update URLs regularly)
-
Enable
InteractivityinInteractivity & Shortcuts, and set URL tohttps://antibot-public-url/action -
Create command in
Slash Commands, and set URL tohttps://antibot-public-url/your/command(installed commands are listed during Antibot startup)
Use cookiecutter on https://github.com/JGiard/Antibot-plugins-template
There is lot of stuff you can do, check the other projects for examples.
Use @command("/myplugin/route") to react to slash command (don't forget to create the correspond command in slack).
Always use the block api from antibot.slack.messages when creating messages.
Use @block_action(action_id="...") to react to interactive components on messages.
Use @ws("/myplugin/route) to create a raw endpoint.