【发布时间】:2021-08-11 14:08:13
【问题描述】:
我有一个不和谐的机器人,它应该在某些用户说出没有前缀的内容时发送消息。例如“测试”,当一个用户在频道中说“测试”时,机器人应该以“测试”响应,它的工作,但问题是,即使用户已经停止发送“测试”,机器人也不会停止发送“测试” ”。这是代码。
@client.event
async def on_message(message):
if 'test' in message.content:
await message.channel.send('testing')
【问题讨论】:
-
对于未来,
'test' 在'testing'内部,这会导致循环。
标签: python discord.py