mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Mod] Fix modset deletedelay (#2943)
* [Mod] Fix modset deletedelay fixes #2942 * Style guide fix
This commit is contained in:
parent
326c53d6c4
commit
0c773134f2
1
changelog.d/mod/2924.fix.rst
Normal file
1
changelog.d/mod/2924.fix.rst
Normal file
@ -0,0 +1 @@
|
||||
``modset deletedelay`` doesn't delete non-commands.
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user