Added support for custom ModuleBase command contexts. Added SocketCommandContext/RpcCommandContext.
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Discord.Commands
|
||||
internal class ChannelTypeReader<T> : TypeReader
|
||||
where T : class, IChannel
|
||||
{
|
||||
public override async Task<TypeReaderResult> Read(CommandContext context, string input)
|
||||
public override async Task<TypeReaderResult> Read(ICommandContext context, string input)
|
||||
{
|
||||
if (context.Guild != null)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Discord.Commands
|
||||
_enumsByValue = byValueBuilder.ToImmutable();
|
||||
}
|
||||
|
||||
public override Task<TypeReaderResult> Read(CommandContext context, string input)
|
||||
public override Task<TypeReaderResult> Read(ICommandContext context, string input)
|
||||
{
|
||||
T baseValue;
|
||||
object enumValue;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Discord.Commands
|
||||
internal class MessageTypeReader<T> : TypeReader
|
||||
where T : class, IMessage
|
||||
{
|
||||
public override async Task<TypeReaderResult> Read(CommandContext context, string input)
|
||||
public override async Task<TypeReaderResult> Read(ICommandContext context, string input)
|
||||
{
|
||||
ulong id;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Discord.Commands
|
||||
_tryParse = PrimitiveParsers.Get<T>();
|
||||
}
|
||||
|
||||
public override Task<TypeReaderResult> Read(CommandContext context, string input)
|
||||
public override Task<TypeReaderResult> Read(ICommandContext context, string input)
|
||||
{
|
||||
T value;
|
||||
if (_tryParse(input, out value))
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Discord.Commands
|
||||
internal class RoleTypeReader<T> : TypeReader
|
||||
where T : class, IRole
|
||||
{
|
||||
public override Task<TypeReaderResult> Read(CommandContext context, string input)
|
||||
public override Task<TypeReaderResult> Read(ICommandContext context, string input)
|
||||
{
|
||||
ulong id;
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@ namespace Discord.Commands
|
||||
{
|
||||
public abstract class TypeReader
|
||||
{
|
||||
public abstract Task<TypeReaderResult> Read(CommandContext context, string input);
|
||||
public abstract Task<TypeReaderResult> Read(ICommandContext context, string input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Discord.Commands
|
||||
internal class UserTypeReader<T> : TypeReader
|
||||
where T : class, IUser
|
||||
{
|
||||
public override async Task<TypeReaderResult> Read(CommandContext context, string input)
|
||||
public override async Task<TypeReaderResult> Read(ICommandContext context, string input)
|
||||
{
|
||||
var results = new Dictionary<ulong, TypeReaderValue>();
|
||||
IReadOnlyCollection<IUser> channelUsers = (await context.Channel.GetUsersAsync(CacheMode.CacheOnly).Flatten().ConfigureAwait(false)).ToArray(); //TODO: must be a better way?
|
||||
|
||||
Reference in New Issue
Block a user