diff --git a/cogs/playerlink.py b/cogs/playerlink.py index 7372b1a..fc2663e 100644 --- a/cogs/playerlink.py +++ b/cogs/playerlink.py @@ -65,6 +65,12 @@ class PlayerLink(commands.Cog): elif (success == True): embed.add_field(name="Success", value=f"The link was successfull!", inline=False) embed.colour = discord.Colour.green() + elif (timer.minutes == 2): + embed.add_field(name="Timer", value=f"The code will expire in { str(timer.minutes)} minutes", inline=False) + embed.colour = discord.Colour.orange() + elif (timer.minutes < 2): + embed.add_field(name="Timer", value=f"The code will expire in less than { str(timer.minutes + 1)} {'minutes' if timer.minutes + 1 > 1 else 'minute'}", inline=False) + embed.colour = discord.Colour.orange() else: embed.add_field(name="Timer", value=f"The code will expire in {str(timer.minutes).zfill(2)}:{str(timer.seconds).zfill(2)}", inline=False) embed.colour = discord.Colour.orange() @@ -75,11 +81,13 @@ class PlayerLink(commands.Cog): await asyncio.sleep(1) timer.update() # maybe create a task from this because this takes some time -> timer not accurate - # asyncio.create_task(message........) - await message.edit(embed=create_embed(ctx.author, arg, timer)) + if ((timer.minutes < 2 and timer.seconds == 59) or (timer.minutes == 0 and timer.seconds == 0)): + asyncio.create_task(message.edit(embed=create_embed(ctx.author, arg, timer))) + try: send_chat(ctx.author.name, arg, code) + #message_send_time = timer = Timer() message = await ctx.send(embed=create_embed(ctx.author, arg, timer))