buzzk 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chat.js +10 -3
- package/lib/live.js +1 -1
- package/package.json +1 -1
package/lib/chat.js
CHANGED
|
@@ -46,7 +46,7 @@ class chzzkChat {
|
|
|
46
46
|
//Connect Web Socket
|
|
47
47
|
|
|
48
48
|
//SetPolling
|
|
49
|
-
if (!this.#pollingStatus) this
|
|
49
|
+
if (!this.#pollingStatus) this.#polling();
|
|
50
50
|
//SetPolling
|
|
51
51
|
|
|
52
52
|
//WS Open
|
|
@@ -233,6 +233,13 @@ class chzzkChat {
|
|
|
233
233
|
|
|
234
234
|
for (let o in data) {
|
|
235
235
|
data[o].profile = JSON.parse(data[o].profile);
|
|
236
|
+
|
|
237
|
+
if (!data[o].profile) {
|
|
238
|
+
data[o].profile = {
|
|
239
|
+
nickname: null,
|
|
240
|
+
profileImageUrl: null
|
|
241
|
+
}
|
|
242
|
+
}
|
|
236
243
|
|
|
237
244
|
msgList[Object.keys(msgList).length] = {
|
|
238
245
|
author: {
|
|
@@ -266,7 +273,7 @@ class chzzkChat {
|
|
|
266
273
|
});
|
|
267
274
|
}
|
|
268
275
|
|
|
269
|
-
async polling () {
|
|
276
|
+
async #polling () {
|
|
270
277
|
if (!this.#ws) return this.#pollingStatus = false;
|
|
271
278
|
this.#pollingStatus = true;
|
|
272
279
|
|
|
@@ -276,7 +283,7 @@ class chzzkChat {
|
|
|
276
283
|
//Get ChatID
|
|
277
284
|
|
|
278
285
|
setTimeout(() => {
|
|
279
|
-
return this
|
|
286
|
+
return this.#polling();
|
|
280
287
|
}, cidRes.polling.callPeriodMilliSecond);
|
|
281
288
|
}
|
|
282
289
|
}
|
package/lib/live.js
CHANGED
|
@@ -35,7 +35,7 @@ async function getDetail (channelID) {
|
|
|
35
35
|
return new Promise(async (resolve, reject) => {
|
|
36
36
|
|
|
37
37
|
let res = await reqChzzk("service/v2/channels/" + channelID + "/live-detail");
|
|
38
|
-
if (res.code != 200) return resolve(null);
|
|
38
|
+
if (res.code != 200 || !res.content) return resolve(null);
|
|
39
39
|
res = res.content;
|
|
40
40
|
|
|
41
41
|
let lvDetail = {
|