fix it yes
This commit is contained in:
parent
669ec2aad1
commit
231faf0cd5
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):
|
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:
|
if len(hashtags) == 0:
|
||||||
return None
|
return None
|
||||||
hashtag = message.parse_entity(hashtags[0])
|
hashtag = hashtags[0]
|
||||||
return hashtag[1:].upper()
|
return hashtag[1:].upper()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue