From 1e1f2b089f6b05a571b11ff2b2e79346c95975c6 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Mon, 4 Jan 2021 12:23:04 -0600 Subject: [PATCH] Fix call to api.supported_languages() --- src/sessions/twitter/session.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sessions/twitter/session.py b/src/sessions/twitter/session.py index 78f79736..9e106405 100644 --- a/src/sessions/twitter/session.py +++ b/src/sessions/twitter/session.py @@ -273,7 +273,7 @@ class Session(base.baseSession): # Get twitter's supported languages and save them in a global variable #so we won't call to this method once per session. if len(application.supported_languages) == 0: - application.supported_languages = self.twitter.supported_languages + application.supported_languages = self.twitter.supported_languages() self.get_lists() self.get_muted_users() self.settings.write() @@ -389,18 +389,18 @@ class Session(base.baseSession): tweet.quoted_status.message = message if tweet.quoted_status.message == False: return False tweet.quoted_status.twishort = True - for i in tweet.quoted_status.entities.user_mentions: - if "@%s" % (i.screen_name) not in tweet.quoted_status.message and i.screen_name != tweet.user.screen_name: - if hasattr(tweet["quoted_status"], "retweeted_status") and tweet.retweeted_status.user.screen_name == i.screen_name: + for i in tweet.quoted_status.entities["user_mentions"]: + if "@%s" % (i["screen_name"]) not in tweet.quoted_status.message and i["screen_name"] != tweet.user.screen_name: + if hasattr(tweet["quoted_status"], "retweeted_status") and tweet.retweeted_status.user.screen_name == i["screen_name"]: continue - tweet.quoted_status.message = u"@%s %s" % (i.screen_name, tweet.message) + tweet.quoted_status.message = u"@%s %s" % (i["screen_name"], tweet.message) else: tweet.message = message if tweet.message == False: return False tweet.twishort = True - for i in tweet.entities.user_mentions: - if "@%s" % (i.screen_name) not in tweet.message and i.screen_name != tweet.user.screen_name: - if hasattr(tweet, "retweeted_status") and tweet.retweeted_status.user.screen_name == i.screen_name: + for i in tweet.entities["user_mentions"]: + if "@%s" % (i["screen_name"]) not in tweet.message and i["screen_name"] != tweet.user.screen_name: + if hasattr(tweet, "retweeted_status") and tweet.retweeted_status.user.screen_name == i["screen_name"]: continue return tweet