beepboop-botkit - Run a multi-team botkit bot on Beep Boop.
Supporting multiple teams from a single bot process is made simpler as
beepboop-botkit handles "spawning" as new teams add your bot.
npm install --save beepboop-botkit
var Botkit =var BeepBoop =var controller = Botkitvar beepboop = BeepBoopstartcontroller// listen for botkit controller eventscontroller// Optionally you may want to listen to beepboop eventsbeepboop
see examples/simple.js for an example.
Module has exported function
options.debugBoolean - Logs debug output if true
- Returns an EventEmitter2 instance. For more information on the events exposed, please see the underlying
beepboopmodule's documentation, as it is what is returned here.
Accessing botkit workers
Since there can be multiple botkit workers spawned (1 for each team), these are exposed via a
workers property on the returned beepboop instance after calling
workers property is an object hash where the key is a unique resource id identifying the worker, and the value is the botkit worker as returned from botkit's
spawn() function. :
var Botkit =var BeepBoop =var controller = Botkitvar beepboop = BeepBoopstartcontroller// after teams have been addedbeepboop
botkit.rtm.started - (bot, resource, meta)
bot- Botkit bot instance
resource- Beep Boop resource from an
meta- additional metadata about event
meta.isNew- Boolean -
trueif this is a brand new team that was just added (only true once)
After a new Slack RTM connection has been established, useful if you want to message a user right away, or after they added the bot to their team.
var beepboop = BeepBoopstartcontroller// Send the user who added the bot to their team a welcome message the first time it's connectedbeepboop