fix it yes
This commit is contained in:
parent
86b10de944
commit
4a226b3073
1 changed files with 5 additions and 2 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue