[cc] don't send success on failure

This commit is contained in:
zephyrkul 2020-08-18 18:40:32 -06:00 committed by GitHub
parent 7d6662e6b1
commit 7d66263948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,10 @@ class OnCooldown(CCError):
pass pass
class CommandNotEdited(CCError):
pass
class CommandObj: class CommandObj:
def __init__(self, **kwargs): def __init__(self, **kwargs):
self.config = kwargs.get("config") self.config = kwargs.get("config")
@ -166,7 +170,7 @@ class CommandObj:
await self.bot.wait_for("message", check=pred, timeout=30) await self.bot.wait_for("message", check=pred, timeout=30)
except asyncio.TimeoutError: except asyncio.TimeoutError:
await ctx.send(_("Response timed out, please try again later.")) await ctx.send(_("Response timed out, please try again later."))
return raise CommandNotEdited()
if pred.result is True: if pred.result is True:
response = await self.get_responses(ctx=ctx) response = await self.get_responses(ctx=ctx)
else: else:
@ -177,7 +181,7 @@ class CommandObj:
) )
except asyncio.TimeoutError: except asyncio.TimeoutError:
await ctx.send(_("Response timed out, please try again later.")) await ctx.send(_("Response timed out, please try again later."))
return raise CommandNotEdited()
response = resp.content response = resp.content
if response: if response:
@ -448,6 +452,8 @@ class CustomCommands(commands.Cog):
) )
except ArgParseError as e: except ArgParseError as e:
await ctx.send(e.args[0]) await ctx.send(e.args[0])
except CommandNotEdited:
pass
@customcom.command(name="list") @customcom.command(name="list")
@checks.bot_has_permissions(add_reactions=True) @checks.bot_has_permissions(add_reactions=True)