Files
archived-sern-website/docs/api/classes/Context.md
Jacob Nguyen 49a910f90a fix docs build
2023-06-30 21:56:51 -05:00

5.7 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

Protected new Context(ctx)

Parameters

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

Overrides

CoreContext<Message, ChatInputCommandInteraction&gt;.constructor

Defined in

src/core/structures/context.ts:28

Properties

ctx

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

Inherited from

CoreContext.ctx

Defined in

src/core/structures/context.ts:28

Accessors

channel

get channel(): null | TextBasedChannel

Returns

null | TextBasedChannel

Defined in

src/core/structures/context.ts:36


client

get client(): Client<boolean>

Returns

Client<boolean>

Defined in

src/core/structures/context.ts:65


createdTimestamp

get createdTimestamp(): number

Returns

number

Defined in

src/core/structures/context.ts:47


guild

get guild(): null | Guild

Returns

null | Guild

Defined in

src/core/structures/context.ts:51


guildId

get guildId(): null | string

Returns

null | string

Defined in

src/core/structures/context.ts:55


id

get id(): string

Returns

string

Defined in

src/core/structures/context.ts:32


inGuild

get inGuild(): boolean

Returns

boolean

Defined in

src/core/structures/context.ts:69


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


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


user

get user(): User

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

Returns

User

Defined in

src/core/structures/context.ts:43

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


wrap

Static wrap(wrappable): Context

Parameters

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

Returns

Context

Overrides

CoreContext.wrap

Defined in

src/core/structures/context.ts:83