buzzk 1.8.1 โ 1.8.4
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 +9 -9
- package/lib/chat.js +8 -6
- package/lib/live.js +33 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,14 @@
|
|
|
17
17
|
|
|
18
18
|
## ๐ ์
๋ฐ์ดํธ ๋ด์ญ
|
|
19
19
|
|
|
20
|
+
- ์ฑํ
์ฑ๋ ์ฐ๊ฒฐ์ ์ ์งํ์ง ๋ชปํ๋ ๋ฌธ์ ํด๊ฒฐ
|
|
21
|
+
|
|
22
|
+
>
|
|
23
|
+
|
|
24
|
+
- ์ฑํ
์ฑ๋์ด ์์ ๋ ์ค๋ฅ๊ฐ ์๊ธฐ๋ ๋ฌธ์ ํด๊ฒฐ
|
|
25
|
+
|
|
26
|
+
>
|
|
27
|
+
|
|
20
28
|
- onDonation ํจ์ ์ถ๊ฐ
|
|
21
29
|
|
|
22
30
|
- ๋ณธ์ธ ์ธ์ฆ ์ฑํ
์ง์ ์ถ๊ฐ
|
|
@@ -37,14 +45,6 @@
|
|
|
37
45
|
|
|
38
46
|
- chat ์ ๋ฉ์ธ์ง๋ฅผ ํธ๋ค๋งํ๋ ์ค ์๋์น ์๊ฒ ์ค๋ฅ๊ฐ ๋๋ ๋ฌธ์ ํด๊ฒฐ
|
|
39
47
|
|
|
40
|
-
>
|
|
41
|
-
|
|
42
|
-
- WebSocket is not open ๋ฌธ์ ํด๊ฒฐ
|
|
43
|
-
|
|
44
|
-
>
|
|
45
|
-
|
|
46
|
-
- chat.getUserInfo ํจ์ ์ถ๊ฐ
|
|
47
|
-
|
|
48
48
|
## โ๏ธ ๋ง์ด๊ทธ๋ ์ด์
๊ฐ์ด๋ (v.1.2.x -> v.1.3.0)
|
|
49
49
|
|
|
50
50
|
<details>
|
|
@@ -322,7 +322,7 @@ dotenv์ ํจ๊ป ์ฌ์ฉํ๋ ๊ฒ์ ๋งค์ฐ ๊ถ์ฅํฉ๋๋ค.
|
|
|
322
322
|
console.log(data);
|
|
323
323
|
|
|
324
324
|
for (let o in data) {
|
|
325
|
-
console.log(data[o].amount);
|
|
325
|
+
console.log(data[o].amount); //ํ์ ๊ธ์ก๋ง ์ ๋ถ ๊บผ๋ด๊ธฐ
|
|
326
326
|
}
|
|
327
327
|
});
|
|
328
328
|
|
package/lib/chat.js
CHANGED
|
@@ -484,19 +484,21 @@ class chzzkChat {
|
|
|
484
484
|
//Reconnect
|
|
485
485
|
this.#pollingStatus = false;
|
|
486
486
|
await this.disconnect();
|
|
487
|
-
await this.connect();
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
487
|
+
let connectRes = await this.connect();
|
|
488
|
+
if (connectRes) {
|
|
489
|
+
for (let o in this.#callbacks) {
|
|
490
|
+
if (this.#callbacks[o].type === "message") this.#onMessageHandler(this.#callbacks[o].callback);
|
|
491
|
+
else if (this.#callbacks[o].type === "donation") this.#onDonationHandler(this.#callbacks[o].callback);
|
|
492
|
+
}
|
|
493
|
+
return;
|
|
491
494
|
}
|
|
492
|
-
return;
|
|
493
495
|
//Reconnect
|
|
494
496
|
}
|
|
495
497
|
//Get ChatID
|
|
496
498
|
|
|
497
499
|
let interval;
|
|
498
500
|
if (cidRes && cidRes.polling && cidRes.polling.callPeriodMilliSecond) interval = cidRes.polling.callPeriodMilliSecond;
|
|
499
|
-
else interval =
|
|
501
|
+
else interval = 30000;
|
|
500
502
|
|
|
501
503
|
setTimeout(() => {
|
|
502
504
|
return this.#polling();
|
package/lib/live.js
CHANGED
|
@@ -39,21 +39,27 @@ async function getDetail (channelID) {
|
|
|
39
39
|
if (res.code != 200 || !res.content) return resolve(null);
|
|
40
40
|
res = res.content;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
try {
|
|
43
|
+
let lvDetail = {
|
|
44
|
+
channelID: res.channel.channelId,
|
|
45
|
+
channel: { name: res.channel.channelName, imageURL: res.channel.channelImageUrl },
|
|
46
|
+
chatID: res.chatChannelId,
|
|
47
|
+
chatLimit: res.chatAvailableGroup,
|
|
48
|
+
userCount: { now: res.concurrentUserCount, total: res.accumulateCount },
|
|
49
|
+
title: res.liveTitle,
|
|
50
|
+
category: res.liveCategoryValue,
|
|
51
|
+
startOn: res.openDate,
|
|
52
|
+
closeOn: res.closeDate,
|
|
53
|
+
status: res.status,
|
|
54
|
+
polling: JSON.parse(res.livePollingStatusJson)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return resolve(lvDetail);
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
|
|
60
|
+
catch(error) {
|
|
61
|
+
return resolve(null);
|
|
62
|
+
}
|
|
57
63
|
|
|
58
64
|
});
|
|
59
65
|
}
|
|
@@ -80,16 +86,22 @@ async function getStatus (channelID) {
|
|
|
80
86
|
if (res.code != 200) return resolve(null);
|
|
81
87
|
res = res.content;
|
|
82
88
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
try {
|
|
90
|
+
let lvStatus = {
|
|
91
|
+
channelID: channelID,
|
|
92
|
+
chatID: res.chatChannelId,
|
|
93
|
+
userCount: { now: res.concurrentUserCount, total: res.accumulateCount },
|
|
94
|
+
title: res.liveTitle,
|
|
95
|
+
status: res.status,
|
|
96
|
+
polling: JSON.parse(res.livePollingStatusJson)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return resolve(lvStatus);
|
|
90
100
|
}
|
|
91
101
|
|
|
92
|
-
|
|
102
|
+
catch(error) {
|
|
103
|
+
return resolve(null);
|
|
104
|
+
}
|
|
93
105
|
|
|
94
106
|
});
|
|
95
107
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buzzk",
|
|
3
3
|
"displayName": "BUZZK",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.4",
|
|
5
5
|
"description": "๋ฟ์ง์ง (BUZZK) - ์น์ง์ง(CHZZK) ์ฑ๋ด์ ๋์ฑ ์ฝ๊ฒ ๊ฐ๋ฐํ ์ ์๋๋ก ๋๋ ๋น๊ณต์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ.",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"type": "commonjs",
|