【发布时间】:2021-05-26 00:07:12
【问题描述】:
我在这里需要帮助,我不知道我的代码有什么问题。谁能解释一下?
@client.command()
async def gameONE(ctx):
await ctx.send("Welcome to the GAME! (between 1-20) ")
pcNumber = random.randint(0,21)
print(pcNumber)
await ctx.send("Enter a number please.. ")
userNumber = await client.wait_for("message")
corro = float(userNumber.contect)
if pcNumber > corro:
ctx.send("PC won!")
elif corro > pcNumber:
ctx.send("YOU won!")
else:
ctx.send("I didnt understand")
它给了我这个错误:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Message' object has no attribute 'contect'
【问题讨论】:
-
你的意思是
Message.content?
标签: python error-handling discord.py