-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
23 lines (19 loc) · 858 Bytes
/
main.py
File metadata and controls
23 lines (19 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import discord
import ProfanityBlocker
import asyncio
import builtins
from ProfanityConfiguration import ProfanityConfiguration
builtins.config = ProfanityConfiguration()
builtins.client = discord.Client()
Licence, Email, Link, Phone = config.GetConfigVar("ProfaneData")
builtins.ProfaneService = ProfanityBlocker.ProfanityService(Licence,EmailFilter=Email, LinkFilter=Link,PhoneFilter=Phone)
@client.event
async def on_message(message):
Profane = ProfaneService.ParseText(message.content)
if Profane != message.content:
if config.GetConfigVar("MessageOnProfane"):
await message.channel.send(config.GetConfigVar("MessageProfane"))
if config.GetConfigVar("DeleteOnProfaneMessage"):
await message.delete()
loop = asyncio.get_event_loop()
loop.run_until_complete(client.start(config.GetConfigVar("BotToken")))