mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +00:00
fix: apply extendContext to ModalContext
This commit is contained in:
parent
92c39b91c4
commit
44b0a6354f
@ -35,6 +35,7 @@ import type {
|
||||
ComponentInteraction,
|
||||
Message,
|
||||
MessageCommandInteraction,
|
||||
ModalSubmitInteraction,
|
||||
UserCommandInteraction,
|
||||
} from '../structures';
|
||||
|
||||
@ -333,6 +334,7 @@ export interface BaseClientOptions {
|
||||
| UserCommandInteraction<boolean>
|
||||
| MessageCommandInteraction<boolean>
|
||||
| ComponentInteraction
|
||||
| ModalSubmitInteraction
|
||||
| When<InferWithPrefix, Message, never>,
|
||||
) => {};
|
||||
globalMiddlewares?: readonly (keyof RegisteredMiddlewares)[];
|
||||
|
@ -219,7 +219,10 @@ export async function onInteractionCreate(
|
||||
if (self.components?.hasModal(interaction)) {
|
||||
await self.components.onModalSubmit(interaction);
|
||||
} else {
|
||||
await self.components?.executeModal(new ModalContext(self, interaction));
|
||||
const context = new ModalContext(self, interaction);
|
||||
const extended = self.options?.context?.(interaction) ?? {};
|
||||
Object.assign(context, extended);
|
||||
await self.components?.executeModal(context);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user