Rosieee

Discord bot

Jun 4th, 2020
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. const botconfig = require("./botconfig.json");
  2. const Discord = require("discord.js");
  3.  
  4. const bot = new Discord.Client({disableEveryone: true})
  5.  
  6. bot.on("ready", async () => {
  7. console.log(`${bot.user.username} is online.`)
  8. bot.user.setActivity("Tutorial Bot", {type: "STREAMING"});
  9.  
  10. })
  11.  
  12. bot.on("message", async message => {
  13. if(message.author.bot || message.channel.type === "dm")
  14.  
  15. let prefix = botconfig.prefix;
  16. let messageArray = message.content.split(" ")
  17. let cmd = messageArray[0];
  18. let args = messageArray.slice[0];
  19.  
  20. if(cmd === `${prefix}test`){
  21. return message.channel.send("Working")
  22. }
  23. })
  24.  
  25. bot.login(botconfig.token);
Add Comment
Please, Sign In to add comment