Fortsetzung von http://qiita.com/attakei/items/29b3f0086296345216df
Dieses Mal werde ich die anfängliche Konstruktion von Errbot ausprobieren, die Slack überwacht und funktioniert.
config.py
#In der Nähe von L47
#Geben Sie das Backend des Chats an. Dieses Mal geben Sie hier Slack an
BACKEND = 'Slack'  # defaults to XMPP
#In der Nähe von L135
 BOT_IDENTITY = {
     #Kommentieren Sie den XMPP-Teil aus
     # XMPP (Jabber) mode
     # 'username': 'err@localhost',  # The JID of the user you have created for the bot
     # 'password': 'changeme',       # The corresponding password for this user
#In der Nähe von L152
    #Sie benötigen ein Token, um Slack verwenden zu können. Geben Sie daher das auskommentierte Token an.
    # Slack mode (comment the others above if using this mode)
    'token': 'xoxb-your-slack-token',
#In der Nähe von L179
#Eine Liste der Konten mit Administratorrechten für diesen Errbot.@Derjenige, der von beginnt
BOT_ADMINS = ()
#In der Nähe von L185
#Die Räume und Kanäle, an denen dieser Errbot teilnimmt. Diesmal werde ich alleine so leer reden
CHATROOM_PRESENCE = ()
Am Terminal
$ errbot
12:34:47 INFO     errbot.err                Config check passed...
12:34:47 INFO     errbot.err                Selected backend 'Slack'.
(Abkürzung)
12:34:48 INFO     errbot.main               Found Backend plugin: 'Slack'
12:34:48 INFO     errbot.backends.slack     Verifying authentication token
12:34:50 INFO     requests.packages.urllib3 Starting new HTTPS connection (1): slack.com
12:34:52 INFO     errbot.backends.slack     Connecting to Slack real-time-messaging API
12:34:52 INFO     requests.packages.urllib3 Starting new HTTPS connection (1): slack.com
12:34:56 INFO     errbot.backends.slack     Connected
(Abkürzung)
12:34:57 INFO     errbot.errBot
12:34:57 INFO     errbot.errBot             Notifying connection to all the plugins...
12:34:57 INFO     errbot.plugins.ChatRoom   Callback_connect
12:34:57 INFO     errbot.errBot             Plugin activation done.
12:34:58 INFO     requests.packages.urllib3 Starting new HTTPS connection (1): slack.com
Es stellt eine Verbindung zur Messaging-API von slack her.

Klemmenseite
13:05:04 INFO     errbot.plugins.ACLS       Matching ACL {} against username @attakei for command Help:help
13:05:04 INFO     errbot.plugins.ACLS       Check if help is admin only command.
13:05:04 INFO     errbot.errBot             Processing command 'help' with parameters '' from @attakei
Betrachten Sie das Protokoll, "von wem" und "welcher Befehl" wird ausgegeben.
Wenn Sie es danach irgendwo wie Heroku platzieren, ist der Chatbot abgeschlossen
Recommended Posts