DiscordMessageComponentSelectMenu class
Select menus are another interactive component that renders on messages. On desktop, clicking on a select menu opens a dropdown-style UI; on mobile, tapping a select menu opens up a half-sheet with the options.
Select menus support single-select and multi-select behavior, meaning you can prompt a user to choose just one item from a list, or multiple. When a user finishes making their choice by clicking out of the dropdown or closing the half-sheet, your app will receive an interaction.
- Select menus must be sent inside an Action Row
- An Action Row can contain only one select menu
- An Action Row containing a select menu cannot also contain buttons
- Inheritance
-
- Object
- DiscordMessageComponent
- DiscordMessageComponentSelectMenu
Constructors
-
DiscordMessageComponentSelectMenu({required String customId, required List<
DiscordMessageComponentSelectMenuOption> options, String? placeholder, int? minValues, int? maxValues, bool? disabled}) -
DiscordMessageComponentSelectMenu.fromJson(Map<
String, dynamic> json) -
factory
Properties
- customId → String
-
a developer-defined identifier for the button, max 100 characters
final
- disabled → bool?
-
disable the select, default false
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxValues → int?
-
the maximum number of options that can be chosen;
default 1, max 25
final
- minValues → int?
-
the minimum number of options that must be chosen;
default 1, min 0, max 25
final
-
options
→ List<
DiscordMessageComponentSelectMenuOption> -
the choices in the select, max 25
final
- placeholder → String?
-
custom placeholder text if nothing is selected, max 100 characters
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → int
-
The type of component
finalinherited
- typeAsEnum → DiscordMessageComponentType
-
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- customIdEntry → const String
- disabledEntry → const String
- maxValuesEntry → const String
- minValuesEntry → const String
- optionsEntry → const String
- placeholderEntry → const String