我想要一个帮助,我试图使我的机器人在有人写下某个单词时自动响应,但问题是该命令仅在单词是句子中首先要写的单词时才有效。我希望我的机器人即使在某个句子中间出现单词时也可以响应该消息。我该怎么办?
Bot = commands.Bot(command_prefix="")
@Bot.event
async def on_message(message):
if "not" in message.content:
await Bot.send_message(message.channel, 'yes')
为了澄清-message.content.startswith
仅检查定义的字符/字符串是否在消息的开头,而message.content会扫描发送的整个消息。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句