如何让机器人在触发字(discord.py)后保存消息

如何让机器人在触发字(discord.py)后保存消息,discord,bots,discord.py,Discord,Bots,Discord.py,我试图让我的bot响应在触发字之后发送的消息,但它所做的只是向我发送以下错误:AttributeError:'generator'对象没有属性“content”。这是我的密码: @client.event async def on_message(message): if message.content == "report": await message.author.send("Type your report below")

我试图让我的bot响应在触发字之后发送的消息,但它所做的只是向我发送以下错误:
AttributeError:'generator'对象没有属性“content”
。这是我的密码:

@client.event
async def on_message(message):
    if message.content == "report":
        await message.author.send("Type your report below")
        def check(m):
            return m.guild == None and m.author == message.author
        try:
            response = client.wait_for("message", check=check)
        except asyncio.TimeoutError:
            await message.author.send("Uh-oh, the request timed out! Try again.")
        else:
            content = response.content
提前谢谢

是一个协程函数。这意味着,为了使用它,你必须等待它

你只需要做:

response = await client.wait_for("message", check=check)