Class ChannelTypeReader<T>
A TypeReader for parsing objects implementing IChannel.
public class ChannelTypeReader<T> : TypeReader where T : class, IChannel
Type Parameters
T
The type to be checked; must implement IChannel.
- Inheritance
-
ChannelTypeReader<T>
- Inherited Members
Remarks
This TypeReader is shipped with Discord.Net and is used by default to parse any IChannel implemented object within a command. The TypeReader will attempt to first parse the input by mention, then the snowflake identifier, then by name; the highest candidate will be chosen as the final output; otherwise, an erroneous TypeReaderResult is returned.
Methods
ReadAsync(ICommandContext, string, IServiceProvider)
Attempts to parse the input
into the desired type.
public override Task<TypeReaderResult> ReadAsync(ICommandContext context, string input, IServiceProvider services)
Parameters
context
ICommandContextThe context of the command.
input
stringThe raw input of the command.
services
IServiceProviderThe service collection used for dependency injection.
Returns
- Task<TypeReaderResult>
A task that represents the asynchronous parsing operation. The task result contains the parsing result.