Advertisement
Guest User

Untitled

a guest
May 26th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. const botconfig = require("./botconfig.json");
  2. const prijzen = require("./prijzen.json");
  3. const Discord = require("discord.js");
  4. const bot = new Discord.Client({disableEveryone: true});
  5. const fs = require("fs");
  6. bot.commands = new Discord.Collection();
  7.  
  8. fs.readdir("./commands/", (err, files) => {
  9.  
  10. if(err) console.log(err);
  11.  
  12. let jsfile = files.filter(f => f.split(".").pop() === "js")
  13. if(jsfile.length <= 0) {
  14. console.log("Kan de commands niet vinden.")
  15. return;
  16. }
  17.  
  18. jsfile.forEach((f, i) =>{
  19. let props = require(`./commands/${f}`);
  20. console.log(`${f} loaded!`);
  21. bot.commands.set(props.help.name, props);
  22. });
  23. });
  24.  
  25. bot.on("ready", async() => {
  26. console.log(`${bot.user.username} bot is online on ${bot.guilds.size} servers!`);
  27. bot.user.setActivity("!commands voor alle commands Gemaakt door Rob1nFused");
  28. });
  29.  
  30. bot.on("message", async message => {
  31. if(message.author.bot) return;
  32. if(message.channel.type === "dm") return;
  33.  
  34. let prefix = botconfig.prefix;
  35. let messageArray = message.content.split(" ");
  36. let cmd = messageArray[0];
  37. let args = messageArray.slice(1);
  38.  
  39. let commandfile = bot.commands.get(cmd.slice(prefix.length));
  40. if(commandfile) commandfile.run(bot, message, args)
  41.  
  42.  
  43. if (cmd === `${prefix}kick`) {
  44.  
  45. return;
  46. }
  47.  
  48. if(cmd === `${prefix}ban`) {
  49.  
  50. return;
  51. }
  52.  
  53. if(cmd === `${prefix}tempmute`) {
  54.  
  55. return;
  56. }
  57.  
  58. if(cmd === `${prefix}warn`) {
  59.  
  60. return;
  61. }
  62.  
  63. if(cmd === `${prefix}warnreset`) {
  64.  
  65. return;
  66. }
  67.  
  68. if(cmd === `${prefix}warnlevel`) {
  69.  
  70. return;
  71. }
  72.  
  73. if (cmd === `${prefix}prijzen`) {
  74.  
  75. return;
  76. }
  77.  
  78. if(cmd === `${prefix}serverinfo`) {
  79.  
  80. return;
  81. }
  82.  
  83. if(cmd === `${prefix}botinfo`) {
  84.  
  85. return;
  86. }
  87.  
  88. if(cmd === `${prefix}addrecensie`) {
  89.  
  90. return;
  91. }
  92.  
  93. if(cmd === `${prefix}commands`) {
  94.  
  95. return;
  96. }
  97.  
  98. });
  99.  
  100.  
  101. bot.login(botconfig.token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement