A CHAT-OPS python chat bot for Slack based on lins05/slackbot. Slapybot uses thisbejim/Pyrebase for firebase integration, and handles smalltalk using API.AI with the help of its python sdk
- ChatOps ready - with deployment system, locking mechanism and more
- Weather, news, wiki, gifs and many more queries
- Small talk questions and answers with API.AI integration
pip install -r requirements.txt
- Go to your firebase project url (https://console.firebase.google.com/project/)
- Overview > Project Settings > Service Accounts (tab) > GENERATE NEW PRIVATE KEY
- Download the json file and save it in your project (Make sure to add it to .gitignore file!!!)
- Create firebase.py in /plugins directory
First you need to get the slack api token for your bot. You have two options:
- Create a bot for your team
- If you use a real slack user, you can generate an api token on slack web api page.
- Create a
slackbot_settings.py
and arun.py
in your own instance of slackbot.
Then you need to configure the API_TOKEN
in a python module slackbot_settings.py
, which must be located in a python import path. This will be automatically imported by the bot.
slackbot_settings.py:
API_TOKEN = "<your-api-token>"
Alternatively, you can use the environment variable SLACKBOT_API_TOKEN
.
python run.py
Add a DEFAULT_REPLY to slackbot_settings.py
:
DEFAULT_REPLY = "Sorry but I didn't understand you"
The message
attribute passed to your custom plugins has an special function message.docs_reply()
that will parse all the plugins available and return the Docs in each of them.
Add your plugin modules to a PLUGINS
list in slackbot_settings.py
:
PLUGINS = [
'slackbot.plugins',
'mybot.plugins',
]
Now you can talk to your bot in your slack client!
@<BOT-NAME> wiki
@<BOT-NAME> random gif
@<BOT-NAME> <SOME-WORD> me
@<BOT-NAME> Whats the weather in london?
@<BOT-NAME> Get 2 news from CNN
@<BOT-NAME> Get news sources
@<BOT-NAME> deploy <SERVICE>
@<BOT-NAME> lock <SERVICE>
@<BOT-NAME> list locks
@<BOT-NAME> list services
@<BOT-NAME> add service <SERVICE-NAME>
@<BOT-NAME> unlock <SERVICE>
@<BOT-NAME> unlock all
@<BOT-NAME> Do you know what does the fox say?
@<BOT-NAME> Who is donald trump?
@<BOT-NAME> What is the meaning of life?
@<BOT-NAME> How many woods would a wood chuck chuck