also check caption entities

This commit is contained in:
Tomáš Mládek 2018-02-06 19:30:58 +01:00
parent 0f9f99fff0
commit 47fefacffc

View file

@ -87,7 +87,7 @@ def download_raw(url, filename, subdir, date):
def get_first_hashtag(message):
hashtags = list(filter(lambda e: e.type == 'hashtag', message.entities))
hashtags = list(filter(lambda e: e.type == 'hashtag', message.entities + message.caption_entities))
if len(hashtags) == 0:
return None
hashtag = message.parse_entity(hashtags[0])