fix(route/twitter): handle timeline_v2 nested structure (#19428)

Co-authored-by: NekoAria <NekoAria@users.noreply.github.com>
This commit is contained in:
Neko Aria
2025-06-23 01:18:01 +08:00
committed by GitHub
co-authored by NekoAria
parent 8abc00fe2e
commit d6ea75914f
+3 -1
View File
@@ -248,7 +248,9 @@ export const paginationTweets = async (endpoint: string, userId: number | undefi
return instructions.instructions;
}
const instructions = data?.user?.result?.timeline?.timeline?.instructions || data?.user?.result?.timeline?.timeline_v2?.instructions;
const userResult = data?.user?.result;
const timeline = userResult?.timeline?.timeline || userResult?.timeline?.timeline_v2 || userResult?.timeline_v2?.timeline;
const instructions = timeline?.instructions;
if (!instructions) {
logger.debug(`twitter debug: instructions not found in data: ${JSON.stringify(data)}`);
}