Making a word filter (nextcord,python)

135 Views Asked by At

How can I make a word filter? I am using nextcord(py) and I would like to make a word filter, but I dont really know where to start.

1

There are 1 best solutions below

0
On

here is a start so you will need to make a list words_to_filter = ["wordone", "word2"] then we will need to run a loop through the list and get each word for word in words_to_filter: put this in a on message event:

`@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")`