@client.command()
@commands.has_role("Bot Owner")
async def gstart(ctx, mins : int, *, prize: str):
embed = discord.Embed(title="Giveaway!", description=f"{prize}", color=ctx.author.color)
end = datetime.datetime.utcnow() + datetime.timedelta(seconds=mins*60)
embed.add_field(name='Ends At:', value=f"{end} UTC")
embed.set_footer(text=f'Ends {mins} mintues from now!')
my_msg = await ctx.send(embed=embed)
await my_msg.add_reaction("")
await asyncio.sleep(mins*60)
new_msg = await ctx.channel.fetch_message(my_msg.id)
users = new_msg.reactions[0].users().flatten()
users.pop(users.index(client.user))
winner = random.choice(users)
await ctx.send(f"test! {winner.mention} test {prize}!")
The problem is that when it expires, I get the following error message :
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
What could be the problem?