Files
website/docs/api/classes/Context.md
2024-03-09 14:30:19 +00:00

6.1 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

Since

1.0.0 Provides values shared between Message and ChatInputCommandInteraction

Hierarchy

  • CoreContext<Message, ChatInputCommandInteraction>

    Context

Constructors

constructor

new Context(ctx): Context

Parameters

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

Returns

Context

Overrides

CoreContext&lt;Message, ChatInputCommandInteraction&gt;.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

Name Type
content ReplyOptions

Returns

Promise<Message<boolean>>

Defined in

src/core/structures/context.ts:103


wrap

wrap(wrappable): Context

Parameters

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

Returns

Context

Overrides

CoreContext.wrap

Defined in

src/core/structures/context.ts:113