From d42a2d514051297103f65f95b6712302bf2062bb Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Wed, 16 Oct 2019 14:17:04 +0200 Subject: [PATCH] [Core] Fix error message about guild-only command and add dm-only error message (#3057) * enhance(core): fix guild-only error message, add dm-only error message * chore(changelog): add towncrier entries --- changelog.d/3057.bugfix.rst | 1 + changelog.d/3057.enhance.rst | 1 + redbot/core/events.py | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelog.d/3057.bugfix.rst create mode 100644 changelog.d/3057.enhance.rst diff --git a/changelog.d/3057.bugfix.rst b/changelog.d/3057.bugfix.rst new file mode 100644 index 000000000..da388eeac --- /dev/null +++ b/changelog.d/3057.bugfix.rst @@ -0,0 +1 @@ +Bot will now properly send a message when the invoked command is guild-only. \ No newline at end of file diff --git a/changelog.d/3057.enhance.rst b/changelog.d/3057.enhance.rst new file mode 100644 index 000000000..01748722e --- /dev/null +++ b/changelog.d/3057.enhance.rst @@ -0,0 +1 @@ +Bot will now send a message when the invoked command is DM-only. \ No newline at end of file diff --git a/redbot/core/events.py b/redbot/core/events.py index 77509dd83..9bd6699a2 100644 --- a/redbot/core/events.py +++ b/redbot/core/events.py @@ -234,10 +234,12 @@ def init_events(bot, cli_flags): elif isinstance(error, commands.UserFeedbackCheckFailure): if error.message: await ctx.send(error.message) - elif isinstance(error, commands.CheckFailure): - pass elif isinstance(error, commands.NoPrivateMessage): await ctx.send("That command is not available in DMs.") + elif isinstance(error, commands.PrivateMessageOnly): + await ctx.send("That command is only available in DMs.") + elif isinstance(error, commands.CheckFailure): + pass elif isinstance(error, commands.CommandOnCooldown): await ctx.send( "This command is on cooldown. Try again in {}.".format(