Skip to content

Commit 5b235ef

Browse files
authored
Merge pull request #73 from RedCokeDevelopment/snyk-fix-e363ed26695a641393e852d104d1e54b
[Snyk] Security upgrade protobuf from 3.20.1 to 3.20.2
2 parents 0527c4a + 64e68d9 commit 5b235ef

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

requirements.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
aiohttp>=3.6.2
22
async-timeout>=3.0.1
33
attrs>=19.3.0
4-
beautifulsoup4>=4.9.1
4+
beautifulsoup4>=4.10.0
55
bs4>=0.0.1
6-
certifi>=2020.6.20
6+
certifi>=2021.5.30
77
chardet>=3.0.4
8-
discord.py>=1.7.2
8+
discord.py>=1.7.3
99
idna>=2.10
1010
lavalink>=3.1.2
1111
multidict>=4.7.6
@@ -19,3 +19,5 @@ urllib3>=1.25.10
1919
websockets>=8.1
2020
yarl>=1.5.1
2121
mysql-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

teapot/cogs/cmds.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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")

teapot/events.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import teapot
33
import discord
4+
from profanity_check import predict_prob
45

56

67
def __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":

0 commit comments

Comments
 (0)