buzzk 1.9.0 β 1.9.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/README.md +5 -1
- package/lib/chat.js +9 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
## π μ
λ°μ΄νΈ λ΄μ
|
|
19
19
|
|
|
20
|
+
- μ±ν
μ±λ μ°κ²°μ μ μ§νμ§ λͺ»νλ λ¬Έμ μλ²½ ν΄κ²°
|
|
21
|
+
|
|
22
|
+
>
|
|
23
|
+
|
|
20
24
|
- video ν¨μ μΆκ°
|
|
21
25
|
|
|
22
26
|
>
|
|
@@ -376,7 +380,7 @@ dotenvμ ν¨κ» μ¬μ©νλ κ²μ λ§€μ° κΆμ₯ν©λλ€.
|
|
|
376
380
|
|
|
377
381
|
### video
|
|
378
382
|
|
|
379
|
-
const videoList = await buzzk.video.getList("channelID κ°");
|
|
383
|
+
const videoList = await buzzk.video.getList("channelID κ°", 24); //channelID κ°, κ°μ Έμ¬ κ°―μ
|
|
380
384
|
console.log(videoList);
|
|
381
385
|
|
|
382
386
|
<details>
|
package/lib/chat.js
CHANGED
|
@@ -35,6 +35,14 @@ class chzzkChat {
|
|
|
35
35
|
if (myInfo.code != 200) return resolve(null);
|
|
36
36
|
this.#uid = myInfo.content.userIdHash;
|
|
37
37
|
|
|
38
|
+
//SetPolling
|
|
39
|
+
if (!this.#pollingStatus) {
|
|
40
|
+
setTimeout(async () => {
|
|
41
|
+
this.#polling();
|
|
42
|
+
}, 30000);
|
|
43
|
+
}
|
|
44
|
+
//SetPolling
|
|
45
|
+
|
|
38
46
|
//Get ChatID
|
|
39
47
|
let cidRes = await getStatus(this.channelID);
|
|
40
48
|
if (!cidRes) return resolve(null);
|
|
@@ -56,10 +64,6 @@ class chzzkChat {
|
|
|
56
64
|
this.#ws = new WebSocket("wss://kr-ss" + this.#ssID + ".chat.naver.com/chat");
|
|
57
65
|
//Connect Web Socket
|
|
58
66
|
|
|
59
|
-
//SetPolling
|
|
60
|
-
if (!this.#pollingStatus) this.#polling();
|
|
61
|
-
//SetPolling
|
|
62
|
-
|
|
63
67
|
//WS Open
|
|
64
68
|
this.#ws.on("open", () => {
|
|
65
69
|
console.log("[WS] Connected!");
|
|
@@ -194,8 +198,6 @@ class chzzkChat {
|
|
|
194
198
|
* @param {function(chzzkMessages)} callback
|
|
195
199
|
*/
|
|
196
200
|
onMessage(callback) {
|
|
197
|
-
if (!this.#ws) return callback(null);
|
|
198
|
-
|
|
199
201
|
this.#callbacks[Object.keys(this.#callbacks).length] = {
|
|
200
202
|
type: "message",
|
|
201
203
|
callback: callback
|
|
@@ -266,8 +268,6 @@ class chzzkChat {
|
|
|
266
268
|
}
|
|
267
269
|
|
|
268
270
|
onDonation(callback) {
|
|
269
|
-
if (!this.#ws) return callback(null);
|
|
270
|
-
|
|
271
271
|
this.#callbacks[Object.keys(this.#callbacks).length] = {
|
|
272
272
|
type: "donation",
|
|
273
273
|
callback: callback
|
|
@@ -473,7 +473,7 @@ class chzzkChat {
|
|
|
473
473
|
}
|
|
474
474
|
|
|
475
475
|
async #polling () {
|
|
476
|
-
if (!this.#ws) return this.#pollingStatus = false;
|
|
476
|
+
//if (!this.#ws) return this.#pollingStatus = false;
|
|
477
477
|
this.#pollingStatus = true;
|
|
478
478
|
|
|
479
479
|
//Get ChatID
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buzzk",
|
|
3
3
|
"displayName": "BUZZK",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.2",
|
|
5
5
|
"description": "λΏμ§μ§ (BUZZK) - μΉμ§μ§(CHZZK) μ±λ΄μ λμ± μ½κ² κ°λ°ν μ μλλ‘ λλ λΉκ³΅μ λΌμ΄λΈλ¬λ¦¬.",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"type": "commonjs",
|