Created
November 16, 2015 19:29
-
-
Save meew0/5c3c6fc371d7cce03b46 to your computer and use it in GitHub Desktop.
Bot that links you to a youtube video when you first join a server
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
var Discord = require('discord.js'); | |
var client = new Discord.Client(); | |
// Handle discord.js warnings | |
client.on('warn', (m) => console.log('[warn]', m)); | |
client.on('serverNewMember', (server, user) => { | |
var defChannel = server.defaultChannel; | |
defChannel.sendMessage(`${user.mention()}, https://www.youtube.com/watch?v=Za2PJnCAkUA`); | |
}); | |
// Email and password over command line | |
client.login(process.argv[2], process.argv[3]).catch((e) => console.log(e)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need node, at least version 5, and hydra's rewrite: