Skip to content

Instantly share code, notes, and snippets.

@uutarou10
Created July 5, 2018 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uutarou10/5b09fbded5e1914368e430978b6b7630 to your computer and use it in GitHub Desktop.
Save uutarou10/5b09fbded5e1914368e430978b6b7630 to your computer and use it in GitHub Desktop.
チャンネルが凍りつくSlack bot
const { RTMClient } = require('@slack/client');
const token = ENV.SLACK_TOKEN
const rtm = new RTMClient(token)
rtm.start();
rtm.on('message', event => {
messages = [
'黙れよ',
'ド素人が',
'消えろ',
'失せろ',
'人生やり直せ'
]
rtm.sendMessage(`<@${event.user}> ${messages[Math.floor(Math.random() * messages.length)]}`, event.channel);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment