UNPKG

@sern/handler

Version:

A complete, customizable, typesafe, & reactive framework for discord bots.

41 lines (40 loc) 1.69 kB
import type { BaseInteraction, ChatInputCommandInteraction, Client, Message, Snowflake, User } from 'discord.js'; import { Result } from './result'; import type { ReplyOptions } from '../../types/utility'; /** * @since 1.0.0 * Provides values shared between * Message and ChatInputCommandInteraction */ export declare class Context { protected ctx: Result<Message, ChatInputCommandInteraction>; private __prefix?; get options(): string[] | Omit<import("discord.js").CommandInteractionOptionResolver<import("discord.js").CacheType>, "getMessage" | "getFocused">; protected constructor(ctx: Result<Message, ChatInputCommandInteraction>, __prefix?: string | undefined); get prefix(): string | undefined; get id(): Snowflake; get channel(): import("discord.js").TextBasedChannel | null; get channelId(): Snowflake; /** * If context is holding a message, message.author * else, interaction.user */ get user(): User; get userId(): Snowflake; get createdTimestamp(): number; get guild(): import("discord.js").Guild | null; get guildId(): string | null; get member(): import("discord.js").GuildMember | import("discord.js").APIInteractionGuildMember | null; get message(): Message; isMessage(): this is Context & { ctx: Result<Message, never>; }; isSlash(): this is Context & { ctx: Result<never, ChatInputCommandInteraction>; }; get interaction(): ChatInputCommandInteraction; get client(): Client; get inGuild(): boolean; reply(content: ReplyOptions): Promise<Message<boolean>>; static wrap(wrappable: BaseInteraction | Message, prefix?: string): Context; }