buzzk 1.8.0 β 1.8.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 +34 -0
- package/lib/chat.js +0 -1
- package/lib/live.js +33 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
|
|
18
18
|
## π μ
λ°μ΄νΈ λ΄μ
|
|
19
19
|
|
|
20
|
+
- μ±ν
μ±λμ΄ μμ λ μ€λ₯κ° μκΈ°λ λ¬Έμ ν΄κ²°
|
|
21
|
+
|
|
22
|
+
>
|
|
23
|
+
|
|
24
|
+
- onDonation ν¨μ μΆκ°
|
|
25
|
+
|
|
20
26
|
- λ³ΈμΈ μΈμ¦ μ±ν
μ§μ μΆκ°
|
|
21
27
|
|
|
22
28
|
>
|
|
@@ -314,6 +320,34 @@ dotenvμ ν¨κ» μ¬μ©νλ κ²μ λ§€μ° κΆμ₯ν©λλ€.
|
|
|
314
320
|
- 3
|
|
315
321
|
- ...
|
|
316
322
|
|
|
323
|
+
</details>
|
|
324
|
+
|
|
325
|
+
chat.onDonation((data) => { //λλ€μ΄μ
μ΄ μμ λ
|
|
326
|
+
console.log(data);
|
|
327
|
+
|
|
328
|
+
for (let o in data) {
|
|
329
|
+
console.log(data[o].amount); //νμ κΈμ‘λ§ μ λΆ κΊΌλ΄κΈ°
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
<details>
|
|
334
|
+
<summary>callback</summary>
|
|
335
|
+
|
|
336
|
+
- Return
|
|
337
|
+
- 0
|
|
338
|
+
- amount //νμ κΈμ‘
|
|
339
|
+
- author
|
|
340
|
+
- id
|
|
341
|
+
- name
|
|
342
|
+
- imageURL
|
|
343
|
+
- hasMod //κ΄λ¦¬ κΆνμ κ°μ‘λμ§ (false / true)
|
|
344
|
+
- message
|
|
345
|
+
- time
|
|
346
|
+
- 1
|
|
347
|
+
- 2
|
|
348
|
+
- 3
|
|
349
|
+
- ...
|
|
350
|
+
|
|
317
351
|
</details>
|
|
318
352
|
|
|
319
353
|
chat.onDisconnect(() => { //μ±ν
μ°½ μ°κ²°μ΄ λκ²Όμ λ
|
package/lib/chat.js
CHANGED
|
@@ -44,7 +44,6 @@ class chzzkChat {
|
|
|
44
44
|
//Get accTkn
|
|
45
45
|
let accRes = await reqGame("nng_main/v1/chats/access-token?channelId=" + this.#chatID + "&chatType=STREAMING");
|
|
46
46
|
if (accRes.code != 200) return resolve(null);
|
|
47
|
-
console.log(accRes);
|
|
48
47
|
this.#accTkn = accRes.content.accessToken;
|
|
49
48
|
this.#extTkn = accRes.content.extraToken;
|
|
50
49
|
//Get accTkn
|
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;
|
|
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;
|
|
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.2",
|
|
5
5
|
"description": "λΏμ§μ§ (BUZZK) - μΉμ§μ§(CHZZK) μ±λ΄μ λμ± μ½κ² κ°λ°ν μ μλλ‘ λλ λΉκ³΅μ λΌμ΄λΈλ¬λ¦¬.",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"type": "commonjs",
|