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 CHANGED
@@ -21,6 +21,10 @@
21
21
 
22
22
  **하단의 1.3.0 마이그레이션 가이드 참고**
23
23
 
24
+ >
25
+
26
+ - 채팅에 연결하지 못했던 문제 해결 (UID를 제걸로 해놨던... 빙구...)
27
+
24
28
  >
25
29
 
26
30
  - channelID로 채널 정보 가져오기 함수 추가
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":"7d98a20c25251e404ca61d0981bb1ab9",
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 = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "buzzk",
3
3
  "displayName": "BUZZK",
4
- "version": "1.3.1",
4
+ "version": "1.3.3",
5
5
  "description": "뿌지직 (BUZZK) - 치지직(CHZZK) 챗봇을 더욱 쉽게 개발할 수 있도록 돕는 비공식 라이브러리.",
6
6
  "main": "lib/index.js",
7
7
  "type": "commonjs",