Our clan uses Slack for keeping in touch. I created a Slack bot that utilizes the Slack real-time API to welcome new Destiny guardians to the clan.
The bot is written in node.js and deployed in AWS utlizing Elastik Beanstalk. The welcome message is stored in a flat file that is read at run time. I had hoped I could change the contents of the flat file without deploying each time a change was requested. Unfortunately, I was wrong but am too lazy to bring the message into the main code as a variable :-)
The Slack token and channel are stored in process.env as part of the Elastik Beanstalk configuration. So Destiny related but not really :-)
Jason
[quote]
var fs = require('fs');
var token = process.env.token;
var RtmClient = require('@slack/client').RtmClient;
var RTM_EVENTS = require('@slack/client').RTM_EVENTS;
var rtm = new RtmClient(token);
rtm.start();
rtm.on(RTM_EVENTS.TEAM_JOIN, function handleRtmTeamJoin(team) {
var channel = process.env.channel;
var welcome = fs.readFileSync('welcome.msg', 'utf8');
rtm.sendMessage('<@' + team.user.id + '> welcome to Iron Orange! ' + welcome, channel);
console.log('User added:', team);
});
[/quote]
Your role as a moderator enables you immediately ban this user from messaging (bypassing the report queue) if you select a punishment.
7 Day Ban
7 Day Ban
30 Day Ban
Permanent Ban
This site uses cookies to provide you with the best possible user experience. By clicking 'Accept', you agree to the policies documented at Cookie Policy and Privacy Policy.
Accept
This site uses cookies to provide you with the best possible user experience. By continuing to use this site, you agree to the policies documented at Cookie Policy and Privacy Policy.
close
Our policies have recently changed. By clicking 'Accept', you agree to the updated policies documented at Cookie Policy and Privacy Policy.
Accept
Our policies have recently changed. By continuing to use this site, you agree to the updated policies documented at Cookie Policy and Privacy Policy.