diff options
| author | 2019-05-22 19:49:55 +0100 | |
|---|---|---|
| committer | 2019-05-22 19:49:55 +0100 | |
| commit | 000b264d6d768ddb1f80a9ce55a5a33c2c9ea2e9 (patch) | |
| tree | 9dda4242bc85fc67a256ebc8618c4b96f785d087 /modules | |
| parent | Implement auto-tweet setting to get tweet info automatically (diff) | |
| signature | ||
move `api` def to the only context that uses it, rename `twitter_object` var
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/tweets.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/tweets.py b/modules/tweets.py index 784311fb..3c6fc161 100644 --- a/modules/tweets.py +++ b/modules/tweets.py @@ -79,7 +79,6 @@ class Module(ModuleManager.BaseModule): if target: target = target.message if target: - api = self._get_api() url_match = re.search(REGEX_TWITTERURL, target) if url_match or target.isdigit(): tweet_id = url_match.group(1) if url_match else target @@ -87,8 +86,9 @@ class Module(ModuleManager.BaseModule): else: if target.startswith("@"): target = target[1:] + api = self._get_api() try: - tweet = twitter_object.statuses.user_timeline( + tweet = api.statuses.user_timeline( screen_name=target, count=1)[0] except: traceback.print_exc() |
