Skip to content

Instantly share code, notes, and snippets.

@selfcontained
Created August 4, 2016 15:31
Show Gist options
  • Save selfcontained/b0f6b28554055f33eaffe75600d774ed to your computer and use it in GitHub Desktop.
Save selfcontained/b0f6b28554055f33eaffe75600d774ed to your computer and use it in GitHub Desktop.
// Send a message to the user that added the bot right after it connects
slapp.event('bb.team_added', function (msg) {
slapp.client.im.open({ token: msg.meta.bot_token, user: msg.meta.user_id }, (err, data) => {
if (err) {
return console.error(err)
}
let channel = data.channel.id
msg
.say({ channel, text: 'Thanks for adding me to your team!' })
.say({ channel, text: 'Please /invite me to a channel to get things started.' })
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment