Send users a welcome message (IM) from the slackbot when they join your Slack team. Uses https://github.com/smallwins/slack so look at that first. Load this somewhere in a running Node JS app.
var slack = require('slack'); | |
var bot = slack.rtm.client(); | |
var token = "your_slack_token"; | |
bot.team_join(function(obj) { | |
console.log("Team join triggered"); | |
slack.chat.postMessage( | |
{ | |
token: token, | |
channel: obj.user.id, | |
text: "Hello new user and welcome to the team!" | |
}, | |
function(err, data) { | |
// Handle errors here | |
}) | |
; | |
}); | |
bot.listen({token: token}); |
This comment has been minimized.
This comment has been minimized.
Check out https://janitr.net |
This comment has been minimized.
This comment has been minimized.
thanks @kbariotis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Which dependency do I use in package.json? thanks