【发布时间】:2020-04-19 13:12:00
【问题描述】:
我试图让我的机器人在输入时检测到“哇”这个词,然后用“哦哇”做出回应,但我不知道该怎么做,在互联网上搜索答案对我没有帮助因为通常他们不会尝试专门做我正在做的事情。
这是我现在的代码
#New Event, prints oh wow if someone says wow
@client.event
async def on_message(message):
if "wow" in message.content:
await channel.send("oh wow")
#End of Event
【问题讨论】:
-
那么出了什么问题?你做过调试吗?什么是 message.content?
-
您是否在某处定义了
channel,或者您打算使用message.channel.send?您是否看到错误消息?
标签: python discord chatbot discord.py discord.py-rewrite