Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const keepAlive = require("./server");
- const Discord = require('discord.js');
- const bot = new Discord.Client();
- const { token, prefix } = require('./botconfig.json');
- const ms = require('ms');
- const fs = require('fs');
- // Command FS
- bot.commands = new Discord.Collection();
- const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
- for (const file of commandFiles) {
- const command = require(`./commands/${file}`);
- bot.commands.set(command.name, command);
- }
- bot.on('ready', () => {
- const DTchannel = bot.channels.cache.get('754848163327901717');
- const DT = new Discord.MessageEmbed()
- .setTitle('🚨 Down Time 🚨')
- .setDescription('The bot is currently experiencing downtime, Please dont be alarmed.')
- .setTimestamp()
- .setColor(0xf76060)
- .setFooter('Developed by: Space')
- console.log('Utilities bot is online!');
- bot.user.setActivity('Popsiz | help', { type: "LISTENING" })
- .then(presence => console.log(`Activity set to ${presence.activities[0].name}`))
- .catch(console.error)
- const Maitnence = new Discord.MessageEmbed()
- .setTitle('Maitnence')
- .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.')
- .setTimestamp()
- .setColor(0x3477eb)
- .setFooter('Developed by: Space')
- const Error = new Discord.MessageEmbed()
- .setTitle('System Error')
- .setDescription('We are currently experiencing some errors in our scripts. Please be patient as we try to fix this.')
- .setTimestamp()
- .setColor(0x3477eb)
- .setFooter('Developed by: Space')
- // DTchannel.send(Maitnence)
- // DTchannel.send(DT)
- // DTchannel.send(Error)
- // DTchannel.send('@here')
- })
- bot.on("message", message => {
- if (!message.content.startsWith(prefix) || message.author.bot) return;
- const args = message.content.slice(prefix.length).split(/ +/);
- const commandName = args.shift().toLowerCase();
- const command = bot.commands.get(commandName) || bot.commands.find(cmd => cmd.aliases && cmd.aliases.inclueds(commandName));
- try {
- command.execute(message, args);
- } catch (error) {
- console.error(error)
- message.reply('an issue occurred, please contact support if this persists.')
- }
- })
- keepAlive();
- bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment