From 1595150fd176f75021bf3ef8b8c586c95c3cc674 Mon Sep 17 00:00:00 2001 From: RogueException Date: Mon, 9 Nov 2015 21:05:24 -0400 Subject: [PATCH] Added a few more permission checks --- src/Discord.Net.Commands/CommandService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Commands/CommandService.cs b/src/Discord.Net.Commands/CommandService.cs index 362f0f1fa..ab24b845d 100644 --- a/src/Discord.Net.Commands/CommandService.cs +++ b/src/Discord.Net.Commands/CommandService.cs @@ -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)