试图制作一个服务器机器人,但约会时间有问题,我不明白它是什么



错误:第16行,在赠品中end=datetime.datetime.ucnow((+datetime.timedelta(秒=分钟*60(TypeError:不支持*的操作数类型:"type"one_answers"int">

我的代码是:

embed = discord.Embed(title= "Giveaway!",description = f"{prize}")
end= datetime.datetime.utcnow() + datetime.timedelta(seconds= mins*60)
embed.add_field(name="Ends In:", value= f"{end} UTC")
embed.set_footer(text=f"Ends {mins} Minutes From Now")
msg = await ctx.send(embed=embed)
await msg.add_reaction('🎉')
await asyncio.sleep(mins*60)
new_msg =await ctx.channel.fetch_message(msg.id)
users = await new_msg.reaction[0].users().flatten()
users.pop(users.index(client.user))
win = random.choice(users)
await ctx.send(f"Congratulations {win.mention} You Just Won {prize}")

您的代码没有显示mins赋值,我认为问题出在mins变量中,请确保它是一个整数,并尝试像这样放括号seconds= (mins*60)

最新更新