1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-09-30 00:50:59 -04:00
Daggerbot-TS/src/commands/restart.ts

11 lines
577 B
TypeScript
Raw Normal View History

import Discord,{SlashCommandBuilder} from 'discord.js';
import { TClient } from 'src/client';
export default {
async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
if (!client.config.eval.whitelist.includes(interaction.user.id)) return client.youNeedRole(interaction, 'bottech');
interaction.reply('Restarting...').then(()=>require('node:child_process').exec('pm2 restart Daggerbot'))
},
data: new SlashCommandBuilder()
.setName('restart')
.setDescription('Restart the bot for technical reasons')
}