【发布时间】:2022-01-16 02:19:45
【问题描述】:
我遇到问题的命令:
@bot.command()
async def auction(ctx, starting, items, items2):
price = starting
embed1=discord.Embed(title=f'**__Auction Starting!__**', description=f'**{ctx.author}** is starting an auction for **{items} {items2}**.\nThe starting price is **⏣ {starting}**.', color=discord.Color.gold())
await ctx.send(embed=embed1)
embed2=discord.Embed(title=f'**__Current Price__**', description=f'The price is currently:\n**⏣ {price}**.', color=discord.Color.gold())
message1 = await ctx.send(embed=embed2)
end = False
while not end:
try:
user = await bot.wait_for('message', check=check, timeout=3600)
bid = int(user.content)
if int(bid) > 0:
price += f"{bid}"
await message1.edit(embed=embed2)
except asyncio.TimeoutError:
end = True
错误是:
RuntimeWarning: couroutine 'Command.__call__' was never awaited.
super().dispatch(event_name, *args, **kwargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback.
如果需要,这里是完整的代码: https://mystb.in/MechanicsRoommatePhone.python
感谢您的回答!
【问题讨论】:
标签: python discord discord.py python-asyncio