made images not required for successful TalentTweet post
This commit is contained in:
+6
-2
@@ -229,14 +229,18 @@ class TwAPI:
|
|||||||
twt_resp = await self.post_tweet(text)
|
twt_resp = await self.post_tweet(text)
|
||||||
print('done')
|
print('done')
|
||||||
twt_id = twt_resp.data['id']
|
twt_id = twt_resp.data['id']
|
||||||
print('creating reply img...', end='')
|
|
||||||
media_ids = [await self.get_ttweet_image_media_id(ttweet)]
|
|
||||||
# if ttweet.reply_to is not None:
|
# if ttweet.reply_to is not None:
|
||||||
# re_ttweet = tt.TalentTweet(tweet_id=ttweet.reply_to, author_id=)
|
# re_ttweet = tt.TalentTweet(tweet_id=ttweet.reply_to, author_id=)
|
||||||
# media_ids.insert(0, await self.get_ttweet_image_media_id())
|
# media_ids.insert(0, await self.get_ttweet_image_media_id())
|
||||||
|
|
||||||
|
try:
|
||||||
|
print('creating reply img...', end='')
|
||||||
|
media_ids = [await self.get_ttweet_image_media_id(ttweet)]
|
||||||
print('posting reply tweet...', end='')
|
print('posting reply tweet...', end='')
|
||||||
await self.post_tweet(reply_to_tweet=twt_id, media_ids=media_ids,)
|
await self.post_tweet(reply_to_tweet=twt_id, media_ids=media_ids,)
|
||||||
print('done')
|
print('done')
|
||||||
|
except:
|
||||||
|
print('Had trouble posting reply image tweet.')
|
||||||
print('successfully posted ttweet!')
|
print('successfully posted ttweet!')
|
||||||
return True
|
return True
|
||||||
except tweepy.Forbidden as e:
|
except tweepy.Forbidden as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user