CommandContext
Extends
BaseContext
.ExtendContext
Type parameters
Type parameter | Value |
---|---|
T extends OptionsRecord | Object |
M extends keyof RegisteredMiddlewares | never |
Constructors
new CommandContext(client, data, resolver, shardId, command)
1new CommandContext<T, M>(2 client: UsingClient,3 data: Message | ChatInputCommandInteraction<boolean>,4 resolver: OptionResolver,5 shardId: number,6command: Command | SubCommand): CommandContext<T, M>
Parameters
Parameter | Type |
---|---|
client | UsingClient |
data | Message | ChatInputCommandInteraction <boolean > |
resolver | OptionResolver |
shardId | number |
command | Command | SubCommand |
Returns
CommandContext
<T
, M
>
Inherited from
BaseContext.constructor
Source
seyfert/src/commands/applications/chatcontext.ts:30
Properties
Property | Modifier | Type | Inherited from |
---|---|---|---|
client | readonly | UsingClient | BaseContext.client |
command | readonly | Command | SubCommand | - |
globalMetadata | public | GlobalMetadata | - |
interaction | public | ChatInputCommandInteraction <boolean > | - |
message | public | undefined | - |
messageResponse? | public | null | Message | - |
metadata | public | CommandMetadata <UnionToTuple <M , []>> | - |
options | public | ContextOptions <T > | - |
resolver | readonly | OptionResolver | - |
shardId | readonly | number | - |
Accessors
author
1get author(): User
Returns
Source
seyfert/src/commands/applications/chatcontext.ts:169
channelId
1get channelId(): string
Returns
string
Source
seyfert/src/commands/applications/chatcontext.ts:165
fullCommandName
1get fullCommandName(): string
Returns
string
Source
seyfert/src/commands/applications/chatcontext.ts:57
guildId
1get guildId(): undefined | string
Returns
undefined
| string
Source
seyfert/src/commands/applications/chatcontext.ts:161
member
1get member(): undefined | InteractionGuildMember
Returns
undefined
| InteractionGuildMember
Source
seyfert/src/commands/applications/chatcontext.ts:173
proxy
1get proxy(): APIRoutes
Returns
Source
seyfert/src/commands/applications/chatcontext.ts:49
t
1get t(): __InternalParseLocale<DefaultLocale> & Object
Returns
__InternalParseLocale
<DefaultLocale
> & Object
Source
seyfert/src/commands/applications/chatcontext.ts:53
Methods
channel()
channel(mode)
1channel(mode?: "rest" | "flow"): Promise<AllChannels>
Parameters
Parameter | Type |
---|---|
mode ? | "rest" | "flow" |
Returns
Promise
<AllChannels
>
Source
seyfert/src/commands/applications/chatcontext.ts:109
channel(mode)
1channel(mode?: "cache"): ReturnCache<AllChannels>
Parameters
Parameter | Type |
---|---|
mode ? | "cache" |
Returns
Source
seyfert/src/commands/applications/chatcontext.ts:110
deferReply()
1deferReply(ephemeral: boolean): Promise<void | Message>
Parameters
Parameter | Type | Default value |
---|---|---|
ephemeral | boolean | false |
Returns
Promise
<void
| Message
>
Source
seyfert/src/commands/applications/chatcontext.ts:72
deleteResponse()
1deleteResponse(): Promise<void>
Returns
Promise
<void
>
Source
seyfert/src/commands/applications/chatcontext.ts:85
editOrReply()
1editOrReply<FR>(body: Omit<RESTPatchAPIWebhookWithTokenMessageJSONBody, "components" | "embeds"> & ResolverProps | Omit<APIInteractionResponseCallbackData, "components" | "embeds" | "poll"> & SendResolverProps, fetchReply?: FR): Promise<When<FR, Message | WebhookMessage, void | Message | WebhookMessage>>
Type parameters
Type parameter | Value |
---|---|
FR extends boolean | false |
Parameters
Parameter | Type |
---|---|
body | Omit <RESTPatchAPIWebhookWithTokenMessageJSONBody , "components" | "embeds" > & ResolverProps | Omit <APIInteractionResponseCallbackData , "components" | "embeds" | "poll" > & SendResolverProps |
fetchReply ? | FR |
Returns
Promise
<When
<FR
, Message
| WebhookMessage
, void
| Message
| WebhookMessage
>>
Source
seyfert/src/commands/applications/chatcontext.ts:90
editResponse()
1editResponse(body: Omit<RESTPatchAPIWebhookWithTokenMessageJSONBody, "components" | "embeds"> & ResolverProps): Promise<Message | WebhookMessage>
Parameters
Parameter | Type |
---|---|
body | Omit <RESTPatchAPIWebhookWithTokenMessageJSONBody , "components" | "embeds" > & ResolverProps |
Returns
Promise
<Message
| WebhookMessage
>
Source
seyfert/src/commands/applications/chatcontext.ts:80
fetchResponse()
1fetchResponse(): Promise<undefined | WebhookMessage>
Returns
Promise
<undefined
| WebhookMessage
>
Source
seyfert/src/commands/applications/chatcontext.ts:101
guild()
guild(mode)
1guild(mode?: "rest" | "flow"): Promise<undefined | Guild<"cached" | "api">>
Parameters
Parameter | Type |
---|---|
mode ? | "rest" | "flow" |
Returns
Promise
<undefined
| Guild
<"cached"
| "api"
>>
Source
seyfert/src/commands/applications/chatcontext.ts:141
guild(mode)
1guild(mode?: "cache"): ReturnCache<undefined | Guild<"cached">>
Parameters
Parameter | Type |
---|---|
mode ? | "cache" |
Returns
ReturnCache
<undefined
| Guild
<"cached"
>>
Source
seyfert/src/commands/applications/chatcontext.ts:142
isChat()
1isChat(): this is CommandContext<Object, never>
Returns
this is CommandContext<Object, never>
Inherited from
BaseContext.isChat
Source
seyfert/src/commands/applications/chatcontext.ts:181
isComponent()
1isComponent(): this is ComponentContext<keyof ComponentCommandInteractionMap>
Returns
this is ComponentContext<keyof ComponentCommandInteractionMap>
Inherited from
BaseContext.isComponent
Source
seyfert/src/commands/basecontex.ts:30
isMenu()
1isMenu(): this is MenuCommandContext<UserCommandInteraction<boolean> | MessageCommandInteraction<boolean>, never>
Returns
this is MenuCommandContext<UserCommandInteraction<boolean> | MessageCommandInteraction<boolean>, never>
Inherited from
BaseContext.isMenu
Source
seyfert/src/commands/basecontex.ts:18
isMenuMessage()
1isMenuMessage(): this is MenuCommandContext<MessageCommandInteraction<boolean>, never>
Returns
this is MenuCommandContext<MessageCommandInteraction<boolean>, never>
Inherited from
BaseContext.isMenuMessage
Source
seyfert/src/commands/basecontex.ts:26
isMenuUser()
1isMenuUser(): this is MenuCommandContext<UserCommandInteraction<boolean>, never>
Returns
this is MenuCommandContext<UserCommandInteraction<boolean>, never>
Inherited from
BaseContext.isMenuUser
Source
seyfert/src/commands/basecontex.ts:22
me()
me(mode)
1me(mode?: "rest" | "flow"): Promise<GuildMember>
Parameters
Parameter | Type |
---|---|
mode ? | "rest" | "flow" |
Returns
Promise
<GuildMember
>
Source
seyfert/src/commands/applications/chatcontext.ts:125
me(mode)
1me(mode?: "cache"): ReturnCache<undefined | GuildMember>
Parameters
Parameter | Type |
---|---|
mode ? | "cache" |
Returns
ReturnCache
<undefined
| GuildMember
>
Source
seyfert/src/commands/applications/chatcontext.ts:126
write()
1write<FR>(body: Omit<APIInteractionResponseCallbackData, "components" | "embeds" | "poll"> & SendResolverProps, fetchReply?: FR): Promise<When<FR, Message | WebhookMessage, void | Message | WebhookMessage>>
Type parameters
Type parameter | Value |
---|---|
FR extends boolean | false |
Parameters
Parameter | Type |
---|---|
body | Omit <APIInteractionResponseCallbackData , "components" | "embeds" | "poll" > & SendResolverProps |
fetchReply ? | FR |
Returns
Promise
<When
<FR
, Message
| WebhookMessage
, void
| Message
| WebhookMessage
>>