From 5838afffeea515bfd4af414d295d13a790c4c1c4 Mon Sep 17 00:00:00 2001 From: git-bruh Date: Tue, 12 Jan 2021 10:28:10 +0530 Subject: [PATCH] Send larger emojis if no other content in message --- main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index c0b358a..6007423 100644 --- a/main.py +++ b/main.py @@ -113,6 +113,12 @@ 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)): @@ -128,8 +134,8 @@ class MatrixClient(nio.AsyncClient): if emote_: emote = f":{emote}:" body = body.replace( - emote, f"""\"{emote}\"""" + emote, f"""\"{emote}\"""" ) return body