Reduced command module lifetime to a single command execution. Removed ModuleAttribute.

This commit is contained in:
RogueException
2016-10-10 20:26:01 -03:00
parent 3930e1147c
commit 635819b89f
16 changed files with 203 additions and 202 deletions

View File

@@ -7,14 +7,14 @@ namespace Discord.Commands
public struct SearchResult : IResult
{
public string Text { get; }
public IReadOnlyList<Command> Commands { get; }
public IReadOnlyList<CommandInfo> Commands { get; }
public CommandError? Error { get; }
public string ErrorReason { get; }
public bool IsSuccess => !Error.HasValue;
private SearchResult(string text, IReadOnlyList<Command> commands, CommandError? error, string errorReason)
private SearchResult(string text, IReadOnlyList<CommandInfo> commands, CommandError? error, string errorReason)
{
Text = text;
Commands = commands;
@@ -22,7 +22,7 @@ namespace Discord.Commands
ErrorReason = errorReason;
}
public static SearchResult FromSuccess(string text, IReadOnlyList<Command> commands)
public static SearchResult FromSuccess(string text, IReadOnlyList<CommandInfo> commands)
=> new SearchResult(text, commands, null, null);
public static SearchResult FromError(CommandError error, string reason)
=> new SearchResult(null, null, error, reason);