Class ComponentTypeConverter
Base class for creating Component TypeConverters. InteractionService uses TypeConverters to interface with Slash Command parameters.
Namespace: Discord.Interactions
Assembly: Discord.Net.Interactions.dll
Syntax
public abstract class ComponentTypeConverter : object, ITypeConverter<IComponentInteractionData>
Methods
| Improve this Doc View SourceCanConvertTo(Type)
Will be used to search for alternative TypeConverters whenever the Command Service encounters an unknown parameter type.
Declaration
public abstract bool CanConvertTo(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | An object type. |
Returns
Type | Description |
---|---|
Boolean | The boolean result. |
ReadAsync(IInteractionContext, IComponentInteractionData, IServiceProvider)
Will be used to read the incoming payload before executing the method body.
Declaration
public abstract Task<TypeConverterResult> ReadAsync(IInteractionContext context, IComponentInteractionData option, IServiceProvider services)
Parameters
Type | Name | Description |
---|---|---|
IInteractionContext | context | Command execution context. |
IComponentInteractionData | option | Received option payload. |
IServiceProvider | services | Service provider that will be used to initialize the command module. |
Returns
Type | Description |
---|---|
Task<TypeConverterResult> | The result of the read process. |