diff --git a/packages/core/src/classes/managers/CommandManager.ts b/packages/core/src/classes/managers/CommandManager.ts index d1bb05ca..891136f2 100644 --- a/packages/core/src/classes/managers/CommandManager.ts +++ b/packages/core/src/classes/managers/CommandManager.ts @@ -90,7 +90,7 @@ export class CommandManager { return this.addHalts(normalizeArray(data)); } - public async executeHalts(trigger: T): Promise|null> { + public async executeHalts(trigger: T): Promise|boolean> { const halts: CommandHalt[] = []; const disabledHalts = trigger.executeData.builder.disabled_halts; @@ -103,15 +103,19 @@ export class CommandManager { halts.push(...this.halts.values()); + let handled = false; + for (const halt of halts) { if (halt.disabled || disabledHalts.some(p => p === halt.id) || !halt.commandTypes.includes(trigger.commandType)) continue; const data = await halt.execute(trigger); if (data === null) continue; if (!data.successful) return data; + + handled = true; } - return null; + return handled; } public get(command: string, type: CommandType.ContextMenuCommand): ContextMenuCommandBuilder|undefined; diff --git a/packages/core/src/classes/structures/RecipleClient.ts b/packages/core/src/classes/structures/RecipleClient.ts index df06cbcc..e13452de 100644 --- a/packages/core/src/classes/structures/RecipleClient.ts +++ b/packages/core/src/classes/structures/RecipleClient.ts @@ -114,7 +114,7 @@ export class RecipleClient extends Client