FixTweet / FxTwitter

Fix broken Twitter/X embeds! Use multiple images, videos, polls, translations and more on Discord, Telegram and others
https://fxtwitter.com
MIT License
2.62k stars 77 forks source link

Tweets starting with username are marked as replies #887

Closed baatochan closed 1 week ago

baatochan commented 3 months ago

Hi, sorry if this is by design, but it broke my script recently. So the tweet in question is that: https://x.com/GoldenDragon166/status/1811460230804291908 The API response is:

{
    "url": "https://twitter.com/GoldenDragon166/status/1811460230804291908",
    "id": "1811460230804291908",
    "text": "@ElekKartofelek jako pokemon?!\n Reszt\u0119 za\u0142ogi si\u0119 robi \ud83e\udee1 ( wolmo )",
    "author": {(...)},
    "replies": 6,
    "retweets": 43,
    "likes": 670,
    "created_at": "Thu Jul 11 17:59:08 +0000 2024",
    "created_timestamp": 1720720748,
    "possibly_sensitive": false,
    "views": 4967,
    "is_note_tweet": false,
    "community_note": null,
    "lang": "pl",
    "replying_to": "ElekKartofelek",
    "replying_to_status": null,
    "media": {(...)},
    "source": "Twitter Web App",
    "twitter_card": "summary_large_image",
    "color": null
}

As you may notice the field replying_to is set to the username that is mentioned at the start of the post, but the replying_to_status is null as it is not a comment, but the standalone tweet. If this behavior is by design then sorry for wasting your time and just close my issue, but I feel like it is an edge-case that should not happen.

dangeredwolf commented 1 week ago

This is pulled directly from the Twitter API, so no plans to change it https://github.com/FixTweet/FxTwitter/blob/main/src/providers/twitter/processor.ts#L153