Added IServiceProvider (#753)

This commit is contained in:
Hsu Still
2017-07-16 23:32:49 +08:00
committed by Christopher F
parent 0bdc2455bc
commit b59c48b9ec

View File

@@ -4,12 +4,12 @@ using Discord.Commands;
public class BooleanTypeReader : TypeReader public class BooleanTypeReader : TypeReader
{ {
public override Task<TypeReaderResult> Read(CommandContext context, string input) public override Task<TypeReaderResult> Read(ICommandContext context, string input, IServiceProvider services)
{ {
bool result; bool result;
if (bool.TryParse(input, out result)) if (bool.TryParse(input, out result))
return Task.FromResult(TypeReaderResult.FromSuccess(result)); return Task.FromResult(TypeReaderResult.FromSuccess(result));
return Task.FromResult(TypeReaderResult.FromError(CommandError.ParseFailed, "Input could not be parsed as a boolean.")) return Task.FromResult(TypeReaderResult.FromError(CommandError.ParseFailed, "Input could not be parsed as a boolean."));
} }
} }