Merge pull request #738 from BlueprintCoding/patch-2

Update poe-client.js
This commit is contained in:
RossAscends
2023-07-19 14:23:37 +09:00
committed by GitHub

View File

@@ -381,6 +381,7 @@ class Client {
await this.connect_ws();
console.log('Client initialized.');
}
get_device_id() {
const user_id = this.viewer["poeUser"]["id"];
@@ -397,7 +398,7 @@ class Client {
const botNameKeyName = 'chatOfBotHandle'
const defaultBotKeyName = 'defaultBotNickname'
const r = await request_with_retries(() => this.session.get(this.home_url));
const r = await request_with_retries(() => this.session.post(this.home_url));
const jsonRegex = /<script id="__NEXT_DATA__" type="application\/json">(.+?)<\/script>/;
const jsonText = jsonRegex.exec(r.data)[1];
const nextData = JSON.parse(jsonText);