@pikokr/command.ts / Exports / ApplicationCommandExtension
Class: ApplicationCommandExtension
Hierarchy
-
CTSExtension
↳
ApplicationCommandExtension
Table of contents
Constructors
Properties
Accessors
Methods
- chatInteraction
- commandInteraction
- convertArguments
- interactionCreate
- messageInteraction
- registerUnmanagedCommand
- sync
- userInteraction
Constructors
constructor
• new ApplicationCommandExtension(config
): ApplicationCommandExtension
Parameters
Name | Type |
---|---|
config | ApplicationCommandExtensionConfig |
Returns
Overrides
CTSExtension.constructor
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:37 (opens in a new tab)
Properties
_logger
• Protected
Optional
_logger: Logger
<unknown
>
Inherited from
CTSExtension._logger
Defined in
src/core/extensions/Extension.ts:17 (opens in a new tab)
config
• config: ApplicationCommandExtensionConfig
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:37 (opens in a new tab)
unmanagedCommands
• unmanagedCommands: { defaultMemberPermissions?
: null
| PermissionResolvable
; dmPermission?
: boolean
; guilds?
: string
[] ; name
: string
; nameLocalizations?
: Partial
<Record
<"id"
| "en-US"
| "en-GB"
| "bg"
| "zh-CN"
| "zh-TW"
| "hr"
| "cs"
| "da"
| "nl"
| "fi"
| "fr"
| "de"
| "el"
| "hi"
| "hu"
| "it"
| "ja"
| "ko"
| "lt"
| "no"
| "pl"
| "pt-BR"
| "ro"
| "ru"
| "es-ES"
| "sv-SE"
| "th"
| "tr"
| "uk"
| "vi"
, null
| string
>> ; nsfw?
: boolean
; type?
: ChatInput
| User
| Message
}[] = []
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:41 (opens in a new tab)
Accessors
client
• get
client(): Client
<boolean
>
Returns
Client
<boolean
>
Inherited from
CTSExtension.client
Defined in
src/core/extensions/Extension.ts:13 (opens in a new tab)
commandClient
• get
commandClient(): CommandClient
Returns
Inherited from
CTSExtension.commandClient
Defined in
src/core/extensions/Extension.ts:9 (opens in a new tab)
logger
• get
logger(): Logger
<unknown
>
Returns
Logger
<unknown
>
Inherited from
CTSExtension.logger
Defined in
src/core/extensions/CTSExtension.ts:5 (opens in a new tab)
Methods
chatInteraction
▸ chatInteraction(i
): Promise
<ChatInputCommandInteraction
<CacheType
>>
Parameters
Name | Type |
---|---|
i | ChatInputCommandInteraction <CacheType > |
Returns
Promise
<ChatInputCommandInteraction
<CacheType
>>
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:346 (opens in a new tab)
commandInteraction
▸ commandInteraction(i
): Promise
<UserContextMenuCommandInteraction
<CacheType
>>
Parameters
Name | Type |
---|---|
i | UserContextMenuCommandInteraction <CacheType > |
Returns
Promise
<UserContextMenuCommandInteraction
<CacheType
>>
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:373 (opens in a new tab)
convertArguments
▸ convertArguments(component
, argList
, args
, getConverterArgs
): Promise
<void
>
Parameters
Name | Type |
---|---|
component | unknown |
argList | unknown [] |
args | Collection <number , ComponentArgument > |
getConverterArgs | (arg : ComponentArgument , index : number , converter : ConverterComponent <unknown >) => unknown [] | Promise <unknown []> |
Returns
Promise
<void
>
Inherited from
CTSExtension.convertArguments
Defined in
src/core/extensions/Extension.ts:24 (opens in a new tab)
interactionCreate
▸ interactionCreate(i
): Promise
<void
>
Parameters
Name | Type |
---|---|
i | Interaction |
Returns
Promise
<void
>
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:49 (opens in a new tab)
messageInteraction
▸ messageInteraction(i
): Promise
<MessageContextMenuCommandInteraction
<CacheType
>>
Parameters
Name | Type |
---|---|
i | MessageContextMenuCommandInteraction <CacheType > |
Returns
Promise
<MessageContextMenuCommandInteraction
<CacheType
>>
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:355 (opens in a new tab)
registerUnmanagedCommand
▸ registerUnmanagedCommand(command
): void
Parameters
Name | Type |
---|---|
command | Object |
command.defaultMemberPermissions? | null | PermissionResolvable |
command.dmPermission? | boolean |
command.guilds? | string [] |
command.name | string |
command.nameLocalizations? | Partial <Record <"id" | "en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi" , null | string >> |
command.nsfw? | boolean |
command.type? | ChatInput | User | Message |
Returns
void
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:44 (opens in a new tab)
sync
▸ sync(): Promise
<void
>
Returns
Promise
<void
>
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:143 (opens in a new tab)
userInteraction
▸ userInteraction(i
): Promise
<UserContextMenuCommandInteraction
<CacheType
>>
Parameters
Name | Type |
---|---|
i | UserContextMenuCommandInteraction <CacheType > |
Returns
Promise
<UserContextMenuCommandInteraction
<CacheType
>>
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:364 (opens in a new tab)