From b40d420de7e13e0641a509950f8d02669ec4af8e Mon Sep 17 00:00:00 2001 From: SkyBlockDev <72335827+SkyBlockDev@users.noreply.github.com> Date: Fri, 6 Aug 2021 09:21:51 +0200 Subject: [PATCH] fix error with prompts and slash commands --- .vscode/settings.json | 5 ++++- src/struct/commands/Command.ts | 3 --- src/struct/commands/CommandHandler.ts | 10 +++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e40716f..8a2c345 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "deno.enable": true, "deno.lint": true, - "deno.unstable": true + "deno.unstable": true, + "deno.suggest.imports.hosts": { + "https://deno.land": false + } } diff --git a/src/struct/commands/Command.ts b/src/struct/commands/Command.ts index 697543c..5ef92f9 100644 --- a/src/struct/commands/Command.ts +++ b/src/struct/commands/Command.ts @@ -73,7 +73,4 @@ export abstract class NaticoCommand extends NaticoModule { this.category = category || "general"; } - exec(_message: DiscordenoMessage, _options: Arguments): Promise | any { - throw new Error(`NOT_CREATED ${this.id}`); - } } diff --git a/src/struct/commands/CommandHandler.ts b/src/struct/commands/CommandHandler.ts index b77421a..52372ba 100644 --- a/src/struct/commands/CommandHandler.ts +++ b/src/struct/commands/CommandHandler.ts @@ -409,9 +409,13 @@ export class NaticoCommandHandler extends NaticoHandler { const options: ApplicationCommandOption[] = []; if (command.options) { command.options.forEach((option) => { - delete option["match"]; - delete option["customType"]; - options.push(option); + options.push({ + name: option.name, + description: option.description, + options: option.options, + type: option.type, + required: option.required, + }); }); } if (command.options) slashdata["options"] = options;