diff --git a/src/client/client.ts b/src/client/client.ts index 346dcf4..c6079a0 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -219,8 +219,8 @@ export interface ClientOptions extends BaseClientOptions { }; commands?: BaseClientOptions['commands'] & { prefix?: (message: MessageStructure) => Awaitable; - deferReplyResponse?: (ctx: CommandContext) => Parameters[0]; - reply?: (ctx: CommandContext) => boolean; + deferReplyResponse?: (ctx: CommandContext) => Awaitable[0]>; + reply?: (ctx: CommandContext) => Awaitable; }; handlePayload?: ShardManagerOptions['handlePayload']; resharding?: PickPartial, 'getInfo'>; diff --git a/src/commands/applications/chatcontext.ts b/src/commands/applications/chatcontext.ts index 82be4c4..ef04fb7 100644 --- a/src/commands/applications/chatcontext.ts +++ b/src/commands/applications/chatcontext.ts @@ -79,7 +79,7 @@ export class CommandContext< if (this.interaction) return this.interaction.write(body, withResponse); const options = (this.client as Client | WorkerClient).options?.commands; return (this.messageResponse = await (this.message! as Message)[ - !this.messageResponse && options?.reply?.(this) ? 'reply' : 'write' + !this.messageResponse && (await options?.reply?.(this)) ? 'reply' : 'write' ](body)) as never; } @@ -97,8 +97,8 @@ export class CommandContext< return this.interaction.deferReply(ephemeral ? MessageFlags.Ephemeral : undefined, withResponse); this.__deferred = true; const options = (this.client as Client | WorkerClient).options?.commands; - return (this.messageResponse = await (this.message! as Message)[options?.reply?.(this) ? 'reply' : 'write']( - options?.deferReplyResponse?.(this) ?? { content: 'Thinking...' }, + return (this.messageResponse = await (this.message! as Message)[(await options?.reply?.(this)) ? 'reply' : 'write']( + (await options?.deferReplyResponse?.(this)) ?? { content: 'Thinking...' }, )) as never; }