From 4a226b30731c80b9f751b887488cb81b3f36fb7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Tue, 6 Feb 2018 19:42:51 +0100 Subject: [PATCH] fix it yes --- delojza.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/delojza.py b/delojza.py index 5d6a6c0..b835991 100755 --- a/delojza.py +++ b/delojza.py @@ -87,10 +87,13 @@ def download_raw(url, filename, subdir, date): def get_first_hashtag(message): - hashtags = list(filter(lambda e: e.type == 'hashtag', list(message.entities + message.caption_entities))) + hashtags = list(map(message.parse_entity, + list(filter(lambda e: e.type == 'hashtag', message.entities)))) + hashtags += list(map(message.parse_caption_entity, + list(filter(lambda e: e.type == 'hashtag', message.caption_entities)))) if len(hashtags) == 0: return None - hashtag = message.parse_entity(hashtags[0]) + hashtag = hashtags[0] return hashtag[1:].upper()