Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
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))