ComponentParameterResolver
interface ComponentParameterResolver<T : ParameterResolver<T, R>, ComponentParameterResolver<T, R>, R : Any> : IParameterResolver<T> (source)
Resolver for parameters annotated with @ComponentData.
Needs to be implemented alongside a ParameterResolver subclass.
Types supported by default
Role (if available)
User (if available)
Member (if available)
InputUser (if available)
GuildChannel subtypes (if available)
Guild (if available)
Use case - Supporting serializable objects
If you need to pass serializable objects to your components, you can instead use @SerializableComponentData and let it generate a resolver for you.
Parameters
T
Type of the implementation
R
Type of the returned resolved objects
Functions
Link copied to clipboard
open fun resolve(option: ComponentOption, event: GenericComponentInteractionCreateEvent, data: SerializedComponentData): R?
Returns a resolved object from this component interaction.
Link copied to clipboard
open suspend fun resolveSuspend(option: ComponentOption, event: GenericComponentInteractionCreateEvent, data: SerializedComponentData): R?
Returns a resolved object from this component interaction.
Link copied to clipboard
Serializes an instance of the resolvable object.