Guest User

Untitled

a guest
May 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. var config = './config';
  2. const Eris = require("eris");
  3.  
  4. var bot = new Eris(config.token);
  5. // Replace BOT_TOKEN with your bot account's token
  6.  
  7. bot.on("ready", () => { // When the bot is ready
  8. console.log("Ready!"); // Log "Ready!"
  9. });
  10.  
  11. bot.on("messageCreate", (msg) => { // When a message is created
  12. if(msg.content === "!ping") { // If the message content is "!ping"
  13. bot.createMessage(msg.channel.id, "Pong!");
  14. // Send a message in the same channel with "Pong!"
  15. } else if(msg.content === "!pong") { // Otherwise, if the message is "!pong"
  16. bot.createMessage(msg.channel.id, "Ping!");
  17. // Respond with "Ping!"
  18. }
  19. });
  20.  
  21. bot.connect(); // Get the bot to connect to Discord
Add Comment
Please, Sign In to add comment