diff --git a/packages/commandkit/src/components/ButtonKit.ts b/packages/commandkit/src/components/ButtonKit.ts index 2bd21b95..aef26185 100644 --- a/packages/commandkit/src/components/ButtonKit.ts +++ b/packages/commandkit/src/components/ButtonKit.ts @@ -18,7 +18,7 @@ export type CommandKitButtonBuilderInteractionCollectorDispatch = ( interaction: ButtonInteraction, ) => Awaitable; -export type CommandKitButtonBuilderOnEnd = () => Awaitable; +export type CommandKitButtonBuilderOnEnd = (reason: string) => Awaitable; export type CommandKitButtonBuilderInteractionCollectorDispatchContextData = { /** @@ -156,15 +156,15 @@ export class ButtonKit extends ButtonBuilder { return handler(interaction); }); - this.#collector.on('end', () => { + this.#collector.on('end', (_, reason) => { this.#destroyCollector(); - this.#onEndHandler?.(); + this.#onEndHandler?.(reason); }); } public dispose() { this.#destroyCollector(); - this.#onEndHandler?.(); + this.#onEndHandler?.('disposed'); return this; }