Class ComponentTypeConverter
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
Base class for creating Component TypeConverters. InteractionService uses TypeConverters to interface with Slash Command parameters.
public abstract class ComponentTypeConverter
- Inheritance
-
ComponentTypeConverter
- Derived
- Inherited Members
Methods
CanConvertTo(Type)
Will be used to search for alternative TypeConverters whenever the Command Service encounters an unknown parameter type.
public abstract bool CanConvertTo(Type type)
Parameters
type
TypeAn object type.
Returns
- bool
The boolean result.
ReadAsync(IInteractionContext, IComponentInteractionData, IServiceProvider)
Will be used to read the incoming payload before executing the method body.
public abstract Task<TypeConverterResult> ReadAsync(IInteractionContext context, IComponentInteractionData option, IServiceProvider services)
Parameters
context
IInteractionContextCommand execution context.
option
IComponentInteractionDataReceived option payload.
services
IServiceProviderService provider that will be used to initialize the command module.
Returns
- Task<TypeConverterResult>
The result of the read process.