Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import discord | ||
from discord.ext import commands | ||
|
||
class Filter: | ||
def __init__(self, client): | ||
self.client = client | ||
|
||
async def on_message(self,message): | ||
filter_words= ["NIGGER", "NIGGA", "FAGGOT", "RETARDED","CUNT", "KYS","FUCK"] #Words to filter | ||
MakeWordsUpper=message.content.upper() | ||
for word in filter_words: | ||
if word in MakeWordsUpper: #checks if the message sent contains any word from the filter_words | ||
await self.client.delete_message(message) #Deletes the message | ||
await self.client.send_message(message.channel, "You're not allowed to use that word here!") | ||
|
||
|
||
def setup(client): | ||
client.add_cog(Filter(client)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters