Don't force a bad permission message
This commit is contained in:
@@ -9,8 +9,6 @@ namespace Discord.Commands
|
||||
/// <summary> A Discord.Net client with extensions for handling common bot operations like text commands. </summary>
|
||||
public sealed partial class CommandService : IService
|
||||
{
|
||||
private const string DefaultPermissionError = "You do not have permission to access this command.";
|
||||
|
||||
private readonly CommandServiceConfig _config;
|
||||
private readonly CommandGroupBuilder _root;
|
||||
private DiscordClient _client;
|
||||
@@ -117,7 +115,7 @@ namespace Discord.Commands
|
||||
string errorText;
|
||||
if (!command.CanRun(eventArgs.User, eventArgs.Channel, out errorText))
|
||||
{
|
||||
RaiseCommandError(CommandErrorType.BadPermissions, eventArgs, new Exception(errorText ?? DefaultPermissionError));
|
||||
RaiseCommandError(CommandErrorType.BadPermissions, eventArgs, errorText != null ? new Exception(errorText) : null);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -262,7 +260,7 @@ namespace Discord.Commands
|
||||
StringBuilder output = new StringBuilder();
|
||||
string error;
|
||||
if (!command.CanRun(user, channel, out error))
|
||||
output.AppendLine(error ?? DefaultPermissionError);
|
||||
output.AppendLine(error ?? "You do not have permission to access this command.");
|
||||
else
|
||||
ShowCommandHelpInternal(command, user, channel, output);
|
||||
return (replyChannel ?? channel).SendMessage(output.ToString());
|
||||
|
||||
Reference in New Issue
Block a user