fishpi 0.0.24 → 0.0.26

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/lib/chatroom.d.ts CHANGED
@@ -51,6 +51,10 @@ declare class ChatRoom {
51
51
  * @param color 弹幕颜色
52
52
  */
53
53
  barrage(msg: string, color?: string): Promise<ApiResponse<undefined>>;
54
+ barragePay(): Promise<{
55
+ cost: number;
56
+ unit: string;
57
+ }>;
54
58
  /**
55
59
  * 获取禁言中成员列表(思过崖)
56
60
  */
package/lib/chatroom.js CHANGED
@@ -285,12 +285,44 @@ var ChatRoom = /** @class */ (function () {
285
285
  });
286
286
  });
287
287
  };
288
+ ChatRoom.prototype.barragePay = function () {
289
+ return __awaiter(this, void 0, void 0, function () {
290
+ var rsp, mat, e_6;
291
+ return __generator(this, function (_a) {
292
+ switch (_a.label) {
293
+ case 0:
294
+ _a.trys.push([0, 2, , 3]);
295
+ return [4 /*yield*/, (0, utils_1.request)({
296
+ url: "cr?apiKey=".concat(this._apiKey),
297
+ method: 'get'
298
+ })];
299
+ case 1:
300
+ rsp = _a.sent();
301
+ mat = rsp.match(/>发送弹幕每次将花费\s*<b>(\d+)<\/b>\s*([^<]*?)<\/div>/);
302
+ if (mat) {
303
+ return [2 /*return*/, {
304
+ cost: parseInt(mat[1]),
305
+ unit: mat[2]
306
+ }];
307
+ }
308
+ return [2 /*return*/, {
309
+ cost: 20,
310
+ unit: '积分'
311
+ }];
312
+ case 2:
313
+ e_6 = _a.sent();
314
+ throw e_6;
315
+ case 3: return [2 /*return*/];
316
+ }
317
+ });
318
+ });
319
+ };
288
320
  /**
289
321
  * 获取禁言中成员列表(思过崖)
290
322
  */
291
323
  ChatRoom.prototype.mutes = function () {
292
324
  return __awaiter(this, void 0, void 0, function () {
293
- var rsp, e_6;
325
+ var rsp, e_7;
294
326
  return __generator(this, function (_a) {
295
327
  switch (_a.label) {
296
328
  case 0:
@@ -303,8 +335,8 @@ var ChatRoom = /** @class */ (function () {
303
335
  rsp = _a.sent();
304
336
  return [2 /*return*/, rsp];
305
337
  case 2:
306
- e_6 = _a.sent();
307
- throw e_6;
338
+ e_7 = _a.sent();
339
+ throw e_7;
308
340
  case 3: return [2 /*return*/];
309
341
  }
310
342
  });
@@ -316,7 +348,7 @@ var ChatRoom = /** @class */ (function () {
316
348
  */
317
349
  ChatRoom.prototype.raw = function (oId) {
318
350
  return __awaiter(this, void 0, void 0, function () {
319
- var rsp, e_7;
351
+ var rsp, e_8;
320
352
  return __generator(this, function (_a) {
321
353
  switch (_a.label) {
322
354
  case 0:
@@ -328,8 +360,8 @@ var ChatRoom = /** @class */ (function () {
328
360
  rsp = _a.sent();
329
361
  return [2 /*return*/, rsp.replace(/<!--.*?-->/g, '')];
330
362
  case 2:
331
- e_7 = _a.sent();
332
- throw e_7;
363
+ e_8 = _a.sent();
364
+ throw e_8;
333
365
  case 3: return [2 /*return*/];
334
366
  }
335
367
  });
@@ -350,7 +382,7 @@ var ChatRoom = /** @class */ (function () {
350
382
  */
351
383
  open: function (oId, gesture) {
352
384
  return __awaiter(this, void 0, void 0, function () {
353
- var rsp, e_8;
385
+ var rsp, e_9;
354
386
  return __generator(this, function (_a) {
355
387
  switch (_a.label) {
356
388
  case 0:
@@ -368,8 +400,8 @@ var ChatRoom = /** @class */ (function () {
368
400
  rsp = _a.sent();
369
401
  return [2 /*return*/, rsp];
370
402
  case 2:
371
- e_8 = _a.sent();
372
- throw e_8;
403
+ e_9 = _a.sent();
404
+ throw e_9;
373
405
  case 3: return [2 /*return*/];
374
406
  }
375
407
  });
package/lib/typing.d.ts CHANGED
@@ -2072,10 +2072,12 @@ export interface MuteItem {
2072
2072
  userNickname: string;
2073
2073
  }
2074
2074
  export interface NoticeMsg {
2075
- command: 'refreshNotification' | 'chatUnreadCountRefresh' | 'newIdleChatMessage';
2075
+ command: 'refreshNotification' | 'chatUnreadCountRefresh' | 'newIdleChatMessage' | 'warnBroadcast';
2076
2076
  userId: string;
2077
2077
  preview?: string;
2078
2078
  senderAvatar?: string;
2079
2079
  senderUserName?: string;
2080
2080
  count?: number;
2081
+ warnBroadcastText?: string;
2082
+ who?: string;
2081
2083
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fishpi",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "A Package to use API of fishpi.",
5
5
  "main": "./lib/index.js",
6
6
  "files": [