Use only emoji as sticker body if unicodedata doesn't find name. Fixes #252

This commit is contained in:
Tulir Asokan
2018-12-20 00:08:44 +02:00
parent 85dc424ea0
commit 082ef79346
+4 -1
View File
@@ -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 = {