Created
July 5, 2018 06:55
-
-
Save uutarou10/5b09fbded5e1914368e430978b6b7630 to your computer and use it in GitHub Desktop.
チャンネルが凍りつくSlack bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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