Sir_Spaceboi

code

Sep 13th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const bot = new Discord.Client();
  3. bot.commands = new Discord.Collection();
  4. const { token, prefix} = require('./botconfig.json');
  5. const fs = require('fs');
  6.  
  7. bot.commands = new Discord.Collection();
  8. const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
  9.  
  10. for(const file of commandFiles) {
  11. const command = require(`./commands/${file}`);
  12.  
  13. bot.command.set(command.name, command);
  14. }
  15.  
  16.  
  17. bot.on('ready', () => {
  18. console.log('Bot is online!');
  19. bot.user.setActivity('Popsiz Group', { type: "WATCHING" })
  20. .then(presence => console.log(`Activity set to ${presence.activities[0].name}`))
  21. .catch(console.error);
  22. })
  23.  
  24.  
  25. bot.on("message", message => {
  26. if (message.author.bot) return
  27.  
  28. const args = message.content.slice(prefix.length).trim().split(/ +/g);
  29. const command = args.shift().toLowerCase();
  30.  
  31. })
  32.  
  33. bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment