From 9bde7d135ad9b7a304d0a832f850e5964ade949d Mon Sep 17 00:00:00 2001 From: PleahMaCaka Date: Sun, 1 May 2022 15:02:08 +0900 Subject: [PATCH] Chore: add todo, delete semicolon --- src/Client.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Client.ts b/src/Client.ts index 0613d88..a069704 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,13 +1,12 @@ -import { Client as ClientJS, ClientOptions, Interaction } from "discord.js"; -import { Slash } from "./ts/interface/Slash"; -import { SlashInfo } from "./ts/interface/SlashInfo"; -import { REST } from "@discordjs/rest"; -import { Routes } from "discord-api-types/v9"; -import { DeployType } from "./ts/types/DeployType"; +import { Client as ClientJS, ClientOptions, Interaction } from "discord.js" +import { Slash } from "./ts/interface/Slash" +import { SlashInfo } from "./ts/interface/SlashInfo" +import { REST } from "@discordjs/rest" +import { Routes } from "discord-api-types/v9" +import { DeployType } from "./ts/types/DeployType" export class Client extends ClientJS { - debug: boolean constructor(options: ClientOptions, debug?: boolean) { @@ -42,7 +41,7 @@ export class Client extends ClientJS { private _slashInteractionHandler() { this.on('interactionCreate', async (interaction: Interaction) => { - if (!interaction.isCommand()) return; + if (!interaction.isCommand()) return try { await Client._allSlash.get(interaction.commandName)!!.execute(interaction, this) @@ -55,6 +54,7 @@ export class Client extends ClientJS { // deploy the slash command public deploy(token: string, deployType: DeployType = "GUILD") { // TODO GLOBAL DEPLOY + // TODO Automatic command deploy when the bot join to the guild this._slashInteractionHandler() const rest = new REST({ version: '9' }).setToken(token) @@ -78,4 +78,4 @@ export class Client extends ClientJS { } }) } -} +} \ No newline at end of file