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.
31 lines
1.1 KiB
31 lines
1.1 KiB
import {BaseChatInputCommandData, CommandWithSubcommandsData, SubcommandData} from "../types"
|
|
import {ApplicationCommandType} from "discord.js"
|
|
import {BotRestartCommand} from "./restart"
|
|
import {BotShutdownCommand} from "./shutdown"
|
|
import {BotRebuildCommand} from "./rebuild"
|
|
import {UsersManager} from "../../managers/users";
|
|
|
|
export class BotCommand extends CommandWithSubcommandsData {
|
|
readonly rebuild: BotRebuildCommand
|
|
readonly restart: BotRestartCommand
|
|
readonly shutdown: BotShutdownCommand
|
|
readonly subcommands: SubcommandData[]
|
|
|
|
constructor({users, cleanUp}: { users: UsersManager, cleanUp: () => Promise<void> }) {
|
|
super()
|
|
this.rebuild = new BotRebuildCommand({users, cleanUp})
|
|
this.restart = new BotRestartCommand({users, cleanUp})
|
|
this.shutdown = new BotShutdownCommand({users, cleanUp})
|
|
this.subcommands = [
|
|
this.rebuild,
|
|
this.restart,
|
|
this.shutdown,
|
|
]
|
|
}
|
|
|
|
readonly baseDefinition: BaseChatInputCommandData = {
|
|
name: "bot",
|
|
type: ApplicationCommandType.ChatInput,
|
|
description: "Commands to manage the bot's status.",
|
|
}
|
|
} |