Support for getting RT information (#279)

This commit is contained in:
Dylan
2025-04-29 00:06:54 +01:00
parent e64aa41ff6
commit 1d03bf80e7
5 changed files with 27 additions and 1 deletions

View File

@@ -359,6 +359,12 @@ def twitfix(sub_path):
if 'qrtURL' in tweetData and tweetData['qrtURL'] is not None:
qrt = getTweetData(tweetData['qrtURL'])
tweetData['qrt'] = qrt
retweet = None
if 'retweetURL' in tweetData and tweetData['retweetURL'] is not None:
retweet = getTweetData(tweetData['retweetURL'])
tweetData['retweet'] = retweet
tweetData = deepcopy(tweetData)
log.success("Tweet Data Get success")
if '?' in request.url:
@@ -473,6 +479,12 @@ def api_v1_status(tweet_id):
if 'qrtURL' in tweetData and tweetData['qrtURL'] is not None:
qrt = getTweetData(tweetData['qrtURL'])
tweetData['qrt'] = qrt
retweet = None
if 'retweetURL' in tweetData and tweetData['retweetURL'] is not None:
retweet = getTweetData(tweetData['retweetURL'])
tweetData['retweet'] = retweet
if tweetData is None:
abort(500) # this should cause Discord to fall back to the default embed
return activitymg.tweetDataToActivity(tweetData,embedIndex)