Files
website/docs/api/classes/Context.md
2023-01-26 15:47:53 -06:00

4.8 KiB

id, title, sidebar_label, sidebar_position, custom_edit_url
id title sidebar_label sidebar_position custom_edit_url
Context Class: Context Context 0 null

Provides values shared between Message and ChatInputCommandInteraction

Constructors

constructor

Private new Context(ctx)

Parameters

Name Type
ctx Result<Message<boolean>, ChatInputCommandInteraction<CacheType>>

Defined in

src/handler/structures/context.ts:22

Accessors

channel

get channel(): null | TextBasedChannel

Returns

null | TextBasedChannel

Defined in

src/handler/structures/context.ts:45


client

get client(): Client<boolean>

Returns

Client<boolean>

Defined in

src/handler/structures/context.ts:75


createdTimestamp

get createdTimestamp(): number

Returns

number

Defined in

src/handler/structures/context.ts:56


guild

get guild(): null | Guild

Returns

null | Guild

Defined in

src/handler/structures/context.ts:60


guildId

get guildId(): null | string

Returns

null | string

Defined in

src/handler/structures/context.ts:64


id

get id(): string

Returns

string

Defined in

src/handler/structures/context.ts:41


inGuild

get inGuild(): boolean

Returns

boolean

Defined in

src/handler/structures/context.ts:79


interaction

get interaction(): ChatInputCommandInteraction<CacheType>

Getting the ChatInputCommandInteraction object. Crashes if module type is CommandType.Text or the event fired in a Both command was Message

Returns

ChatInputCommandInteraction<CacheType>

Defined in

src/handler/structures/context.ts:37


member

get member(): null | GuildMember | APIInteractionGuildMember

Returns

null | GuildMember | APIInteractionGuildMember

Defined in

src/handler/structures/context.ts:71


message

get message(): Message<boolean>

Getting the Message object. Crashes if module type is CommandType.Slash or the event fired in a Both command was ChatInputCommandInteraction

Returns

Message<boolean>

Defined in

src/handler/structures/context.ts:29


user

get user(): User

If context is holding a message, message.author else, interaction.user

Returns

User

Defined in

src/handler/structures/context.ts:52

Methods

isMessage

isMessage(): boolean

Returns

boolean

Defined in

src/handler/structures/context.ts:82


isSlash

isSlash(): boolean

Returns

boolean

Defined in

src/handler/structures/context.ts:86


reply

reply(content): Promise<Message<boolean>>

Parameters

Name Type
content ReplyOptions

Returns

Promise<Message<boolean>>

Defined in

src/handler/structures/context.ts:97


wrap

Static wrap(wrappable): Context

Parameters

Name Type
wrappable Message<boolean> | ChatInputCommandInteraction<CacheType>

Returns

Context

Defined in

src/handler/structures/context.ts:90