seyfert
    Preparing search index...

    Interface GuildComponentContext<Type, M>

    interface GuildComponentContext<
        Type extends keyof ContextComponentCommandInteractionMap,
        M extends keyof RegisteredMiddlewares = never,
    > {
        author: User;
        channelId: string;
        client: UsingClient;
        command: ComponentCommand;
        customId: string;
        globalMetadata: GlobalMetadata;
        guildId: string;
        interaction: ContextComponentCommandInteractionMap[Type];
        member: InteractionGuildMember;
        metadata: CommandMetadata<UnionToTuple<M, []>>;
        proxy: APIRoutes;
        t: __InternalParseLocale<DefaultLocale> & {
            get(locale?: string): DefaultLocale;
        };
        channel(mode?: "rest" | "flow"): Promise<AllChannels>;
        channel(mode: "cache"): ReturnCache<AllChannels>;
        deferReply<FR extends boolean = false>(
            ephemeral?: boolean,
            fetchReply?: FR,
        ): Promise<When<FR, WebhookMessage, undefined>>;
        deferUpdate(): Promise<undefined>;
        deleteResponse(): Promise<void>;
        editOrReply<FR extends boolean = false>(
            body:
                | Omit<
                    APIInteractionResponseCallbackData,
                    "components"
                    | "content"
                    | "embeds"
                    | "poll",
                > & SendResolverProps
                | InteractionMessageUpdateBodyRequest,
            fetchReply?: FR,
        ): Promise<When<FR, WebhookMessage, void>>;
        editResponse(
            body: InteractionMessageUpdateBodyRequest,
        ): Promise<WebhookMessage>;
        fetchResponse(): Promise<WebhookMessage>;
        followup(
            body: Omit<
                RESTPostAPIWebhookWithTokenJSONBody,
                "components"
                | "content"
                | "embeds"
                | "poll",
            > & SendResolverProps,
        ): Promise<WebhookMessage>;
        guild(mode?: "rest" | "flow"): Promise<Guild<"cached" | "api">>;
        guild(mode: "cache"): ReturnCache<undefined | Guild<"cached">>;
        inGuild(): this is GuildComponentContext<Type, M>;
        isButton(): this is ComponentContext<"Button", M>;
        isChannelSelectMenu(): this is ComponentContext<"ChannelSelect", M>;
        isChat(): this is CommandContext<{}, never>;
        isComponent(): this is ComponentContext<
            keyof ContextComponentCommandInteractionMap,
            never,
        >;
        isEntryPoint(): this is EntryPointContext<never>;
        isMentionableSelectMenu(): this is ComponentContext<"MentionableSelect", M>;
        isMenu(): this is MenuCommandContext<
            UserCommandInteraction<boolean>
            | MessageCommandInteraction<boolean>,
            never,
        >;
        isMenuMessage(): this is MenuCommandContext<
            MessageCommandInteraction<boolean>,
            never,
        >;
        isMenuUser(): this is MenuCommandContext<
            UserCommandInteraction<boolean>,
            never,
        >;
        isModal(): this is ModalContext<never>;
        isRoleSelectMenu(): this is ComponentContext<"RoleSelect", M>;
        isStringSelectMenu(): this is ComponentContext<"StringSelect", M>;
        isUserSelectMenu(): this is ComponentContext<"UserSelect", M>;
        me(mode?: "rest" | "flow"): Promise<GuildMember>;
        me(mode: "cache"): ReturnCache<undefined | GuildMember>;
        modal(
            body: ModalCreateBodyRequest,
            options?: undefined,
        ): Promise<undefined>;
        modal(
            body: ModalCreateBodyRequest,
            options: ModalCreateOptions,
        ): Promise<null | ModalSubmitInteraction<boolean>>;
        update(
            body: Omit<
                APIInteractionResponseCallbackData,
                "components"
                | "content"
                | "embeds",
            > & ResolverProps,
        ): Promise<undefined>;
        write<FR extends boolean = false>(
            body: Omit<
                APIInteractionResponseCallbackData,
                "components"
                | "content"
                | "embeds"
                | "poll",
            > & SendResolverProps,
            fetchReply?: FR,
        ): Promise<When<FR, WebhookMessage, void>>;
    }

    Type Parameters

    Hierarchy

    • Omit<
          MakeRequired<ComponentContext<Type, M>, "guildId" | "member">,
          "guild" | "me",
      >
      • GuildComponentContext
    Index

    Properties

    author: User
    channelId: string
    client: UsingClient

    The UsingClient instance.

    customId: string
    globalMetadata: GlobalMetadata = {}
    guildId: string

    The component interaction object.

    metadata: CommandMetadata<UnionToTuple<M, []>> = ...
    proxy: APIRoutes
    t: __InternalParseLocale<DefaultLocale> & {
        get(locale?: string): DefaultLocale;
    }

    Methods

    • Defers the reply to the interaction.

      Type Parameters

      • FR extends boolean = false

      Parameters

      • ephemeral: boolean = false

        Whether the reply should be ephemeral or not.

      • OptionalfetchReply: FR

      Returns Promise<When<FR, WebhookMessage, undefined>>

    • ACK an interaction and edit the original message later; the user does not see a loading state

      Returns Promise<undefined>

    • Deletes the response of the interaction.

      Returns Promise<void>

      A promise that resolves when the response is deleted.

    • Edits the response or replies to the interaction.

      Type Parameters

      • FR extends boolean = false

      Parameters

      • body:
            | Omit<
                APIInteractionResponseCallbackData,
                "components"
                | "content"
                | "embeds"
                | "poll",
            > & SendResolverProps
            | InteractionMessageUpdateBodyRequest

        The body of the response or updated body of the interaction.

      • OptionalfetchReply: FR

        Whether to fetch the reply or not.

      Returns Promise<When<FR, WebhookMessage, void>>

    • Parameters

      • body: Omit<
            RESTPostAPIWebhookWithTokenJSONBody,
            "components"
            | "content"
            | "embeds"
            | "poll",
        > & SendResolverProps

      Returns Promise<WebhookMessage>

    • Updates the interaction with new data.

      Parameters

      • body: Omit<APIInteractionResponseCallbackData, "components" | "content" | "embeds"> & ResolverProps

        The updated body of the interaction.

      Returns Promise<undefined>

    • Writes a response to the interaction.

      Type Parameters

      • FR extends boolean = false

      Parameters

      • body: Omit<
            APIInteractionResponseCallbackData,
            "components"
            | "content"
            | "embeds"
            | "poll",
        > & SendResolverProps

        The body of the response.

      • OptionalfetchReply: FR

        Whether to fetch the reply or not.

      Returns Promise<When<FR, WebhookMessage, void>>