Fix Poe client

This commit is contained in:
Cohee
2023-07-03 19:18:42 +03:00
parent 9e3c55805f
commit 6be18e4212

View File

@@ -81,7 +81,7 @@ function extractFormKey(html) {
} }
const formKey = formKeyList.join(""); 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 //these keys are used as of June 29, 2023
//if API changes in the future, just change these to find the new path //if API changes in the future, just change these to find the new path
const viewerKeyName = 'viewer' const viewerKeyName = 'viewer'
const botNameKeyName = 'chatOfBotDisplayName' const botNameKeyName = 'chatOfBotHandle'
const defaultBotKeyName = 'defaultBotNickname' const defaultBotKeyName = 'defaultBotNickname'
const r = await request_with_retries(() => this.session.get(this.home_url)); const r = await request_with_retries(() => this.session.get(this.home_url));
@@ -476,7 +476,7 @@ class Client {
cached_bots[url] = r; 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; bots[chatData.defaultBotObject.nickname] = chatData;
resolve(); resolve();