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