luk3yx's hotfix for removing translation strings
Not sure if this fixes it per se as I've been unable to reproduce the issue myself despite witnessing it on another user's relay. At the very least, it doesn't break anything when tested.
This commit is contained in:
parent
0f8e82b931
commit
e74006c9b7
@ -8,6 +8,7 @@ import asyncio
|
||||
import json
|
||||
import time
|
||||
import configparser
|
||||
import re
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
@ -78,6 +79,8 @@ async def handle(request):
|
||||
data = json.loads(text)
|
||||
if data['type'] == 'DISCORD-RELAY-MESSAGE':
|
||||
msg = discord.utils.escape_mentions(data['content'])[0:2000]
|
||||
r = re.compile(r'\x1b(T|F|E|\(T@[^\)]*\))')
|
||||
msg = r.sub('', data['content'])
|
||||
if 'context' in data.keys():
|
||||
id = int(data['context'])
|
||||
user = await get_or_fetch_user(id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user