Skip to main content

Class: Context

Since

1.0.0 Provides values shared between Message and ChatInputCommandInteraction

Hierarchy

  • CoreContext<Message, ChatInputCommandInteraction>

    Context

Constructors

constructor

new Context(ctx): Context

Parameters

NameType
ctxResult<Message<boolean>, ChatInputCommandInteraction<CacheType>>

Returns

Context

Overrides

CoreContext\<Message, ChatInputCommandInteraction\>.constructor

Defined in

src/core/structures/context.ts:29

Properties

ctx

Protected ctx: Result<Message<boolean>, ChatInputCommandInteraction<CacheType>>

Inherited from

CoreContext.ctx

Defined in

src/core/structures/context.ts:29

Accessors

channel

get channel(): null | TextBasedChannel

Returns

null | TextBasedChannel

Defined in

src/core/structures/context.ts:39


channelId

get channelId(): string

Returns

string

Defined in

src/core/structures/context.ts:45


client

get client(): Client<boolean>

Returns

Client<boolean>

Defined in

src/core/structures/context.ts:91


createdTimestamp

get createdTimestamp(): number

Returns

number

Defined in

src/core/structures/context.ts:65


guild

get guild(): null | Guild

Returns

null | Guild

Defined in

src/core/structures/context.ts:71


guildId

get guildId(): null | string

Returns

null | string

Defined in

src/core/structures/context.ts:77


id

get id(): string

Returns

string

Defined in

src/core/structures/context.ts:33


inGuild

get inGuild(): boolean

Returns

boolean

Defined in

src/core/structures/context.ts:97


interaction

get interaction(): I

Returns

I

Inherited from

CoreContext.interaction

Defined in

src/core/structures/core-context.ts:15


member

get member(): null | GuildMember | APIInteractionGuildMember

Returns

null | GuildMember | APIInteractionGuildMember

Defined in

src/core/structures/context.ts:85


message

get message(): M

Returns

M

Inherited from

CoreContext.message

Defined in

src/core/structures/core-context.ts:12


options

get options(): Omit<CommandInteractionOptionResolver<CacheType>, "getMessage" | "getFocused">

Returns

Omit<CommandInteractionOptionResolver<CacheType>, "getMessage" | "getFocused">

Overrides

CoreContext.options

Defined in

src/core/structures/context.ts:26


user

get user(): User

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

Returns

User

Defined in

src/core/structures/context.ts:55


userId

get userId(): string

Returns

string

Defined in

src/core/structures/context.ts:61

Methods

isMessage

isMessage(): this is CoreContext<Message<boolean>, never>

Returns

this is CoreContext<Message<boolean>, never>

Inherited from

CoreContext.isMessage

Defined in

src/core/structures/core-context.ts:19


isSlash

isSlash(): this is CoreContext<never, ChatInputCommandInteraction<CacheType>>

Returns

this is CoreContext<never, ChatInputCommandInteraction<CacheType>>

Inherited from

CoreContext.isSlash

Defined in

src/core/structures/core-context.ts:23


reply

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

Parameters

NameType
contentReplyOptions

Returns

Promise<Message<boolean>>

Defined in

src/core/structures/context.ts:103


wrap

wrap(wrappable): Context

Parameters

NameType
wrappableMessage<boolean> | BaseInteraction<CacheType>

Returns

Context

Overrides

CoreContext.wrap

Defined in

src/core/structures/context.ts:113