Advertisement
Ryyan

Untitled

Jul 25th, 2019
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. client.on("ready", () => {
  2.  
  3. // This event will run if the bot starts, and logs in, successfully.
  4. console.log(`logged in as ${client.user.tag}`);
  5. // Example of changing the bot's playing game to something useful. `client.user` is what the
  6. // docs refer to as the "ClientUser".
  7.  
  8. // Set the client user's status
  9. client.user.setStatus('online')
  10. client.user.setPresence({
  11. game: {
  12. name: `Youtube! Ryyan`,
  13. type: "watching",
  14. url: "https://www.twitch.tv/monstercat"
  15. }
  16. });
  17. });
  18.  
  19. client.on("message", async message => {
  20. // This event will run on every single message received, from any channel or DM.
  21.  
  22. // It's good practice to ignore other bots. This also makes your bot ignore itself
  23. // and not get into a spam loop (we call that "botception").
  24. if(message.author.bot) return;
  25.  
  26. // Also good practice to ignore any message that does not start with our prefix,
  27. // which is set in the configuration file.
  28. if(message.content.indexOf(config.prefix) !== 0) return;
  29.  
  30. // Here we separate our "command" name, and our "arguments" for the command.
  31. // e.g. if we have the message "+say Is this the real life?" , we'll get the following:
  32. // command = say
  33. // args = ["Is", "this", "the", "real", "life?"]
  34. const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
  35. const command = args.shift().toLowerCase();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement