From 466bcd8833cbc455e515a303faf4e88a0c5ab493 Mon Sep 17 00:00:00 2001 From: RossAscends <124905043+RossAscends@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:38:01 +0900 Subject: [PATCH] attempt fix defaultbot detection --- src/poe-client.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/poe-client.js b/src/poe-client.js index f67f6bd64..f24972ef6 100644 --- a/src/poe-client.js +++ b/src/poe-client.js @@ -405,7 +405,8 @@ class Client { const viewerPath = findKey(nextData, viewerKeyName); const botNamePath = findKey(nextData, botNameKeyName); const defaultBotPath = findKey(nextData, defaultBotKeyName); - console.log(`DefaultBot found at: ${defaultBotPath.join('.')}`) + + let viewer = null; if (viewerPath) { @@ -426,6 +427,13 @@ class Client { //console.log(logObjectStructure(nextData, 0, 2)); } + if (defaultBotPath) { + console.log(`'${defaultBotKeyName}' key: ${defaultBotPath.join('.')}`); + } else { + console.log(`ERROR: '${defaultBotKeyName}' key not found.`); + //console.log(logObjectStructure(nextData, 0, 2)); + } + this.formkey = extractFormKey(r.data); this.viewer = viewer;