This repository was archived by the owner on May 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage_filter.py
More file actions
56 lines (47 loc) · 1.44 KB
/
message_filter.py
File metadata and controls
56 lines (47 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import discord
from discord.ext import commands
class Message(commands.Cog):
"""A chat filter that looks for a swear word or the word 'Wonderla'"""
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener("on_message")
async def hari_om(self, message):
if message.author == self.bot.user:
return
swear_words = [
"FUCK",
"BASTARD",
"AMMAN",
"SULE",
"MOTHERFUCKER",
"ASSHOLE",
"DENGIBDTHINI",
"TIKKA",
"SHIT",
"CRAP",
"SHAATA",
"CHUTIYA",
"BHENCHOD",
"MADARCHOD",
"GAND",
"GAAND",
"LUND",
"PUTA",
"BHOSEDK",
"LODE",
"LOUDE",
"LAUDE",
"SHATA",
]
if any(word in message.content.upper() for word in swear_words):
await message.channel.send("Hari Om")
@commands.Cog.listener("on_message")
async def wonderla(self, message):
if message.author == self.bot.user:
return
if "WONDERLA" in message.content.upper():
await message.channel.send("Macha come lets go to Wonderla!")
def setup(bot):
"""Adds cog to the bot and logs to console"""
bot.add_cog(Message(bot))
print("message_filter.py is loaded")