fix return in TwAPI.post_ttweet

This commit is contained in:
muskit
2023-01-14 02:13:03 -08:00
parent 8c7b11b850
commit b311cc0014
+1 -1
View File
@@ -267,13 +267,13 @@ class TwAPI:
except: except:
print('Had trouble posting reply image tweet.') print('Had trouble posting reply image tweet.')
print('successfully posted ttweet!') print('successfully posted ttweet!')
return True
except tweepy.Forbidden as e: except tweepy.Forbidden as e:
if 'duplicate content' in e.api_messages[0]: if 'duplicate content' in e.api_messages[0]:
print('Twitter says the TalentTweet is a duplicate; skipping error-free...') print('Twitter says the TalentTweet is a duplicate; skipping error-free...')
return False return False
else: else:
raise e raise e
return True
def post_ttweet_by_id(self, tweet_id, is_catchup=False, dry_run=False): def post_ttweet_by_id(self, tweet_id, is_catchup=False, dry_run=False):
ttweet = asyncio.run(tt.TalentTweet.create_from_id(tweet_id)) ttweet = asyncio.run(tt.TalentTweet.create_from_id(tweet_id))