Introduce errBot and work with Slack

Install errBot

$ 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.

Try starting errBot

(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

Install slackclient

(errenv) $ pip install slackclient

Edit errbot config file

(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

Start errbot as a daemon

(errenv) $ errbot --daemon

Invite your bot to a suitable channel to test it

スクリーンショット 2016-09-12 15.30.39.png

http://errbot.io/en/latest/user_guide/configuration/slack.html

Recommended Posts

Introduce errBot and work with Slack
Make Slack chatbot with Errbot
Easy Slackbot with Docker and Errbot
With and without WSGI
Launch Cloud Datastore Emulator with docker-compose and work with python app
Send experiment results (text and images) to slack with Python
Streamline information gathering with the Twitter API and Slack bots
Collecting information from Twitter with Python (MySQL and Python work together)
[Python x Zapier] Get alert information and notify with Slack
Site monitoring and alert notification with AWS Lambda + Python + Slack
With me, cp, and Subprocess
Programming with Python and Tkinter
Encryption and decryption with Python
Working with tkinter and mouse
Introduce dein.vim and include jedi-vim
Post to slack with Python 3
Super-resolution with SRGAN and ESRGAN
group_by with sqlalchemy and sum
python with pyenv and venv
Search engine work with python
With me, NER and Flair
Works with Python and R
I tried to visualize bookmarks flying to Slack with Doc2Vec and PCA
Get conversions and revenue with Google Analytics API and report to Slack