extendContext
1extendContext<T>(cb: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ComponentInteraction<boolean, APIMessageComponentInteraction>) => T): (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ComponentInteraction<boolean, APIMessageComponentInteraction>) => T
Extends the context of a command interaction.
Type parameters
Type parameter |
---|
T extends Object |
Parameters
Parameter | Type | Description |
---|---|---|
cb | (interaction : ChatInputCommandInteraction <boolean > | UserCommandInteraction <boolean > | MessageCommandInteraction <boolean > | ComponentInteraction <boolean , APIMessageComponentInteraction >) => T | The callback function to extend the context. |
Returns
Function
The extended context.
Parameters
Parameter Type interaction
ChatInputCommandInteraction
<boolean
> |UserCommandInteraction
<boolean
> |MessageCommandInteraction
<boolean
> |ComponentInteraction
<boolean
,APIMessageComponentInteraction
>Returns
T
Example
1const customContext = extendContext((interaction) => {2 return {3 owner: '123456789012345678',4 // Add your custom properties here5 };6});