Sanitize @everyone and @here in proxied messages

This commit is contained in:
Ske
2018-10-23 01:14:33 +02:00
parent 7174979fd1
commit 7636a48d14
2 changed files with 8 additions and 2 deletions

View File

@@ -163,7 +163,6 @@ class Proxy:
if member.avatar_url:
form_data.add_field("avatar_url", member.avatar_url)
time_before = time.perf_counter()
async with self.session.post(
"https://discordapp.com/api/v6/webhooks/{}/{}?wait=true".format(hook_id, hook_token),
data=form_data) as resp:
@@ -238,6 +237,9 @@ class Proxy:
self.logger.debug("Skipping message because of no text and no attachment")
return False
# Remember to sanitize the text (remove @everyones and such)
text = utils.sanitize(text)
try:
async with conn.transaction():
await self.do_proxy_message(conn, member, message, text=text, attachment_url=attachment_url)