Rename Permission to Precondition

This commit is contained in:
Finite Reality
2016-08-03 16:50:51 +01:00
parent 023703c996
commit a5393dc937
7 changed files with 49 additions and 17 deletions

View File

@@ -211,10 +211,10 @@ namespace Discord.Commands
// TODO: this logic is for users who don't manually search/execute: should we keep it?
IReadOnlyList<Command> commands = searchResult.Commands
.Where(x => x.CanExecute(message)).ToImmutableArray();
.Where(x => x.MeetsPreconditions(message)).ToImmutableArray();
if (commands.Count == 0 && searchResult.Commands.Count > 0)
return ParseResult.FromError(CommandError.InvalidPermissions, "Invalid permissions");
return ParseResult.FromError(CommandError.UnmetPrecondition, "Unmet precondition");
for (int i = commands.Count - 1; i >= 0; i--)
{