ComponentContext
Signature
export interface ComponentContext<Type extends keyof ContextComponentCommandInteractionMap = keyof ContextComponentCommandInteractionMap, M extends keyof ResolvedRegisteredMiddlewares = never, StringSelectValues extends string[] = string[]> extends BaseContext, ExtendContextProperties
13Methods
26Properties
readonly client: UsingClient;interaction: ContextComponentCommandInteractionMap<StringSelectValues>[Type];command: ComponentCommand;metadata: CommandMetadata<M>;globalMetadata: GlobalMetadata;tGetterget t(): SeyfertLocale;Gets the language object for the interaction's locale.
customIdGetterget customId(): string;Gets the custom ID of the interaction.
messageGetterget message(): MessageStructure;guildIdGetterget guildId(): string | undefined;Gets the ID of the guild of the interaction.
channelIdGetterget channelId(): string;Gets the ID of the channel of the interaction.
authorGetterget author(): UserStructure;Gets the author of the interaction.
memberGetterget member(): InteractionGuildMemberStructure | undefined;Gets the member of the interaction.
proxyGetterget proxy(): APIRoutes;Gets the proxy object.
Methods
write<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<When<FR, WebhookMessageStructure, void>>;Writes a response to the interaction.
body- The body of the response.
fetchReply- Whether to fetch the reply or not.
deferReply<FR extends boolean = false>(ephemeral?: boolean, fetchReply?: FR): Promise<When<FR, WebhookMessageStructure, undefined>>;Defers the reply to the interaction.
ephemeral- Whether the reply should be ephemeral or not.
deferUpdate(): Promise<undefined>;ACK an interaction and edit the original message later; the user does not see a loading state
update(body: ComponentInteractionMessageUpdate): Promise<undefined>;editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, fetchReply?: FR): Promise<When<FR, WebhookMessageStructure, void>>;Edits the response or replies to the interaction.
body- The body of the response or updated body of the interaction.
fetchReply- Whether to fetch the reply or not.
followup(body: MessageWebhookCreateBodyRequest): Promise<WebhookMessageStructure>;fetchResponse(): Promise<WebhookMessageStructure>;A Promise that resolves to the fetched message
deleteResponse(): Promise<void>;Deletes the response of the interaction.
A promise that resolves when the response is deleted.
modal(body: ModalCreateBodyRequest, options?: undefined): Promise<undefined>;modal(body: ModalCreateBodyRequest, options: ModalCreateOptions): Promise<ModalSubmitInteraction | null>;channel(mode?: 'rest' | 'flow'): Promise<AllChannels>;channel(mode: 'cache'): ReturnCache<AllChannels>;Gets the channel of the interaction.
mode- The mode to fetch the channel.
A promise that resolves to the channel.
me(mode?: 'rest' | 'flow'): Promise<GuildMemberStructure | undefined>;me(mode: 'cache'): ReturnCache<GuildMemberStructure | undefined>;Gets the bot member in the guild of the interaction.
mode- The mode to fetch the member.
A promise that resolves to the bot member.
guild(mode?: 'rest' | 'flow', query?: RESTGetAPIGuildQuery): Promise<GuildStructure<'cached' | 'api'> | undefined>;guild(mode: 'cache', query?: RESTGetAPIGuildQuery): ReturnCache<GuildStructure<'cached'> | undefined>;Gets the guild of the interaction.
mode- The mode to fetch the guild.
query- Optional query used in fetch mode.
A promise that resolves to the guild.
isComponent(): this is ComponentContext<keyof ContextComponentCommandInteractionMap, M, StringSelectValues>;isButton(): this is ComponentContext<'Button', M, StringSelectValues>;isChannelSelectMenu(): this is ComponentContext<'ChannelSelect', M, StringSelectValues>;isRoleSelectMenu(): this is ComponentContext<'RoleSelect', M, StringSelectValues>;isMentionableSelectMenu(): this is ComponentContext<'MentionableSelect', M, StringSelectValues>;isUserSelectMenu(): this is ComponentContext<'UserSelect', M, StringSelectValues>;isStringSelectMenu(): this is ComponentContext<'StringSelect', M, StringSelectValues>;inGuild(): this is GuildComponentContext<Type, M, StringSelectValues>;isChat(): this is CommandContext;isMenu(): this is MenuCommandContext<UserCommandInteraction | MessageCommandInteraction>;isMenuUser(): this is MenuCommandContext<UserCommandInteraction>;isMenuMessage(): this is MenuCommandContext<MessageCommandInteraction>;isModal(): this is ModalContext;isEntryPoint(): this is EntryPointContext;