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

33 lines
1.1 KiB

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<void> {
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()