2021-01-26 14:03:02 -06:00
|
|
|
module.exports = {
|
2022-04-18 11:25:40 -05:00
|
|
|
|
|
|
|
name: require('path').parse(__filename).name,
|
2022-03-29 18:53:55 -05:00
|
|
|
description: 'Restarts the bot',
|
2022-04-21 20:53:03 -05:00
|
|
|
options: [],
|
2022-04-21 18:09:21 -05:00
|
|
|
|
2022-04-23 13:07:50 -05:00
|
|
|
async parseMessage (client, config, message) {
|
|
|
|
await message.channel.send(await this.handle(client, config, message.author));
|
2022-04-21 23:44:02 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
async parseInteraction (client, config, interaction) {
|
2022-04-23 13:07:50 -05:00
|
|
|
await interaction.reply(await this.handle(client, config, interaction.user));
|
2022-04-21 23:44:02 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
async handle (client, config, user) {
|
|
|
|
if (user.id === config.ownerID) {
|
2022-04-21 18:09:21 -05:00
|
|
|
console.log('Anitrox is restarting now!');
|
2022-04-21 23:44:02 -05:00
|
|
|
// await message.channel.send('<a:NyabotWorking:697147309531594843> Restarting...');
|
2022-03-26 03:33:18 -05:00
|
|
|
try {
|
|
|
|
client.destroy();
|
2022-03-29 13:55:44 -05:00
|
|
|
await client.login(config.token);
|
2022-04-21 18:09:21 -05:00
|
|
|
console.log('All systems go');
|
2022-04-21 23:44:02 -05:00
|
|
|
return '<:NyabotSuccess:697211376740859914> Restart Successful';
|
|
|
|
} catch (e) { console.error(e); }
|
2022-03-26 03:33:18 -05:00
|
|
|
} else {
|
2022-04-21 23:44:02 -05:00
|
|
|
return '<:NyabotDenied:697145462565896194> Access Denied, You must be bot owner to execute this command.';
|
2022-03-26 03:33:18 -05:00
|
|
|
}
|
|
|
|
}
|
2022-04-21 18:09:21 -05:00
|
|
|
};
|