From 0d547e9c16f05da69001628440fd4a80fd22fc4d Mon Sep 17 00:00:00 2001 From: Florian SYLVAIN Date: Sun, 7 Mar 2021 02:05:00 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20-=20Catch=20the=20error=20when?= =?UTF-8?q?=20lol=5Frank=20is=20used=20without=20argument?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/cmd_lol.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/cmd_lol.py b/python/cmd_lol.py index bcb30ec..8038c00 100644 --- a/python/cmd_lol.py +++ b/python/cmd_lol.py @@ -36,5 +36,15 @@ class LolCmds(commands.Cog): await ctx.send('If you are trying to use a username with spaces, please surround it with quotes.') + @lol_rank.error + async def issou_error(self, ctx, error): + global CD_LOLRANK + if isinstance(error, commands.CommandOnCooldown) and not CD_LOLRANK: + await ctx.send(f'Please wait at least 2 seconds between each $lol_rank.') + CD_LOLRANK = 1 + elif isinstance(error, commands.MissingRequiredArgument): + await ctx.send(f'Please enter an invocator name (EUW) after $lol_rank.') + + def setup(bot): bot.add_cog(LolCmds(bot)) \ No newline at end of file