Templuzy

index.js

Feb 3rd, 2021 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2.  
  3. const client = new Discord.Client();
  4.  
  5. const prefix = 'hmb '
  6.  
  7. const fs = require('fs');
  8.  
  9. client.commands = new Discord.Collection();
  10.  
  11. const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
  12. for(const file of commandFiles){
  13.     const command = require(`./commands/${file}`);
  14.  
  15.     client.commands.set(command.name, command);
  16. }
  17.  
  18.  
  19. client.once('ready', () => {
  20.     console.log('BB is online!')
  21.     //Below Status  
  22.     //Below Auto-Changing Status
  23.     setInterval(() => {
  24.         const statuses = [
  25.             `hmb help`,
  26.             `BURGERS!!!!`,
  27.         ]
  28.  
  29.         const status = statuses[Math.floor(Math.random() * statuses.length)]
  30.         client.user.setActivity(status, { type: "STREAMING"}) // Can Be WATCHING, STREAMING, LISTENING
  31.     }, 5000) // Second You Want to Change Status, This Cahnges Every 2 Seconds
  32. })
  33.  
  34. client.on('message', message =>{
  35.     if(!message.content.startsWith(prefix) || message.author.bot) return;
  36.  
  37.     const args = message.content.slice(prefix.length).split(/ +/);
  38.     const command = args.shift().toLowerCase();
  39.  
  40.     if(command === 'ping'){
  41.         client.commands.get('ping').execute(message, args);
  42.     } else if(command === 'ban'){
  43.         client.commands.get('ban').execute(message, args);
  44.     } else if(command === 'kick'){
  45.         client.commands.get('kick').execute(message, args);
  46.     } else if(command === 'help'){
  47.         client.commands.get('help').execute(message, args);
  48.     } else if(command === 'burger'){
  49.         client.commands.get('burger').execute(message, args);
  50.     } else if(command === 'hungry'){
  51.         client.commands.get('hungry').execute(message, args);
  52.     } else if(command === 'give'){
  53.         client.commands.get('give').execute(message, args);
  54.     } else if(command === 'warn'){
  55.         client.commands.get('warn').execute(message, args, Discord)
  56.     }
  57. });
  58.  
  59. client.login('ADPzMjYTMoIpRzMxNzI5NDI4.YA7MSw.acC1c5VoCeXdKL1tlNxDtih4vMs');
Add Comment
Please, Sign In to add comment