getButtonSelection<T> abstract method
- List<
T> values, - MessageBuilder builder,
- {Map<
T, ButtonStyle> ? styles, - bool authorOnly = true,
- ResponseLevel? level,
- Duration? timeout,
- FutureOr<
ButtonBuilder> toButton(- T
- Converter<
T> ? converterOverride}
Get a selection from a user, presenting the options as an array of buttons.
If styles
is set, the style of a button presenting a given option will depend on the value
set in the map.
If timeout
is set, this method will complete with an error after timeout
has passed.
If authorOnly
is set, only the author of this interaction will be able to interact with a
button.
level
will change the level at which the message is sent, similarly to respond.
toButton
and converterOverride
can be set to change how each value is converted to a
button. At most one of them may be set, and the default is to use Converter.toButton on the
default conversion for T
.
You might also be interested in:
- getButtonPress, for getting a button press from any button on a message;
- getSelection, for getting a selection from a multi-select menu;
- getConfirmation, for getting a basic
true
/false
selection from the user.
Implementation
Future<T> getButtonSelection<T>(
List<T> values,
MessageBuilder builder, {
Map<T, ButtonStyle>? styles,
bool authorOnly = true,
ResponseLevel? level,
Duration? timeout,
FutureOr<ButtonBuilder> Function(T)? toButton,
Converter<T>? converterOverride,
});