Workaround for GraphQLTweet detector

This commit is contained in:
dangered wolf 2023-11-02 05:54:10 -04:00
parent 77bc8b2d33
commit ec24895ece
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58

View file

@ -16,7 +16,7 @@ export const isGraphQLTweet = (response: unknown): response is GraphQLTweet => {
return (
typeof response === 'object' &&
response !== null &&
'__typename' in response &&
(response.__typename === 'Tweet' || response.__typename === 'TweetWithVisibilityResults')
// @ts-expect-error it's 6 am please let me sleep
('__typename' in response && (response.__typename === 'Tweet' || response.__typename === 'TweetWithVisibilityResults') || ('legacy' in response && response.legacy?.full_text))
);
};