From 6be18e4212e80d01fc905b3e5ea49a6a0a024960 Mon Sep 17 00:00:00 2001 From: Cohee Date: Mon, 3 Jul 2023 19:18:42 +0300 Subject: [PATCH] Fix Poe client --- src/poe-client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/poe-client.js b/src/poe-client.js index 39167d963..4e0365ba9 100644 --- a/src/poe-client.js +++ b/src/poe-client.js @@ -81,7 +81,7 @@ function extractFormKey(html) { } const formKey = formKeyList.join(""); - return formKey; + return formKey.slice(0, -1); } @@ -394,7 +394,7 @@ class Client { //these keys are used as of June 29, 2023 //if API changes in the future, just change these to find the new path const viewerKeyName = 'viewer' - const botNameKeyName = 'chatOfBotDisplayName' + const botNameKeyName = 'chatOfBotHandle' const defaultBotKeyName = 'defaultBotNickname' const r = await request_with_retries(() => this.session.get(this.home_url)); @@ -476,7 +476,7 @@ class Client { cached_bots[url] = r; } - const chatData = r.data.pageProps.payload?.chatOfBotDisplayName || r.data.pageProps.data?.chatOfBotDisplayName; + const chatData = r.data.pageProps.payload?.chatOfBotDisplayName || r.data.pageProps.data?.chatOfBotHandle; bots[chatData.defaultBotObject.nickname] = chatData; resolve();