From 082ef7934646073dc125fe1a678227303aaf140b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 20 Dec 2018 00:08:44 +0200 Subject: [PATCH] Use only emoji as sticker body if unicodedata doesn't find name. Fixes #252 --- mautrix_telegram/portal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py index 4bbf8108..02a329bd 100644 --- a/mautrix_telegram/portal.py +++ b/mautrix_telegram/portal.py @@ -1307,7 +1307,10 @@ class Portal: if attrs["is_sticker"]: alt = attrs["sticker_alt"] if len(alt) > 0: - name = f"{alt} ({unicodedata.name(alt[0]).lower()})" + try: + name = f"{alt} ({unicodedata.name(alt[0]).lower()})" + except ValueError: + name = alt mime_type = document.mime_type or file.mime_type info = {