Skip to main content

Class: Context

Provides values shared between Message and ChatInputCommandInteraction

Constructors

constructor

Private new Context(oMsg?, oInterac?)

Parameters

NameTypeDefault value
oMsgOption<Message<boolean>>None
oInteracOption<ChatInputCommandInteraction<CacheType>>None

Defined in

src/handler/structures/context.ts:31

Accessors

channel

get channel(): Nullish<TextBasedChannel>

Returns

Nullish<TextBasedChannel>

Defined in

src/handler/structures/context.ts:63


client

get client(): Client<boolean>

Returns

Client<boolean>

Defined in

src/handler/structures/context.ts:108


createdTimestamp

get createdTimestamp(): number

Returns

number

Defined in

src/handler/structures/context.ts:77


guild

get guild(): Guild

Returns

Guild

Defined in

src/handler/structures/context.ts:84


guildId

get guildId(): string

Returns

string

Defined in

src/handler/structures/context.ts:91


id

get id(): string

Returns

string

Defined in

src/handler/structures/context.ts:56


inGuild

get inGuild(): boolean

Returns

boolean

Defined in

src/handler/structures/context.ts:115


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:52


member

get member(): Nullish<GuildMember | APIGuildMember>

Returns

Nullish<GuildMember | APIGuildMember>

Defined in

src/handler/structures/context.ts:101


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:44


user

get user(): User

Returns

User

Defined in

src/handler/structures/context.ts:70

Methods

isEmpty

isEmpty(): boolean

Returns

boolean

Defined in

src/handler/structures/context.ts:129


reply

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

Parameters

NameType
contentstring | Omit<InteractionReplyOptions, "fetchReply"> | ReplyMessageOptions

Returns

Promise<Message<boolean>>

Defined in

src/handler/structures/context.ts:133


wrap

Static wrap(wrappable): Context

Parameters

NameType
wrappableMessage<boolean> | ChatInputCommandInteraction<CacheType>

Returns

Context

Defined in

src/handler/structures/context.ts:122