SHARE
TWEET

My eris code

a guest Jun 19th, 2017 45 in 2 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Eris = require("eris");
  2.  
  3. var bot = new Eris("mytoken");
  4.  
  5.  
  6. bot.on("ready", () => {
  7.     console.log("Ready!");
  8. });
  9. //WELCOMER
  10. bot.on("guildMemberAdd", (guild, member) => {
  11.     var response = `Hi ${member.mention} and welcome to to ${guild.name}! We hope that you'll have a great time here :smiley:!`;
  12.    
  13.  
  14.    bot.createMessage(guild.defaultChannel.id, response);
  15.    
  16. });
  17.  
  18. bot.on("guildMemberRemove", (guild, member) => {
  19.    var response = `Bye @${member.user.username}!`;
  20.    
  21.  
  22.    bot.createMessage(guild.defaultChannel.id, response);
  23.    
  24. });
  25. //MESSAGES
  26. bot.on("messageCreate", (msg) => {
  27.    if(msg.content === "?ping") {
  28.        bot.createMessage(msg.channel.id, "Pong!");
  29.        
  30.    } else if(msg.content === "?pong") {
  31.        bot.createMessage(msg.channel.id, "Ping!");
  32.        
  33.    }
  34. });
  35. //GAME/STATUS
  36. client.on.editStatus({game:"game"})
  37.  
  38. bot.connect();
RAW Paste Data
Want to get better at JavaScript?
Learn to code JavaScript in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top