From e0fdd1513ccdcb00e2f90db74f19088f526d8acd Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Wed, 31 May 2023 01:18:47 +0300 Subject: [PATCH] #411 Fix Poe bot list loading --- poe-client.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/poe-client.js b/poe-client.js index 985ba16b9..2ffa5c8ab 100644 --- a/poe-client.js +++ b/poe-client.js @@ -318,14 +318,14 @@ class Client { if (!viewer.availableBots) { throw new Error('Invalid token.'); } - const botList = viewer.availableBots; + const botList = viewer.viewerBotList; const retries = 2; const bots = {}; for (const bot of botList.filter(x => x.deletionState == 'not_deleted')) { try { const url = `https://poe.com/_next/data/${this.next_data.buildId}/${bot.displayName}.json`; let r; - + if (this.use_cached_bots && cached_bots[url]) { r = cached_bots[url]; } @@ -334,7 +334,7 @@ class Client { r = await request_with_retries(() => this.session.get(url), retries); cached_bots[url] = r; } - + const chatData = r.data.pageProps.payload.chatOfBotDisplayName; bots[chatData.defaultBotObject.nickname] = chatData; } @@ -640,4 +640,4 @@ class Client { load_queries(); -module.exports = { Client }; \ No newline at end of file +module.exports = { Client };