File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 11aiohttp >= 3.6.2
22async-timeout >= 3.0.1
33attrs >= 19.3.0
4- beautifulsoup4 >= 4.9.1
4+ beautifulsoup4 >= 4.10.0
55bs4 >= 0.0.1
6- certifi >= 2020.6.20
6+ certifi >= 2021.5.30
77chardet >= 3.0.4
8- discord.py >= 1.7.2
8+ discord.py >= 1.7.3
99idna >= 2.10
1010lavalink >= 3.1.2
1111multidict >= 4.7.6
@@ -19,3 +19,5 @@ urllib3>=1.25.10
1919websockets >= 8.1
2020yarl >= 1.5.1
2121mysql-connector-python >= 8.0.21
22+ alt-profanity-check == 1.1.1
23+ protobuf >= 3.20.2 # not directly required, pinned by Snyk to avoid a vulnerability
Original file line number Diff line number Diff line change @@ -198,9 +198,11 @@ async def debug(ctx):
198198 inline = True )
199199 embed .add_field (name = "Bug Report:" , value = "[Issues](https://github.com/RedCokeDevelopment/Teapot.py/issues)" ,
200200 inline = True )
201- embed .add_field (name = "Website:" , value = "[Website](https://teapot.page )" , inline = True )
201+ embed .add_field (name = "Website:" , value = "[Website](https://teapot.bot )" , inline = True )
202202 embed .add_field (name = "Links" ,
203- value = "[Support Discord](https://discord.gg/7BRGs6F) | [Add bot to server](https://discordapp.com/oauth2/authorize?client_id=669880564270104586&permissions=8&scope=bot) | [Repository](https://github.com/RedCokeDevelopment/Teapot.py)" ,
203+ value = "[Support Discord](https://discord.gg/7BRGs6F) | [Add bot to server]" +
204+ "(https://discordapp.com/oauth2/authorize?client_id=669880564270104586&permissions=8&scope=bot) | " +
205+ "[Repository](https://github.com/RedCokeDevelopment/Teapot.py)" ,
204206 inline = False )
205207 embed .set_footer (text = f"{ teapot .copyright ()} | Code licensed under the MIT License" )
206208 # embed.set_image(url="https://user-images.githubusercontent.com/43201383/72987537-89830a80-3e25-11ea-95ef-ecfa0afcff7e.png")
Original file line number Diff line number Diff line change 11import json
22import teapot
33import discord
4+ from profanity_check import predict_prob
45
56
67def __init__ (bot ):
@@ -88,6 +89,13 @@ async def on_message(message):
8889 if char not in punctuations :
8990 msg = msg + char
9091
92+ # profanity check
93+ prob = predict_prob ([msg ])
94+ if prob >= 0.8 :
95+ em = discord .Embed (title = f"AI Analysis Results" , color = 0xC54B4F )
96+ em .add_field (name = 'PROFANITY DETECTED! ' , value = str (prob [0 ]))
97+ await message .channel .send (embed = em )
98+
9199 if msg .startswith ("system call " ):
92100 content = msg [12 :].split (" " )
93101 if content [0 ].lower () == "inspect" :
You can’t perform that action at this time.
0 commit comments