$ mkvirtualenv -p `which python3` errenv
(errenv) $ pip install errbot
(errenv) $ mkdir mybot
(errenv) $ cd mybot/
(errenv) ~/mybot$ errbot --init
Your Errbot directory has been correctly initialized !
Just do "errbot" and it should start in text/development mode.
(errenv) ~/mybot$ errbot
The bot console will start, so try entering the command
>>> !tryme
It works !
To exit the console, just like the python console, Ctrl + D
or Ctrl + C
(errenv) $ pip install slackclient
(errenv) $ vi ~/mybot/config.py
Configuration file template https://raw.githubusercontent.com/errbotio/errbot/master/errbot/config-template.py
For the time being, change only BACKEND
, BOT_ADMINS
and BOT_IDENTITY
.
import logging
BACKEND = 'Slack'
-- snip --
BOT_ADMINS = ('@xxxx', )
BOT_IDENTITY = {
'token': 'xoxb-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
}
slack token is https://my.slack.com/services/new/bot Get from
(errenv) $ errbot --daemon
Invite your bot to a suitable channel to test it
http://errbot.io/en/latest/user_guide/configuration/slack.html
Recommended Posts