diff --git a/src/Discord.Net.Commands/CommandService.cs b/src/Discord.Net.Commands/CommandService.cs index bf1785565..83924c80f 100644 --- a/src/Discord.Net.Commands/CommandService.cs +++ b/src/Discord.Net.Commands/CommandService.cs @@ -9,8 +9,6 @@ namespace Discord.Commands /// A Discord.Net client with extensions for handling common bot operations like text commands. 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());