Created
October 13, 2018 13:17
-
-
Save o0h/398adbecb6946b41ece752dca2399c01 to your computer and use it in GitHub Desktop.
Slack用の最低限のbotkit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // obtain from: | |
| // Botkitで最小構成のSlack Bot https://qiita.com/nobukatsu/items/88917a2348628244bc42 | |
| // howdyai/botkit https://github.com/howdyai/botkit | |
| const botkit = require('botkit') | |
| const controller = botkit.slackbot({ debug: true }) | |
| controller.hears('hello', ['direct_message', 'direct_mention'], (bot, message) => { | |
| bot.reply(message, 'Hello yourself!') | |
| }) | |
| controller | |
| .spawn({ | |
| token: process.env.SLACK_TOKEN | |
| }) | |
| .startRTM(function(err) { | |
| if (err) { | |
| throw new Error(err) | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment