You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
vore-rpg/src/commands/bot/shutdown.ts

27 lines
965 B

import {adminId, SubcommandData} from "../types.js"
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<void> {
const user = b.user || b.member
if (!!user && user.id === adminId) {
await b.reply("Good night =w=")
const self = b.client.user
self.presence.set({
status: "invisible",
activities: [],
})
b.client.destroy()
} else {
await b.reply("Heeey... I don't gotta do what you say...")
}
}
}
export const commandBotShutdown = new ShutdownCommand()