Skip to main content

Class: MessageContext<Cached, InGuild>

Defined in: packages/bakit/src/command/CommandContext.ts:108

Extends

Type Parameters

Cached

Cached extends boolean = boolean

InGuild

InGuild extends boolean = boolean

Constructors

Constructor

new MessageContext<Cached, InGuild>(source): MessageContext<Cached, InGuild>

Defined in: packages/bakit/src/command/CommandContext.ts:17

Parameters

source

Message<InGuild> | ChatInputCommandInteraction<Cached extends true ? "cached" : CacheType>

Returns

MessageContext<Cached, InGuild>

Inherited from

BaseCommandContext.constructor

Properties

canceled

canceled: boolean = false

Defined in: packages/bakit/src/base/lifecycle/Context.ts:2

Inherited from

BaseCommandContext.canceled


source

source: Message<InGuild>

Defined in: packages/bakit/src/command/CommandContext.ts:112

Overrides

BaseCommandContext.source

Accessors

channel

Get Signature

get channel(): CacheTypeReducer<Cached extends true ? "cached" : CacheType, null | GuildTextBasedChannel, null | GuildTextBasedChannel, null | GuildTextBasedChannel, null | TextBasedChannel> | If<InGuild, GuildTextBasedChannel, TextBasedChannel>

Defined in: packages/bakit/src/command/CommandContext.ts:27

Returns

CacheTypeReducer<Cached extends true ? "cached" : CacheType, null | GuildTextBasedChannel, null | GuildTextBasedChannel, null | GuildTextBasedChannel, null | TextBasedChannel> | If<InGuild, GuildTextBasedChannel, TextBasedChannel>

Inherited from

BaseCommandContext.channel


channelId

Get Signature

get channelId(): string

Defined in: packages/bakit/src/command/CommandContext.ts:31

Returns

string

Inherited from

BaseCommandContext.channelId


client

Get Signature

get client(): BakitClient<true>

Defined in: packages/bakit/src/command/CommandContext.ts:23

Returns

BakitClient<true>

Inherited from

BaseCommandContext.client


guild

Get Signature

get guild(): CacheTypeReducer<Cached extends true ? "cached" : CacheType, Guild, null, null | Guild, null | Guild> | If<InGuild, Guild, null>

Defined in: packages/bakit/src/command/CommandContext.ts:35

Returns

CacheTypeReducer<Cached extends true ? "cached" : CacheType, Guild, null, null | Guild, null | Guild> | If<InGuild, Guild, null>

Inherited from

BaseCommandContext.guild


guildId

Get Signature

get guildId(): CacheTypeReducer<Cached extends true ? "cached" : CacheType, string, string, string, null | string> | If<InGuild, string, null>

Defined in: packages/bakit/src/command/CommandContext.ts:39

Returns

CacheTypeReducer<Cached extends true ? "cached" : CacheType, string, string, string, null | string> | If<InGuild, string, null>

Inherited from

BaseCommandContext.guildId


member

Get Signature

get member(): null | GuildMember | CacheTypeReducer<Cached extends true ? "cached" : CacheType, GuildMember, APIInteractionGuildMember, GuildMember | APIInteractionGuildMember, null | GuildMember | APIInteractionGuildMember>

Defined in: packages/bakit/src/command/CommandContext.ts:43

Returns

null | GuildMember | CacheTypeReducer<Cached extends true ? "cached" : CacheType, GuildMember, APIInteractionGuildMember, GuildMember | APIInteractionGuildMember, null | GuildMember | APIInteractionGuildMember>

Inherited from

BaseCommandContext.member


user

Get Signature

get user(): User

Defined in: packages/bakit/src/command/CommandContext.ts:61

Returns

User

Inherited from

BaseCommandContext.user

Methods

cancel()

cancel(): void

Defined in: packages/bakit/src/base/lifecycle/Context.ts:4

Returns

void

Inherited from

BaseCommandContext.cancel


inCachedGuild()

inCachedGuild(): this is CommandContext<true, true>

Defined in: packages/bakit/src/command/CommandContext.ts:51

Returns

this is CommandContext<true, true>

Inherited from

BaseCommandContext.inCachedGuild


inGuild()

inGuild(): this is CommandContext<Cached, true>

Defined in: packages/bakit/src/command/CommandContext.ts:47

Returns

this is CommandContext<Cached, true>

Inherited from

BaseCommandContext.inGuild


isChatInput()

isChatInput(): this is ChatInputContext<boolean, boolean>

Defined in: packages/bakit/src/command/CommandContext.ts:71

Returns

this is ChatInputContext<boolean, boolean>

Inherited from

BaseCommandContext.isChatInput


isMessage()

isMessage(): this is MessageContext<boolean, boolean>

Defined in: packages/bakit/src/command/CommandContext.ts:75

Returns

this is MessageContext<boolean, boolean>

Inherited from

BaseCommandContext.isMessage


send()

send(options): Promise<Message<InGuild>>

Defined in: packages/bakit/src/command/CommandContext.ts:114

Parameters

options

string | MessageCreateOptions

Returns

Promise<Message<InGuild>>

Overrides

BaseCommandContext.send