bot = commands.Bot(command_prefix='#')
@bot.event
async def on_message(message):
if message.content == "detect":
await bot.send_message(message.channel, "detected")
这是我用python制作discord bot的代码(跳过),我想检测“detect”这个词 我成功地检测到了那个单词,但它无法检测出该单词前面或后面是否有其他字母。 (例如,某种东西)
有没有什么方法可以检测出“detect”这个词,即使还有其他字母?你知道吗
我认为这应该奏效:
相关问题 更多 >
编程相关推荐