创建一个单词过滤器(nextcord,python)



如何创建一个单词过滤器?我正在使用nextcord(py),我想做一个单词过滤器,但我真的不知道从哪里开始。

这是一个开始,所以你需要做一个列表words_to_filter = ["wordone", "word2"]然后我们需要循环遍历列表并获取每个单词for word in words_to_filter:把它放在on message事件中:

`@client.event()
async def on_message(self, message):
for word in words_to_filter:
if word in message.content
await message.channel.purge(limit=1)
await message.channel.send("youve been filtered")`

最新更新