Fixed a small issue referencing an user in the old way while retrieving all mentioned users in a tweet

This commit is contained in:
Manuel Cortez 2021-06-26 01:50:47 -05:00
parent e35f37fcc2
commit 2c75ea5005

View File

@ -101,7 +101,7 @@ def get_all_mentioned(tweet, conf, field="screen_name"):
""" Gets all users that have been mentioned."""
results = []
for i in tweet.entities["user_mentions"]:
if i["screen_name"] != conf["user_name"] and i["screen_name"] != tweet.user.screen_name:
if i["screen_name"] != conf["user_name"] and i["id_str"] != tweet.user:
if i.get(field) not in results:
results.append(i.get(field))
return results