UNPKG

seyfert

Version:

The most advanced framework for discord bots

47 lines (46 loc) 3.2 kB
import type { ReturnCache } from '../..'; import type { GuildMemberStructure, GuildStructure, InteractionGuildMemberStructure, UserStructure, WebhookMessageStructure } from '../../client/transformers'; import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, ModalCreateBodyRequest, UnionToTuple, When } from '../../common'; import type { AllChannels, EntryPointInteraction } from '../../structures'; import { BaseContext } from '../basecontext'; import type { RegisteredMiddlewares } from '../decorators'; import type { EntryPointCommand } from './entryPoint'; import type { CommandMetadata, ExtendContext, GlobalMetadata, UsingClient } from './shared'; export interface EntryPointContext<M extends keyof RegisteredMiddlewares = never> extends BaseContext, ExtendContext { } export declare class EntryPointContext<M extends keyof RegisteredMiddlewares = never> extends BaseContext { readonly client: UsingClient; readonly interaction: EntryPointInteraction; readonly shardId: number; readonly command: EntryPointCommand; constructor(client: UsingClient, interaction: EntryPointInteraction, shardId: number, command: EntryPointCommand); metadata: CommandMetadata<UnionToTuple<M>>; globalMetadata: GlobalMetadata; get t(): import("../..").__InternalParseLocale<import("./shared").DefaultLocale> & { get(locale?: string): import("./shared").DefaultLocale; }; get fullCommandName(): string; write<WR extends boolean = false>(body: InteractionCreateBodyRequest, withResponse?: WR): Promise<When<WR, WebhookMessageStructure, void>>; modal(body: ModalCreateBodyRequest): Promise<undefined>; deferReply<WR extends boolean = false>(ephemeral?: boolean, withResponse?: WR): Promise<When<WR, WebhookMessageStructure, undefined>>; editResponse(body: InteractionMessageUpdateBodyRequest): Promise<WebhookMessageStructure>; deleteResponse(): Promise<void>; editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<When<WR, WebhookMessageStructure, void>>; fetchResponse(): Promise<WebhookMessageStructure>; channel(mode?: 'rest' | 'flow'): Promise<AllChannels>; channel(mode: 'cache'): ReturnCache<AllChannels>; me(mode?: 'rest' | 'flow'): Promise<GuildMemberStructure>; me(mode: 'cache'): ReturnCache<GuildMemberStructure | undefined>; guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'> | undefined>; guild(mode: 'cache'): ReturnCache<GuildStructure<'cached'> | undefined>; get guildId(): string | undefined; get channelId(): string; get author(): UserStructure; get member(): InteractionGuildMemberStructure | undefined; isEntryPoint(): this is EntryPointContext<M>; inGuild(): this is GuildEntryPointContext<M>; } export interface GuildEntryPointContext<M extends keyof RegisteredMiddlewares = never> extends Omit<MakeRequired<EntryPointContext<M>, 'guildId' | 'member'>, 'guild'> { guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'>>; guild(mode: 'cache'): ReturnCache<GuildStructure<'cached'> | undefined>; }