var Botkit = require('botkit'); const controller = Botkit.slackbot({ debug: false, retry: Infinity //https://botkit.ai/docs/readme-slack.html#botkitslackbot }); controller.spawn({ token: "xoxb-から始まるトークン" }).startRTM(function (err) { if (err) { throw new Error(err); } }); /** * RTM APIのイベント * これがないと「Error: Stale RTM connection, closing RTM」というエラーになる */ controller.on('rtm_open', (bot, message) => {
