Added a few more permission checks

This commit is contained in:
RogueException
2015-11-09 21:05:24 -04:00
parent 2abe8b4d80
commit 1595150fd1

View File

@@ -236,7 +236,10 @@ After:
} }
if (isFirst) if (isFirst)
output.Append("There are no subcommands you have permission to run."); {
output.Clear();
output.AppendLine("You do not have permission to access this command.");
}
return _client.SendMessage(replyChannel ?? channel, output.ToString()); return _client.SendMessage(replyChannel ?? channel, output.ToString());
} }
@@ -248,6 +251,12 @@ After:
} }
private void ShowCommandHelpInternal(Command command, User user, Channel channel, StringBuilder output) private void ShowCommandHelpInternal(Command command, User user, Channel channel, StringBuilder output)
{ {
if (!command.CanRun(user, channel))
{
output.AppendLine("You do not have permission to access this command.");
return;
}
output.Append('`'); output.Append('`');
output.Append(command.Text); output.Append(command.Text);
foreach (var param in command.Parameters) foreach (var param in command.Parameters)