awaitMultiSelection<T> method
- ComponentId componentId,
- {Converter<
T> ? converterOverride}
inherited
Wait for a user to select options from a multi-select menu and return a context representing that selection.
Implementation
@override
Future<SelectMenuContext<List<T>>> awaitMultiSelection<T>(
ComponentId componentId, {
Converter<T>? converterOverride,
}) async {
if (delegate != null) {
return delegate!.awaitMultiSelection(
componentId,
converterOverride: converterOverride,
);
}
SelectMenuContext<List<String>> rawContext =
await commands.eventManager.nextSelectMenuEvent(componentId);
SelectMenuContext<List<T>> context = await commands.contextManager.createSelectMenuContext(
rawContext.interaction,
await Future.wait(rawContext.selected.map(
(value) => parse(
commands,
rawContext,
StringView(value, isRestBlock: true),
RuntimeType<T>(),
),
)),
);
context._parent = this;
_delegate = context;
return context;
}