Browse Source

Added IServiceProvider

pull/753/head
Hsu Still GitHub 8 years ago
parent
commit
89d474a734
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      docs/guides/commands/samples/typereader.cs

+ 4
- 4
docs/guides/commands/samples/typereader.cs View File

@@ -4,12 +4,12 @@ using Discord.Commands;

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;
if (bool.TryParse(input, out 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."));
}
}
}

Loading…
Cancel
Save