Fixed reply to single user in tweets with multiple users

This commit is contained in:
2016-10-04 03:37:12 -05:00
parent 378d277a98
commit 6f5ef6d3f1
3 changed files with 7 additions and 5 deletions

View File

@@ -69,10 +69,10 @@ def is_geocoded(tweet):
def get_all_mentioned(tweet, conf):
""" Gets all users that has been mentioned."""
string = []
for i in tweet["entities"]["user_mentions"]:
for i in tweet["entities"]["user_mentions"][1:]:
if i["screen_name"] != conf["user_name"] and i["screen_name"] != tweet["user"]["screen_name"]:
if "@"+i["screen_name"] not in string:
string.append("@"+i["screen_name"])
if i["id"] not in string:
string.append(i["id_str"])
return " ".join(string)+" "
def get_all_users(tweet, conf):