Sir_Spaceboi

Untitled

Nov 15th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. const keepAlive = require("./server");
  2. const Discord = require('discord.js');
  3. const bot = new Discord.Client();
  4. const { token, prefix } = require('./botconfig.json');
  5. const ms = require('ms');
  6. const fs = require('fs');
  7.  
  8. // Command FS
  9. bot.commands = new Discord.Collection();
  10. const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
  11.  
  12. for (const file of commandFiles) {
  13. const command = require(`./commands/${file}`);
  14.  
  15. bot.commands.set(command.name, command);
  16. }
  17.  
  18. bot.on('ready', () => {
  19. const DTchannel = bot.channels.cache.get('754848163327901717');
  20.  
  21. const DT = new Discord.MessageEmbed()
  22. .setTitle('🚨 Down Time 🚨')
  23. .setDescription('The bot is currently experiencing downtime, Please dont be alarmed.')
  24. .setTimestamp()
  25. .setColor(0xf76060)
  26. .setFooter('Developed by: Space')
  27.  
  28. console.log('Utilities bot is online!');
  29. bot.user.setActivity('Popsiz | help', { type: "LISTENING" })
  30. .then(presence => console.log(`Activity set to ${presence.activities[0].name}`))
  31. .catch(console.error)
  32.  
  33. const Maitnence = new Discord.MessageEmbed()
  34. .setTitle('Maitnence')
  35. .setDescription('The bot is currently having maitnence, please be aware if there are any lag spikes with the bot at **any** time within 8:30 AM EST. We do not expect any downtime however, if there is please be patent.')
  36. .setTimestamp()
  37. .setColor(0x3477eb)
  38. .setFooter('Developed by: Space')
  39.  
  40. const Error = new Discord.MessageEmbed()
  41. .setTitle('System Error')
  42. .setDescription('We are currently experiencing some errors in our scripts. Please be patient as we try to fix this.')
  43. .setTimestamp()
  44. .setColor(0x3477eb)
  45. .setFooter('Developed by: Space')
  46.  
  47. // DTchannel.send(Maitnence)
  48. // DTchannel.send(DT)
  49. // DTchannel.send(Error)
  50. // DTchannel.send('@here')
  51.  
  52. })
  53.  
  54.  
  55.  
  56. bot.on("message", message => {
  57. if (!message.content.startsWith(prefix) || message.author.bot) return;
  58.  
  59. const args = message.content.slice(prefix.length).split(/ +/);
  60. const commandName = args.shift().toLowerCase();
  61.  
  62. const command = bot.commands.get(commandName) || bot.commands.find(cmd => cmd.aliases && cmd.aliases.inclueds(commandName));
  63.  
  64. try {
  65. command.execute(message, args);
  66. } catch (error) {
  67. console.error(error)
  68. message.reply('an issue occurred, please contact support if this persists.')
  69. }
  70. })
  71.  
  72. keepAlive();
  73. bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment