diff --git a/package.json b/package.json index 125ac15..f67233b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eazyautodelete/eazyautodelete-core", - "version": "1.5.1", + "version": "1.5.2", "description": "🧰 Core Package used by the EazyAutodelete Discord Bot", "main": "build/index.js", "scripts": { diff --git a/src/structures/ButtonArgs.ts b/src/structures/ButtonArgs.ts index b0cbac3..dd88093 100644 --- a/src/structures/ButtonArgs.ts +++ b/src/structures/ButtonArgs.ts @@ -9,6 +9,10 @@ export default class ButtonArgs { this.command = this.getCommand(); } + isCommand(): boolean { + return this.button.interaction.customId?.startsWith("cmd_") || false; + } + getCommand(): string { return this.button.interaction.customId.split("_")[1] as string; } diff --git a/src/structures/CommandButton.ts b/src/structures/CommandButton.ts index 8a4c1ba..ea8b4ee 100644 --- a/src/structures/CommandButton.ts +++ b/src/structures/CommandButton.ts @@ -123,9 +123,19 @@ export default class CommandButton { return this; } - async continue(): Promise { + async continue(ephemeral: boolean = true): Promise { try { - await this.interaction.deferReply().catch(this.Logger.error); + await this.interaction.deferReply({ ephemeral: ephemeral}).catch(this.Logger.error); + } catch (e) { + this.Logger.error(e as string); + } + + return this; + } + + async deferUpdate() { + try { + await this.interaction.deferUpdate().catch(this.Logger.error); } catch (e) { this.Logger.error(e as string); }