diff --git a/changelog.d/mod/2924.fix.rst b/changelog.d/mod/2924.fix.rst new file mode 100644 index 000000000..38dce73f7 --- /dev/null +++ b/changelog.d/mod/2924.fix.rst @@ -0,0 +1 @@ +``modset deletedelay`` doesn't delete non-commands. \ No newline at end of file diff --git a/redbot/cogs/mod/movetocore.py b/redbot/cogs/mod/movetocore.py index 35fae7b1c..e358cc742 100644 --- a/redbot/cogs/mod/movetocore.py +++ b/redbot/cogs/mod/movetocore.py @@ -21,10 +21,12 @@ class MoveToCore(MixinMeta): async def on_command_completion(self, ctx: commands.Context): await self._delete_delay(ctx) - # noinspection PyUnusedLocal @commands.Cog.listener() - async def on_command_error(self, ctx: commands.Context, error): - await self._delete_delay(ctx) + async def on_command_error(self, ctx: commands.Context, error: Exception): + # Every message which isn't a command but which + # starts with a bot prefix is dispatched as a command error + if not isinstance(error, commands.CommandNotFound): + await self._delete_delay(ctx) async def _delete_delay(self, ctx: commands.Context): """Currently used for: