This reverts commit 5838afffee.
This commit is contained in:
git-bruh 2021-01-12 17:20:27 +05:30
parent 5838afffee
commit e8482b8d3e
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

10
main.py
View file

@ -113,12 +113,6 @@ class MatrixClient(nio.AsyncClient):
return resp.content_uri
async def get_fmt_body(self, body, emotes):
# Send larger emojis if there is no other content in message
if len(body.split("]")[1].split()) == 1:
emote_size = "64"
else:
emote_size = "32"
# Markdown code blocks
replace = "```"
for i in range(body.count(replace)):
@ -134,8 +128,8 @@ class MatrixClient(nio.AsyncClient):
if emote_:
emote = f":{emote}:"
body = body.replace(
emote, f"""<img alt=\"{emote}\" title=\"{emote}\" \
height=\"{emote_size}\" src=\"{emote_}\" data-mx-emoticon />"""
emote, f"""<img alt=\"{emote}\" title=\"{emote}\"
height=\"32\" src=\"{emote_}\" data-mx-emoticon />"""
)
return body