[Mod] Fix modset deletedelay (#2943)

* [Mod] Fix modset deletedelay

  fixes #2942

* Style guide fix
This commit is contained in:
DiscordLiz 2019-08-27 09:27:24 -04:00 committed by Michael H
parent 326c53d6c4
commit 0c773134f2
2 changed files with 6 additions and 3 deletions

View File

@ -0,0 +1 @@
``modset deletedelay`` doesn't delete non-commands.

View File

@ -21,10 +21,12 @@ class MoveToCore(MixinMeta):
async def on_command_completion(self, ctx: commands.Context): async def on_command_completion(self, ctx: commands.Context):
await self._delete_delay(ctx) await self._delete_delay(ctx)
# noinspection PyUnusedLocal
@commands.Cog.listener() @commands.Cog.listener()
async def on_command_error(self, ctx: commands.Context, error): async def on_command_error(self, ctx: commands.Context, error: Exception):
await self._delete_delay(ctx) # 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): async def _delete_delay(self, ctx: commands.Context):
"""Currently used for: """Currently used for: