'Making a word filter (nextcord,python)
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.
Solution 1:[1]
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")`
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | coder |
