37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
module.exports = {
|
|
|
|
name: require('path').parse(__filename).name,
|
|
description: "IT'S TIME TO STOP!... the bot",
|
|
options: [],
|
|
|
|
async parseMessage (client, config, message) {
|
|
await message.channel.send(await this.handle(client, config, message.author));
|
|
process.exit();
|
|
},
|
|
|
|
async parseInteraction (client, config, interaction) {
|
|
await interaction.reply(await this.handle(client, config, interaction.user));
|
|
process.exit();
|
|
},
|
|
|
|
async handle (client, config, user) {
|
|
if (user.id === config.ownerID) {
|
|
console.log('[SYSTEM] [INFO] ' + ` The bot is going down for shut down. \nShutdown requested by ${user.username}`);
|
|
return {
|
|
embeds: [{
|
|
title: '**Shut down the bot**',
|
|
description: '<a:AnitroxWorking:697147309531594843> **Shutting Down...**',
|
|
color: 9442302,
|
|
footer: {
|
|
icon_url: user.displayAvatarURL(),
|
|
text: config.footerTxt
|
|
}
|
|
}]
|
|
};
|
|
} else {
|
|
console.error('[SYSTEM] [ERR] User ' + user.username + " tried to shut down the bot, but doesn't have permission! If this was you, Check your config.json");
|
|
return client.generateErrorMessage('Only the bot owner can stop the bot! Stop.', user.displayAvatarURL());
|
|
}
|
|
}
|
|
};
|