diff --git a/src/client/base.ts b/src/client/base.ts index c733a27..71147dc 100644 --- a/src/client/base.ts +++ b/src/client/base.ts @@ -35,6 +35,7 @@ import type { ComponentInteraction, Message, MessageCommandInteraction, + ModalSubmitInteraction, UserCommandInteraction, } from '../structures'; @@ -333,6 +334,7 @@ export interface BaseClientOptions { | UserCommandInteraction | MessageCommandInteraction | ComponentInteraction + | ModalSubmitInteraction | When, ) => {}; globalMiddlewares?: readonly (keyof RegisteredMiddlewares)[]; diff --git a/src/client/oninteractioncreate.ts b/src/client/oninteractioncreate.ts index e30ee24..8448f92 100644 --- a/src/client/oninteractioncreate.ts +++ b/src/client/oninteractioncreate.ts @@ -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;