Skip to content

Instantly share code, notes, and snippets.

View mbrevoort's full-sized avatar

Mike Brevoort mbrevoort

View GitHub Profile
// convo handlers are registered with unique strings
const handleGoodDay = 'handleGoodDay'
// handle any DM that starts with 'hi'
slapp.message('^hi', 'direct_message', (msg) => {
// Ask how they are and route next message to handleGoodDay handler
msg.say('Are you having a good day?').route(handleGoodDay)
})
// register handleGoodDay handler
bb-slackaccesstoken // Slack user token for user who added your Slack App
bb-slackuserid // User Id of the user who added your Slack App
bb-slackbotaccesstoken // Bot access token if the app uses a bot
bb-slackbotuserid // User Id of bot user if the app uses a bot
bb-slackbotusername // Username of the bot user
bb-slackteamid // Slack team Id
bb-slackteamname // Slack team name
bb-slackteamdomain // Slack Domain name of the team
@mbrevoort
mbrevoort / message-builder-example.js
Last active January 9, 2017 03:22
Slack Message Builder Example
const smb = require('slack-message-builder')
smb()
.text("Would you like to play a game?")
.attachment()
.text("Choose a game to play")
.fallback("You are unable to choose a game")
.callbackId("wopr_game")
.color("#3AA3E3")
.action()
.name("chess")