buzzk 1.7.0 β†’ 1.7.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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/lib/chat.js +11 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  ## πŸ“– μ—…λ°μ΄νŠΈ λ‚΄μ—­
19
19
 
20
- - μ±„νŒ… 데이터에 Role ν•­λͺ© μΆ”κ°€
20
+ - μ±„νŒ… 데이터에 hasMod ν•­λͺ© μΆ”κ°€
21
21
 
22
22
  >
23
23
 
@@ -275,7 +275,7 @@ dotenv와 ν•¨κ»˜ μ‚¬μš©ν•˜λŠ” 것을 맀우 ꢌμž₯ν•©λ‹ˆλ‹€.
275
275
  - id
276
276
  - name
277
277
  - imageURL
278
- - role
278
+ - hasMod //관리 κΆŒν•œμ„ κ°€μ‘ŒλŠ”μ§€ (false / true)
279
279
  - message
280
280
  - time
281
281
  - 1
@@ -302,7 +302,7 @@ dotenv와 ν•¨κ»˜ μ‚¬μš©ν•˜λŠ” 것을 맀우 ꢌμž₯ν•©λ‹ˆλ‹€.
302
302
  - id
303
303
  - name
304
304
  - imageURL
305
- - role
305
+ - hasMod //관리 κΆŒν•œμ„ κ°€μ‘ŒλŠ”μ§€ (false / true)
306
306
  - message
307
307
  - time
308
308
  - 1
package/lib/chat.js CHANGED
@@ -184,6 +184,7 @@ class chzzkChat {
184
184
  * @property {string} id
185
185
  * @property {string} name
186
186
  * @property {string} imageURL
187
+ * @property {boolean} hasMod
187
188
  */
188
189
 
189
190
  /**
@@ -227,17 +228,20 @@ class chzzkChat {
227
228
  data[o].profile = {
228
229
  nickname: null,
229
230
  profileImageUrl: null,
230
- role: null
231
+ userRoleCode: null
231
232
  };
232
233
  }
233
234
 
234
235
  try {
236
+ let modVal = false;
237
+ if (data[o].profile.userRoleCode === "streamer" || data[o].profile.userRoleCode === "streaming_channel_manager" || data[o].profile.userRoleCode === "streaming_chat_manager") modVal = true;
238
+
235
239
  msgList[Object.keys(msgList).length] = {
236
240
  author: {
237
241
  id: data[o].uid,
238
242
  name: data[o].profile.nickname,
239
243
  imageURL: data[o].profile.profileImageUrl,
240
- role: data[o].profile.userRoleCode
244
+ hasMod: modVal
241
245
  },
242
246
  message: data[o].msg,
243
247
  time: data[o].msgTime
@@ -314,16 +318,19 @@ class chzzkChat {
314
318
  data[o].profile = {
315
319
  nickname: null,
316
320
  profileImageUrl: null,
317
- role: null
321
+ userRoleCode: null
318
322
  }
319
323
  }
324
+
325
+ let modVal = false;
326
+ if (data[o].profile.userRoleCode === "streamer" || data[o].profile.userRoleCode === "streaming_channel_manager" || data[o].profile.userRoleCode === "streaming_chat_manager") modVal = true;
320
327
 
321
328
  msgList[Object.keys(msgList).length] = {
322
329
  author: {
323
330
  id: data[o].userId,
324
331
  name: data[o].profile.nickname,
325
332
  imageURL: data[o].profile.profileImageUrl,
326
- role: data[o].profile.userRoleCode
333
+ hasMod: modVal
327
334
  },
328
335
  message: data[o].content,
329
336
  time: data[o].messageTime
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "buzzk",
3
3
  "displayName": "BUZZK",
4
- "version": "1.7.0",
4
+ "version": "1.7.2",
5
5
  "description": "λΏŒμ§€μ§ (BUZZK) - μΉ˜μ§€μ§(CHZZK) 챗봇을 λ”μš± μ‰½κ²Œ κ°œλ°œν•  수 μžˆλ„λ‘ λ•λŠ” 비곡식 라이브러리.",
6
6
  "main": "lib/index.js",
7
7
  "type": "commonjs",