AnySelectMenu
Extends
Extended by
Constructors
Constructor
new AnySelectMenu():
AnySelectMenu
Returns
AnySelectMenu
Inherited from
BaseMessageInteractiveComponent
.constructor
Properties
Property | Modifier | Type | Default value | Description | Overrides | Inherited from |
---|---|---|---|---|---|---|
customId | abstract | string | undefined | The custom ID of the component. If you want to provide a custom ID with additional data, you should either follow the default parser's format or implement your own custom parser. See customIdParser | - | BaseMessageInteractiveComponent .customId |
customIdParser | public | (id ) => ComponentParserResult | parseCustomId | This function is called by the handler when a component is received, and is used to parse the custom ID into a key and data object. By default, the ID is parsed in this format: key:arg1=true;arg2=2;arg3=cheese , where arg1 , arg2 , and arg3 are the data arguments. It will also automatically parse true and false as booleans, and will parse numbers as numbers. You can override this to parse the ID in a different format as you see fit, but it must follow these rules: - The ID must have a key somewhere in the ID that can be returned by the parser. This key is what Carbon's component handler will use to identify the component and pass an interaction to the correct component. - The data must be able to be arbitrary as far as Carbon's handler is concerned, meaning that any component with the same base key can be treated as the same component with logic within the component's logic methods to handle the data. | - | BaseMessageInteractiveComponent .customIdParser |
defer | public | boolean | false | Whether the component response should be automatically deferred | - | BaseMessageInteractiveComponent .defer |
disabled? | public | boolean | undefined | - | - | - |
ephemeral | public | boolean | false | Whether the component response should be ephemeral | - | BaseMessageInteractiveComponent .ephemeral |
id? | public | number | undefined | 32 bit integer used as an optional identifier for component The id field is optional and is used to identify components in the response from an interaction that aren't interactive components. The id must be unique within the message and is generated sequentially by Discord if left empty. Generation of ids won't use another id that exists in the message if you have one defined for another component. | - | BaseMessageInteractiveComponent .id |
isV2 | readonly | false | false | Whether the component is a v2 component and requires the IS_COMPONENTS_V2 flag | - | BaseMessageInteractiveComponent .isV2 |
maxValues? | public | number | undefined | - | - | - |
minValues? | public | number | undefined | - | - | - |
placeholder? | public | string | undefined | - | - | - |
type | abstract | AnySelectMenuComponentType | undefined | The type of the component | BaseMessageInteractiveComponent .type | - |
Methods
run()
run(
interaction
,data
):unknown
Parameters
Parameter | Type |
---|---|
interaction | AnySelectMenuInteraction |
data | ComponentData |
Returns
unknown
Overrides
BaseMessageInteractiveComponent
.run
serialize()
serialize():
APISelectMenuComponent
Returns
APISelectMenuComponent
Overrides
BaseMessageInteractiveComponent.serialize
serializeOptions()
abstract
serializeOptions(): {channel_types
:undefined
|ChannelType
[];default_values
:undefined
|APISelectMenuDefaultValue
<Channel
>[];type
:ChannelSelect
; } | {options
:APISelectMenuOption
[];type
:StringSelect
; } | {default_values
:undefined
|APISelectMenuDefaultValue
<Role
>[];type
:RoleSelect
; } | {default_values
:undefined
|APISelectMenuDefaultValue
<User
>[];type
:UserSelect
; } | {default_values
:undefined
|APISelectMenuDefaultValue
<Role
|User
>[];type
:MentionableSelect
; }
Returns
{ channel_types
: undefined
| ChannelType
[]; default_values
: undefined
| APISelectMenuDefaultValue
<Channel
>[]; type
: ChannelSelect
; } | { options
: APISelectMenuOption
[]; type
: StringSelect
; } | { default_values
: undefined
| APISelectMenuDefaultValue
<Role
>[]; type
: RoleSelect
; } | { default_values
: undefined
| APISelectMenuDefaultValue
<User
>[]; type
: UserSelect
; } | { default_values
: undefined
| APISelectMenuDefaultValue
<Role
| User
>[]; type
: MentionableSelect
; }