ParameterResolver

@InterfacedService(acceptMultiple = true)
sealed class ParameterResolver<T : ParameterResolver<T, R>, R : Any> : IParameterResolver<T> (source)

Base class for parameter resolvers used in text commands, application commands, and component callbacks.

You need to extend ClassParameterResolver or TypedParameterResolver instead.

Default parameter resolvers

TextSlashMessage contextUser contextComponentsModalsComponent timeout
String✓ (can be quoted)
Boolean
Int
Long
Double
Emoji
IMentionable✓ (only mentions)
List of mentionable (see @MentionsString)
Role
UserSnowflake✓ (target user)
User✓ (target user)
Member✓ (target user)
InputUser✓ (target user)
GuildChannel subtypes1
Guild✓ (as a String)
Message✓ (target message)
Attachment
  1. The channel types are set automatically depending on the type, but a broader channel type can be used and restricted to multiple concrete types by using @ChannelTypes.

Parameter resolvers for services exist by default, and follow the rules described in @BService.

You can also check loaded parameter resolvers in the logs on the trace level.

Parameters

T

Type of the implementation

R

Type of the returned resolved objects

See also

Inheritors