Skip to content
Permalink
Browse files
added ahmeds chat filter
  • Loading branch information
peacoc17 committed Nov 22, 2018
1 parent 02cc1a9 commit 40f39d84fc6f2add905642077f01507224c1e882
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
@@ -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))
@@ -16,7 +16,7 @@ BOT_PREFIX = ("?")
TOKEN = "NTA1MTA1ODU0NjI2OTIyNTE2.DtAhPQ.r7Lhj6xGVkmTFHeIM0h5KNC3He0"

client = commands.Bot(command_prefix=BOT_PREFIX)
extensions=["Fun","Music","Random","LocationWeather","User"]
extensions=["Fun","Music","Random","LocationWeather","User","Filter"]


async def start(self):

0 comments on commit 40f39d8

Please sign in to comment.