Added support for custom errors from permission checkers

This commit is contained in:
RogueException
2015-11-10 15:37:32 -04:00
parent d9759abf4c
commit f06a1d7278
8 changed files with 52 additions and 27 deletions

View File

@@ -95,13 +95,14 @@ namespace Discord.Commands
_checks = checks;
}
internal bool CanRun(User user, Channel channel)
internal bool CanRun(User user, Channel channel, out string error)
{
for (int i = 0; i < _checks.Length; i++)
{
if (!_checks[i].CanRun(this, user, channel))
if (!_checks[i].CanRun(this, user, channel, out error))
return false;
}
error = null;
return true;
}