📌  相关文章
📜  如何制作不和谐的审核机器人 python 代码示例

📅  最后修改于: 2022-03-11 14:46:34.695000             🧑  作者: Mango

代码示例2
#You can solve your problem like this:

@client.event
async def on_message(message):
    if "your word" in str.lower(message.content):
        await message.delete()

#This programm makes the message into all lowercase letters. 
#just be carefull, your word that you want to be deleted has to be written in all lowercase letters too.

#if you want to look if an element is in a list do:
bad_words = ["test", "bad", "word"]

@client.event
async def on_message(message):
    for word in bad_words:
        if word in str.lower(message.content):
            await message.delete()