【发布时间】:2021-02-19 15:55:27
【问题描述】:
我试图让我的机器人响应在触发词之后发送的消息,但它所做的只是向我发送以下错误:AttributeError: 'generator' object has no attribute '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
提前致谢!
【问题讨论】:
标签: discord bots discord.py