import {adminId, SubcommandData} from "../types" import {ApplicationCommandOptionType, ApplicationCommandSubCommandData, ChatInputCommandInteraction} from "discord.js" class ShutdownCommand extends SubcommandData { readonly definition: ApplicationCommandSubCommandData = { name: "shutdown", type: ApplicationCommandOptionType.Subcommand, description: "Tells the bot to shut down.", } async execute(b: ChatInputCommandInteraction): Promise { const user = b.user || b.member if (!!user && user.id === adminId) { await b.reply({ ephemeral: true, content: "Good night =w=", }) const self = b.client.user self.presence.set({ status: "invisible", activities: [], }) b.client.destroy() } else { await b.reply({ ephemeral: true, content: "Heeey... I don't gotta do what you say...", }) } } } export const commandBotShutdown = new ShutdownCommand()