buzzk 1.6.0 โ 1.6.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 +24 -10
- package/lib/chat.js +3 -2
- package/lib/tool.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
## ๐ ์
๋ฐ์ดํธ ๋ด์ญ
|
|
19
|
+
|
|
20
|
+
- chat.getUserInfo ํจ์ ์ถ๊ฐ
|
|
21
|
+
|
|
22
|
+
>
|
|
19
23
|
|
|
20
24
|
- ๋ฐฉ์ก ์์ ์ onMessage ํจ์๊ฐ ์๋ํ์ง ์๋ ๋ฌธ์ ์์
|
|
21
25
|
|
|
@@ -28,15 +32,7 @@
|
|
|
28
32
|
- ์ฑํ
์ฐฝ ์ฐ๊ฒฐ์ด ๋๊ธฐ๋ ๋ฌธ์ ํด๊ฒฐ (Ping ์ถ๊ฐ)
|
|
29
33
|
- ์ฑํ
์ฐฝ ID ๋ณ๊ฒฝ ์ ์ฌ์ฐ๊ฒฐ ๊ตฌํ
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- onDisconnect ํจ์ ์ถ๊ฐ
|
|
34
|
-
- ์ฑํ
์ ์ฐ๊ฒฐํ์ง ๋ชปํ๋ ๋ฌธ์ ํด๊ฒฐ (UID๋ฅผ ์ ๊ฑธ๋ก ํด๋จ๋... ๋น๊ตฌ...)
|
|
35
|
-
- ํจ์ ์ด๋ฆ ์์
|
|
36
|
-
|
|
37
|
-
**ํ๋จ์ 1.3.0 ๋ง์ด๊ทธ๋ ์ด์
๊ฐ์ด๋ ์ฐธ๊ณ **
|
|
38
|
-
|
|
39
|
-
## โ๏ธ ๋ง์ด๊ทธ๋ ์ด์
๊ฐ์ด๋ (v.1.3.0)
|
|
35
|
+
## โ๏ธ ๋ง์ด๊ทธ๋ ์ด์
๊ฐ์ด๋ (v.1.2.x -> v.1.3.0)
|
|
40
36
|
|
|
41
37
|
<details>
|
|
42
38
|
<summary>ํผ์ณ๋ณด๊ธฐ</summary>
|
|
@@ -131,6 +127,10 @@
|
|
|
131
127
|
|
|
132
128
|
if (data[o].message === "!ping") await chat.send("pong!");
|
|
133
129
|
//์ฑํ
๋ณด๋ด๊ธฐ (login ํ์๋ง ๊ฐ๋ฅ)
|
|
130
|
+
|
|
131
|
+
let userInfo = await chat.getUserInfo(data[o].author.id);
|
|
132
|
+
console.log(userInfo);
|
|
133
|
+
//์ฑํ
๋ณด๋ธ ์ ์ ์ ์ ๋ณด
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
|
|
@@ -311,6 +311,20 @@ dotenv์ ํจ๊ป ์ฌ์ฉํ๋ ๊ฒ์ ๋งค์ฐ ๊ถ์ฅํฉ๋๋ค.
|
|
|
311
311
|
|
|
312
312
|
await chat.send("ใ
ใ
ใ
ใ
ใ
ใ
"); //์ฑํ
๋ณด๋ด๊ธฐ (login ํ์๋ง ๊ฐ๋ฅ)
|
|
313
313
|
|
|
314
|
-
>
|
|
314
|
+
>
|
|
315
|
+
|
|
316
|
+
let userInfo = await chat.getUserInfo("์ ์ ์ channelID ๊ฐ");
|
|
317
|
+
|
|
318
|
+
<details>
|
|
319
|
+
<summary>return</summary>
|
|
320
|
+
|
|
321
|
+
- Return
|
|
322
|
+
- channelID
|
|
323
|
+
- name
|
|
324
|
+
- imageURL
|
|
325
|
+
- role //ex. streamer
|
|
326
|
+
- followDate //ํ๋ก์ฐ ๋ ์ง ex. 2024-02-19 23:28:11
|
|
327
|
+
|
|
328
|
+
</details>
|
|
315
329
|
|
|
316
330
|
await chat.disconnect(); //์ฑํ
์ฐฝ ์ฐ๊ฒฐ ๋๊ธฐ
|
package/lib/chat.js
CHANGED
|
@@ -36,6 +36,7 @@ class chzzkChat {
|
|
|
36
36
|
|
|
37
37
|
//Get ChatID
|
|
38
38
|
let cidRes = await getStatus(this.channelID);
|
|
39
|
+
if (!cidRes) return resolve(null);
|
|
39
40
|
this.#chatID = cidRes.chatID;
|
|
40
41
|
//Get ChatID
|
|
41
42
|
|
|
@@ -348,7 +349,7 @@ class chzzkChat {
|
|
|
348
349
|
|
|
349
350
|
//Get ChatID
|
|
350
351
|
let cidRes = await getStatus(this.channelID);
|
|
351
|
-
if (cidRes.chatID && cidRes.chatID != this.#chatID) {
|
|
352
|
+
if (cidRes && cidRes.chatID && cidRes.chatID != this.#chatID) {
|
|
352
353
|
this.#chatID = cidRes.chatID;
|
|
353
354
|
|
|
354
355
|
//Reconnect
|
|
@@ -364,7 +365,7 @@ class chzzkChat {
|
|
|
364
365
|
//Get ChatID
|
|
365
366
|
|
|
366
367
|
let interval;
|
|
367
|
-
if (cidRes.polling && cidRes.polling.callPeriodMilliSecond) interval = cidRes.polling.callPeriodMilliSecond;
|
|
368
|
+
if (cidRes && cidRes.polling && cidRes.polling.callPeriodMilliSecond) interval = cidRes.polling.callPeriodMilliSecond;
|
|
368
369
|
else interval = 10000;
|
|
369
370
|
|
|
370
371
|
setTimeout(() => {
|
package/lib/tool.js
CHANGED
|
@@ -10,7 +10,7 @@ function reqChzzk (path) {
|
|
|
10
10
|
}
|
|
11
11
|
})
|
|
12
12
|
|
|
13
|
-
.then((response) => resolve(response.json()));
|
|
13
|
+
.then((response) => resolve(response.json())).catch((error) => resolve({"code": 500}));
|
|
14
14
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
@@ -25,7 +25,7 @@ function exChzzk (method, path) {
|
|
|
25
25
|
}
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
.then((response) => resolve(response.json()));
|
|
28
|
+
.then((response) => resolve(response.json())).catch((error) => resolve({"code": 500}));
|
|
29
29
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -40,7 +40,7 @@ function reqGame (path) {
|
|
|
40
40
|
}
|
|
41
41
|
})
|
|
42
42
|
|
|
43
|
-
.then((response) => resolve(response.json()));
|
|
43
|
+
.then((response) => resolve(response.json())).catch((error) => resolve({"code": 500}));
|
|
44
44
|
|
|
45
45
|
});
|
|
46
46
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buzzk",
|
|
3
3
|
"displayName": "BUZZK",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.2",
|
|
5
5
|
"description": "๋ฟ์ง์ง (BUZZK) - ์น์ง์ง(CHZZK) ์ฑ๋ด์ ๋์ฑ ์ฝ๊ฒ ๊ฐ๋ฐํ ์ ์๋๋ก ๋๋ ๋น๊ณต์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ.",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"type": "commonjs",
|