From a28adac0bf6945d68482290dc898a93cfe4e96b1 Mon Sep 17 00:00:00 2001 From: Florian SYLVAIN Date: Sun, 7 Mar 2021 02:10:49 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=A5=85=20-=20Catch=20the=20erro?= =?UTF-8?q?r=20when=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 | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/python/cmd_lol.py b/python/cmd_lol.py index 8038c00..9211776 100644 --- a/python/cmd_lol.py +++ b/python/cmd_lol.py @@ -5,6 +5,7 @@ from discord.ext.commands.cooldowns import BucketType from private import TOKEN_RIOT from api_riot import rank_track, what_player +CD_LOLRANK = 0 class LolCmds(commands.Cog): def __init__(self, bot): @@ -13,6 +14,7 @@ class LolCmds(commands.Cog): @commands.command() @commands.cooldown(1, 2, commands.BucketType.user) async def lol_rank(self, ctx, invocator_name, x=None): + CD_LOLRANK = 0 if x is None: player = what_player(invocator_name) if player != 0: @@ -36,15 +38,5 @@ 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