buzzk 1.3.1 → 1.3.3
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/README.md +4 -0
- package/lib/chat.js +14 -1
- package/lib/live.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/chat.js
CHANGED
|
@@ -13,6 +13,7 @@ class chzzkChat {
|
|
|
13
13
|
#ssID; //kr-ss?.chat.naver.com/chat
|
|
14
14
|
#accTkn; //Account Access Token
|
|
15
15
|
#svcid; //game
|
|
16
|
+
#uid;
|
|
16
17
|
#sid;
|
|
17
18
|
#chatID;
|
|
18
19
|
|
|
@@ -26,6 +27,11 @@ class chzzkChat {
|
|
|
26
27
|
return new Promise(async (resolve, reject) => {
|
|
27
28
|
if (this.#ws) return resolve(null);
|
|
28
29
|
|
|
30
|
+
//Get UID
|
|
31
|
+
let myInfo = await reqGame("nng_main/v1/user/getUserStatus");
|
|
32
|
+
if (myInfo.code != 200) return resolve(null);
|
|
33
|
+
this.#uid = myInfo.content.userIdHash;
|
|
34
|
+
|
|
29
35
|
//Get ChatID
|
|
30
36
|
let cidRes = await getStatus(this.channelID);
|
|
31
37
|
this.#chatID = cidRes.chatID;
|
|
@@ -60,7 +66,7 @@ class chzzkChat {
|
|
|
60
66
|
"svcid": "game",
|
|
61
67
|
"cid": this.#chatID,
|
|
62
68
|
"bdy": {
|
|
63
|
-
"uid":
|
|
69
|
+
"uid": this.#uid,
|
|
64
70
|
"devType":2001,
|
|
65
71
|
"accTkn": this.#accTkn,
|
|
66
72
|
"auth":"SEND"
|
|
@@ -233,6 +239,13 @@ class chzzkChat {
|
|
|
233
239
|
|
|
234
240
|
for (let o in data) {
|
|
235
241
|
data[o].profile = JSON.parse(data[o].profile);
|
|
242
|
+
|
|
243
|
+
if (!data[o].profile) {
|
|
244
|
+
data[o].profile = {
|
|
245
|
+
nickname: null,
|
|
246
|
+
profileImageUrl: null
|
|
247
|
+
}
|
|
248
|
+
}
|
|
236
249
|
|
|
237
250
|
msgList[Object.keys(msgList).length] = {
|
|
238
251
|
author: {
|
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 = {
|