ModalParameterResolver

Resolver for parameters annotated with @ModalInput.

Needs to be implemented alongside a ParameterResolver subclass.

Types supported by default

Note: For null to be supported, the parameter must be explicitly nullable.

TextInput

  • String (can be empty, supports null when empty)

StringSelectMenu

  • String when a single value can be selected (supports null when none selected)

  • List<String> (can be empty)

EntitySelectMenu

  • Mentions

  • T (supports null when none selected)

  • List<T> (can be empty)

Where T is one of: IMentionable, Role, User, InputUser, Member, GuildChannel

AttachmentUpload

RadioGroup

  • String (supports null when none selected)

CheckboxGroup

  • List<String> (can be empty)

  • String when a single value can be selected (supports null when none selected)

Checkbox

  • (primitive) Boolean

Parameters

T

Type of the implementation

R

Type of the returned resolved objects

Functions

Link copied to clipboard
open fun resolve(option: ModalOption, event: ModalEvent, modalMapping: ModalMapping): R?

Returns a resolved object for this ModalMapping.

Link copied to clipboard
open suspend fun resolveSuspend(option: ModalOption, event: ModalEvent, modalMapping: ModalMapping): R?

Returns a resolved object for this ModalMapping.