buzzk 1.7.1 β†’ 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 -5
  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,7 +184,7 @@ class chzzkChat {
184
184
  * @property {string} id
185
185
  * @property {string} name
186
186
  * @property {string} imageURL
187
- * @property {string} role
187
+ * @property {boolean} hasMod
188
188
  */
189
189
 
190
190
  /**
@@ -228,17 +228,20 @@ class chzzkChat {
228
228
  data[o].profile = {
229
229
  nickname: null,
230
230
  profileImageUrl: null,
231
- role: null
231
+ userRoleCode: null
232
232
  };
233
233
  }
234
234
 
235
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
+
236
239
  msgList[Object.keys(msgList).length] = {
237
240
  author: {
238
241
  id: data[o].uid,
239
242
  name: data[o].profile.nickname,
240
243
  imageURL: data[o].profile.profileImageUrl,
241
- role: data[o].profile.userRoleCode
244
+ hasMod: modVal
242
245
  },
243
246
  message: data[o].msg,
244
247
  time: data[o].msgTime
@@ -315,16 +318,19 @@ class chzzkChat {
315
318
  data[o].profile = {
316
319
  nickname: null,
317
320
  profileImageUrl: null,
318
- role: null
321
+ userRoleCode: null
319
322
  }
320
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;
321
327
 
322
328
  msgList[Object.keys(msgList).length] = {
323
329
  author: {
324
330
  id: data[o].userId,
325
331
  name: data[o].profile.nickname,
326
332
  imageURL: data[o].profile.profileImageUrl,
327
- role: data[o].profile.userRoleCode
333
+ hasMod: modVal
328
334
  },
329
335
  message: data[o].content,
330
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.1",
4
+ "version": "1.7.2",
5
5
  "description": "λΏŒμ§€μ§ (BUZZK) - μΉ˜μ§€μ§(CHZZK) 챗봇을 λ”μš± μ‰½κ²Œ κ°œλ°œν•  수 μžˆλ„λ‘ λ•λŠ” 비곡식 라이브러리.",
6
6
  "main": "lib/index.js",
7
7
  "type": "commonjs",