Browse Source

Added a few more permission checks

tags/docs-0.9
RogueException 9 years ago
parent
commit
1595150fd1
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      src/Discord.Net.Commands/CommandService.cs

+ 10
- 1
src/Discord.Net.Commands/CommandService.cs View File

@@ -236,7 +236,10 @@ After:
}

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());
}
@@ -248,6 +251,12 @@ After:
}
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(command.Text);
foreach (var param in command.Parameters)


Loading…
Cancel
Save