woodenfish-bot 3.3.5 → 3.3.6
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/es/index.js +108 -108
- package/lib/index.js +108 -108
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -20,7 +20,7 @@ function _typeof$1(o) {
|
|
|
20
20
|
function toPrimitive(t, r) {
|
|
21
21
|
if ("object" != _typeof$1(t) || !t) return t;
|
|
22
22
|
var e = t[Symbol.toPrimitive];
|
|
23
|
-
if (
|
|
23
|
+
if (undefined !== e) {
|
|
24
24
|
var i = e.call(t, r || "default");
|
|
25
25
|
if ("object" != _typeof$1(i)) return i;
|
|
26
26
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
@@ -36,21 +36,21 @@ function toPropertyKey(t) {
|
|
|
36
36
|
function _defineProperties(e, r) {
|
|
37
37
|
for (var t = 0; t < r.length; t++) {
|
|
38
38
|
var o = r[t];
|
|
39
|
-
o.enumerable = o.enumerable ||
|
|
39
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, toPropertyKey(o.key), o);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
function _createClass(e, r, t) {
|
|
43
43
|
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
44
|
-
writable:
|
|
44
|
+
writable: false
|
|
45
45
|
}), e;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function _defineProperty(e, r, t) {
|
|
49
49
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
50
50
|
value: t,
|
|
51
|
-
enumerable:
|
|
52
|
-
configurable:
|
|
53
|
-
writable:
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true
|
|
54
54
|
}) : e[r] = t, e;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -122,8 +122,8 @@ var getURL = function getURL(endpoint) {
|
|
|
122
122
|
var PinsMessage = /*#__PURE__*/function () {
|
|
123
123
|
function PinsMessage(request, config) {
|
|
124
124
|
_classCallCheck(this, PinsMessage);
|
|
125
|
-
_defineProperty(this, "request",
|
|
126
|
-
_defineProperty(this, "config",
|
|
125
|
+
_defineProperty(this, "request", undefined);
|
|
126
|
+
_defineProperty(this, "config", undefined);
|
|
127
127
|
this.request = request;
|
|
128
128
|
this.config = config;
|
|
129
129
|
}
|
|
@@ -180,8 +180,8 @@ var PinsMessage = /*#__PURE__*/function () {
|
|
|
180
180
|
var Reaction = /*#__PURE__*/function () {
|
|
181
181
|
function Reaction(request, config) {
|
|
182
182
|
_classCallCheck(this, Reaction);
|
|
183
|
-
_defineProperty(this, "request",
|
|
184
|
-
_defineProperty(this, "config",
|
|
183
|
+
_defineProperty(this, "request", undefined);
|
|
184
|
+
_defineProperty(this, "config", undefined);
|
|
185
185
|
this.request = request;
|
|
186
186
|
this.config = config;
|
|
187
187
|
}
|
|
@@ -195,9 +195,9 @@ var Reaction = /*#__PURE__*/function () {
|
|
|
195
195
|
url: getURL('reactionURI'),
|
|
196
196
|
rest: {
|
|
197
197
|
channelID: channelId,
|
|
198
|
-
messageID: reactionToCreate === null || reactionToCreate ===
|
|
199
|
-
emojiType: reactionToCreate === null || reactionToCreate ===
|
|
200
|
-
emojiID: reactionToCreate === null || reactionToCreate ===
|
|
198
|
+
messageID: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.message_id,
|
|
199
|
+
emojiType: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.emoji_type,
|
|
200
|
+
emojiID: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.emoji_id
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
203
|
return this.request(options);
|
|
@@ -212,9 +212,9 @@ var Reaction = /*#__PURE__*/function () {
|
|
|
212
212
|
url: getURL('reactionURI'),
|
|
213
213
|
rest: {
|
|
214
214
|
channelID: channelId,
|
|
215
|
-
messageID: reactionToDelete === null || reactionToDelete ===
|
|
216
|
-
emojiType: reactionToDelete === null || reactionToDelete ===
|
|
217
|
-
emojiID: reactionToDelete === null || reactionToDelete ===
|
|
215
|
+
messageID: reactionToDelete === null || reactionToDelete === undefined ? undefined : reactionToDelete.message_id,
|
|
216
|
+
emojiType: reactionToDelete === null || reactionToDelete === undefined ? undefined : reactionToDelete.emoji_type,
|
|
217
|
+
emojiID: reactionToDelete === null || reactionToDelete === undefined ? undefined : reactionToDelete.emoji_id
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
return this.request(options);
|
|
@@ -232,9 +232,9 @@ var Reaction = /*#__PURE__*/function () {
|
|
|
232
232
|
url: getURL('reactionURI'),
|
|
233
233
|
rest: {
|
|
234
234
|
channelID: channelId,
|
|
235
|
-
messageID: reactionToCreate === null || reactionToCreate ===
|
|
236
|
-
emojiType: reactionToCreate === null || reactionToCreate ===
|
|
237
|
-
emojiID: reactionToCreate === null || reactionToCreate ===
|
|
235
|
+
messageID: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.message_id,
|
|
236
|
+
emojiType: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.emoji_type,
|
|
237
|
+
emojiID: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.emoji_id
|
|
238
238
|
},
|
|
239
239
|
params: options
|
|
240
240
|
};
|
|
@@ -246,8 +246,8 @@ var Reaction = /*#__PURE__*/function () {
|
|
|
246
246
|
var Guild = /*#__PURE__*/function () {
|
|
247
247
|
function Guild(request, config) {
|
|
248
248
|
_classCallCheck(this, Guild);
|
|
249
|
-
_defineProperty(this, "request",
|
|
250
|
-
_defineProperty(this, "config",
|
|
249
|
+
_defineProperty(this, "request", undefined);
|
|
250
|
+
_defineProperty(this, "config", undefined);
|
|
251
251
|
this.request = request;
|
|
252
252
|
this.config = config;
|
|
253
253
|
}
|
|
@@ -360,7 +360,7 @@ function _asyncToGenerator(n) {
|
|
|
360
360
|
function _throw(n) {
|
|
361
361
|
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
362
362
|
}
|
|
363
|
-
_next(
|
|
363
|
+
_next(undefined);
|
|
364
364
|
});
|
|
365
365
|
};
|
|
366
366
|
}
|
|
@@ -418,9 +418,9 @@ function requireRegeneratorRuntime () {
|
|
|
418
418
|
function define(t, e, r) {
|
|
419
419
|
return Object.defineProperty(t, e, {
|
|
420
420
|
value: r,
|
|
421
|
-
enumerable:
|
|
422
|
-
configurable:
|
|
423
|
-
writable:
|
|
421
|
+
enumerable: true,
|
|
422
|
+
configurable: true,
|
|
423
|
+
writable: true
|
|
424
424
|
}), t[e];
|
|
425
425
|
}
|
|
426
426
|
try {
|
|
@@ -513,7 +513,7 @@ function requireRegeneratorRuntime () {
|
|
|
513
513
|
if ("throw" === i) throw a;
|
|
514
514
|
return {
|
|
515
515
|
value: t,
|
|
516
|
-
done:
|
|
516
|
+
done: true
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
519
|
for (n.method = i, n.arg = a;;) {
|
|
@@ -564,7 +564,7 @@ function requireRegeneratorRuntime () {
|
|
|
564
564
|
function Context(t) {
|
|
565
565
|
this.tryEntries = [{
|
|
566
566
|
tryLoc: "root"
|
|
567
|
-
}], t.forEach(pushTryEntry, this), this.reset(
|
|
567
|
+
}], t.forEach(pushTryEntry, this), this.reset(true);
|
|
568
568
|
}
|
|
569
569
|
function values(e) {
|
|
570
570
|
if (e || "" === e) {
|
|
@@ -574,8 +574,8 @@ function requireRegeneratorRuntime () {
|
|
|
574
574
|
if (!isNaN(e.length)) {
|
|
575
575
|
var o = -1,
|
|
576
576
|
i = function next() {
|
|
577
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done =
|
|
578
|
-
return next.value = t, next.done =
|
|
577
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = false, next;
|
|
578
|
+
return next.value = t, next.done = true, next;
|
|
579
579
|
};
|
|
580
580
|
return i.next = i;
|
|
581
581
|
}
|
|
@@ -584,10 +584,10 @@ function requireRegeneratorRuntime () {
|
|
|
584
584
|
}
|
|
585
585
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
586
586
|
value: GeneratorFunctionPrototype,
|
|
587
|
-
configurable:
|
|
587
|
+
configurable: true
|
|
588
588
|
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
589
589
|
value: GeneratorFunction,
|
|
590
|
-
configurable:
|
|
590
|
+
configurable: true
|
|
591
591
|
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
592
592
|
var e = "function" == typeof t && t.constructor;
|
|
593
593
|
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
@@ -600,7 +600,7 @@ function requireRegeneratorRuntime () {
|
|
|
600
600
|
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
601
601
|
return this;
|
|
602
602
|
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
603
|
-
|
|
603
|
+
undefined === i && (i = Promise);
|
|
604
604
|
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
605
605
|
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
606
606
|
return t.done ? t.value : a.next();
|
|
@@ -616,17 +616,17 @@ function requireRegeneratorRuntime () {
|
|
|
616
616
|
return r.reverse(), function next() {
|
|
617
617
|
for (; r.length;) {
|
|
618
618
|
var t = r.pop();
|
|
619
|
-
if (t in e) return next.value = t, next.done =
|
|
619
|
+
if (t in e) return next.value = t, next.done = false, next;
|
|
620
620
|
}
|
|
621
|
-
return next.done =
|
|
621
|
+
return next.done = true, next;
|
|
622
622
|
};
|
|
623
623
|
}, e.values = values, Context.prototype = {
|
|
624
624
|
constructor: Context,
|
|
625
625
|
reset: function reset(e) {
|
|
626
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done =
|
|
626
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
627
627
|
},
|
|
628
628
|
stop: function stop() {
|
|
629
|
-
this.done =
|
|
629
|
+
this.done = true;
|
|
630
630
|
var t = this.tryEntries[0].completion;
|
|
631
631
|
if ("throw" === t.type) throw t.arg;
|
|
632
632
|
return this.rval;
|
|
@@ -645,10 +645,10 @@ function requireRegeneratorRuntime () {
|
|
|
645
645
|
var c = n.call(i, "catchLoc"),
|
|
646
646
|
u = n.call(i, "finallyLoc");
|
|
647
647
|
if (c && u) {
|
|
648
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
648
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
649
649
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
650
650
|
} else if (c) {
|
|
651
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
651
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
652
652
|
} else {
|
|
653
653
|
if (!u) throw Error("try statement without catch or finally");
|
|
654
654
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
@@ -733,7 +733,7 @@ function requireRegenerator () {
|
|
|
733
733
|
var regeneratorExports = requireRegenerator();
|
|
734
734
|
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regeneratorExports);
|
|
735
735
|
|
|
736
|
-
var version = "3.3.
|
|
736
|
+
var version = "3.3.6";
|
|
737
737
|
|
|
738
738
|
var loglevel$1 = {exports: {}};
|
|
739
739
|
|
|
@@ -1266,8 +1266,8 @@ var buildUrl = function buildUrl() {
|
|
|
1266
1266
|
var Channel = /*#__PURE__*/function () {
|
|
1267
1267
|
function Channel(request, config) {
|
|
1268
1268
|
_classCallCheck(this, Channel);
|
|
1269
|
-
_defineProperty(this, "request",
|
|
1270
|
-
_defineProperty(this, "config",
|
|
1269
|
+
_defineProperty(this, "request", undefined);
|
|
1270
|
+
_defineProperty(this, "config", undefined);
|
|
1271
1271
|
this.request = request;
|
|
1272
1272
|
this.config = config;
|
|
1273
1273
|
}
|
|
@@ -1355,8 +1355,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1355
1355
|
var Me = /*#__PURE__*/function () {
|
|
1356
1356
|
function Me(request, config) {
|
|
1357
1357
|
_classCallCheck(this, Me);
|
|
1358
|
-
_defineProperty(this, "request",
|
|
1359
|
-
_defineProperty(this, "config",
|
|
1358
|
+
_defineProperty(this, "request", undefined);
|
|
1359
|
+
_defineProperty(this, "config", undefined);
|
|
1360
1360
|
this.request = request;
|
|
1361
1361
|
this.config = config;
|
|
1362
1362
|
}
|
|
@@ -1389,8 +1389,8 @@ var Me = /*#__PURE__*/function () {
|
|
|
1389
1389
|
var Message = /*#__PURE__*/function () {
|
|
1390
1390
|
function Message(request, config) {
|
|
1391
1391
|
_classCallCheck(this, Message);
|
|
1392
|
-
_defineProperty(this, "request",
|
|
1393
|
-
_defineProperty(this, "config",
|
|
1392
|
+
_defineProperty(this, "request", undefined);
|
|
1393
|
+
_defineProperty(this, "config", undefined);
|
|
1394
1394
|
this.request = request;
|
|
1395
1395
|
this.config = config;
|
|
1396
1396
|
}
|
|
@@ -1592,8 +1592,8 @@ var Message = /*#__PURE__*/function () {
|
|
|
1592
1592
|
var Member = /*#__PURE__*/function () {
|
|
1593
1593
|
function Member(request, config) {
|
|
1594
1594
|
_classCallCheck(this, Member);
|
|
1595
|
-
_defineProperty(this, "request",
|
|
1596
|
-
_defineProperty(this, "config",
|
|
1595
|
+
_defineProperty(this, "request", undefined);
|
|
1596
|
+
_defineProperty(this, "config", undefined);
|
|
1597
1597
|
this.request = request;
|
|
1598
1598
|
this.config = config;
|
|
1599
1599
|
}
|
|
@@ -1678,8 +1678,8 @@ var defaultColor = 4278245297;
|
|
|
1678
1678
|
var Role = /*#__PURE__*/function () {
|
|
1679
1679
|
function Role(request, config) {
|
|
1680
1680
|
_classCallCheck(this, Role);
|
|
1681
|
-
_defineProperty(this, "request",
|
|
1682
|
-
_defineProperty(this, "config",
|
|
1681
|
+
_defineProperty(this, "request", undefined);
|
|
1682
|
+
_defineProperty(this, "config", undefined);
|
|
1683
1683
|
this.request = request;
|
|
1684
1684
|
this.config = config;
|
|
1685
1685
|
}
|
|
@@ -1765,8 +1765,8 @@ var Role = /*#__PURE__*/function () {
|
|
|
1765
1765
|
var DirectMessage = /*#__PURE__*/function () {
|
|
1766
1766
|
function DirectMessage(request, config) {
|
|
1767
1767
|
_classCallCheck(this, DirectMessage);
|
|
1768
|
-
_defineProperty(this, "request",
|
|
1769
|
-
_defineProperty(this, "config",
|
|
1768
|
+
_defineProperty(this, "request", undefined);
|
|
1769
|
+
_defineProperty(this, "config", undefined);
|
|
1770
1770
|
this.request = request;
|
|
1771
1771
|
this.config = config;
|
|
1772
1772
|
}
|
|
@@ -1803,8 +1803,8 @@ var DirectMessage = /*#__PURE__*/function () {
|
|
|
1803
1803
|
var ChannelPermissions = /*#__PURE__*/function () {
|
|
1804
1804
|
function ChannelPermissions(request, config) {
|
|
1805
1805
|
_classCallCheck(this, ChannelPermissions);
|
|
1806
|
-
_defineProperty(this, "request",
|
|
1807
|
-
_defineProperty(this, "config",
|
|
1806
|
+
_defineProperty(this, "request", undefined);
|
|
1807
|
+
_defineProperty(this, "config", undefined);
|
|
1808
1808
|
this.request = request;
|
|
1809
1809
|
this.config = config;
|
|
1810
1810
|
}
|
|
@@ -1890,8 +1890,8 @@ var ChannelPermissions = /*#__PURE__*/function () {
|
|
|
1890
1890
|
var Audio = /*#__PURE__*/function () {
|
|
1891
1891
|
function Audio(request, config) {
|
|
1892
1892
|
_classCallCheck(this, Audio);
|
|
1893
|
-
_defineProperty(this, "request",
|
|
1894
|
-
_defineProperty(this, "config",
|
|
1893
|
+
_defineProperty(this, "request", undefined);
|
|
1894
|
+
_defineProperty(this, "config", undefined);
|
|
1895
1895
|
this.request = request;
|
|
1896
1896
|
this.config = config;
|
|
1897
1897
|
}
|
|
@@ -1944,12 +1944,12 @@ var Audio = /*#__PURE__*/function () {
|
|
|
1944
1944
|
}();
|
|
1945
1945
|
|
|
1946
1946
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1947
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t),
|
|
1947
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1948
1948
|
var Mute = /*#__PURE__*/function () {
|
|
1949
1949
|
function Mute(request, config) {
|
|
1950
1950
|
_classCallCheck(this, Mute);
|
|
1951
|
-
_defineProperty(this, "request",
|
|
1952
|
-
_defineProperty(this, "config",
|
|
1951
|
+
_defineProperty(this, "request", undefined);
|
|
1952
|
+
_defineProperty(this, "config", undefined);
|
|
1953
1953
|
this.request = request;
|
|
1954
1954
|
this.config = config;
|
|
1955
1955
|
}
|
|
@@ -2017,8 +2017,8 @@ var Mute = /*#__PURE__*/function () {
|
|
|
2017
2017
|
var Announce = /*#__PURE__*/function () {
|
|
2018
2018
|
function Announce(request, config) {
|
|
2019
2019
|
_classCallCheck(this, Announce);
|
|
2020
|
-
_defineProperty(this, "request",
|
|
2021
|
-
_defineProperty(this, "config",
|
|
2020
|
+
_defineProperty(this, "request", undefined);
|
|
2021
|
+
_defineProperty(this, "config", undefined);
|
|
2022
2022
|
this.request = request;
|
|
2023
2023
|
this.config = config;
|
|
2024
2024
|
}
|
|
@@ -2108,8 +2108,8 @@ var Announce = /*#__PURE__*/function () {
|
|
|
2108
2108
|
var Schedule = /*#__PURE__*/function () {
|
|
2109
2109
|
function Schedule(request, config) {
|
|
2110
2110
|
_classCallCheck(this, Schedule);
|
|
2111
|
-
_defineProperty(this, "request",
|
|
2112
|
-
_defineProperty(this, "config",
|
|
2111
|
+
_defineProperty(this, "request", undefined);
|
|
2112
|
+
_defineProperty(this, "config", undefined);
|
|
2113
2113
|
this.request = request;
|
|
2114
2114
|
this.config = config;
|
|
2115
2115
|
}
|
|
@@ -2204,8 +2204,8 @@ var Schedule = /*#__PURE__*/function () {
|
|
|
2204
2204
|
var Threads = /*#__PURE__*/function () {
|
|
2205
2205
|
function Threads(request, config) {
|
|
2206
2206
|
_classCallCheck(this, Threads);
|
|
2207
|
-
_defineProperty(this, "request",
|
|
2208
|
-
_defineProperty(this, "config",
|
|
2207
|
+
_defineProperty(this, "request", undefined);
|
|
2208
|
+
_defineProperty(this, "config", undefined);
|
|
2209
2209
|
this.request = request;
|
|
2210
2210
|
this.config = config;
|
|
2211
2211
|
}
|
|
@@ -2276,8 +2276,8 @@ var Threads = /*#__PURE__*/function () {
|
|
|
2276
2276
|
var GuildPermissions = /*#__PURE__*/function () {
|
|
2277
2277
|
function GuildPermissions(request, config) {
|
|
2278
2278
|
_classCallCheck(this, GuildPermissions);
|
|
2279
|
-
_defineProperty(this, "request",
|
|
2280
|
-
_defineProperty(this, "config",
|
|
2279
|
+
_defineProperty(this, "request", undefined);
|
|
2280
|
+
_defineProperty(this, "config", undefined);
|
|
2281
2281
|
this.request = request;
|
|
2282
2282
|
this.config = config;
|
|
2283
2283
|
}
|
|
@@ -2316,8 +2316,8 @@ var GuildPermissions = /*#__PURE__*/function () {
|
|
|
2316
2316
|
var Interaction = /*#__PURE__*/function () {
|
|
2317
2317
|
function Interaction(request, config) {
|
|
2318
2318
|
_classCallCheck(this, Interaction);
|
|
2319
|
-
_defineProperty(this, "request",
|
|
2320
|
-
_defineProperty(this, "config",
|
|
2319
|
+
_defineProperty(this, "request", undefined);
|
|
2320
|
+
_defineProperty(this, "config", undefined);
|
|
2321
2321
|
this.request = request;
|
|
2322
2322
|
this.config = config;
|
|
2323
2323
|
}
|
|
@@ -2343,7 +2343,7 @@ var Interaction = /*#__PURE__*/function () {
|
|
|
2343
2343
|
}();
|
|
2344
2344
|
|
|
2345
2345
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2346
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t),
|
|
2346
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2347
2347
|
var apiVersion = 'v1';
|
|
2348
2348
|
var OpenAPI = /*#__PURE__*/function () {
|
|
2349
2349
|
function OpenAPI(config) {
|
|
@@ -2352,23 +2352,23 @@ var OpenAPI = /*#__PURE__*/function () {
|
|
|
2352
2352
|
appID: '',
|
|
2353
2353
|
token: ''
|
|
2354
2354
|
});
|
|
2355
|
-
_defineProperty(this, "guildApi",
|
|
2356
|
-
_defineProperty(this, "channelApi",
|
|
2357
|
-
_defineProperty(this, "meApi",
|
|
2358
|
-
_defineProperty(this, "messageApi",
|
|
2359
|
-
_defineProperty(this, "memberApi",
|
|
2360
|
-
_defineProperty(this, "roleApi",
|
|
2361
|
-
_defineProperty(this, "muteApi",
|
|
2362
|
-
_defineProperty(this, "announceApi",
|
|
2363
|
-
_defineProperty(this, "scheduleApi",
|
|
2364
|
-
_defineProperty(this, "threadsApi",
|
|
2365
|
-
_defineProperty(this, "directMessageApi",
|
|
2366
|
-
_defineProperty(this, "channelPermissionsApi",
|
|
2367
|
-
_defineProperty(this, "audioApi",
|
|
2368
|
-
_defineProperty(this, "reactionApi",
|
|
2369
|
-
_defineProperty(this, "interactionApi",
|
|
2370
|
-
_defineProperty(this, "pinsMessageApi",
|
|
2371
|
-
_defineProperty(this, "guildPermissionsApi",
|
|
2355
|
+
_defineProperty(this, "guildApi", undefined);
|
|
2356
|
+
_defineProperty(this, "channelApi", undefined);
|
|
2357
|
+
_defineProperty(this, "meApi", undefined);
|
|
2358
|
+
_defineProperty(this, "messageApi", undefined);
|
|
2359
|
+
_defineProperty(this, "memberApi", undefined);
|
|
2360
|
+
_defineProperty(this, "roleApi", undefined);
|
|
2361
|
+
_defineProperty(this, "muteApi", undefined);
|
|
2362
|
+
_defineProperty(this, "announceApi", undefined);
|
|
2363
|
+
_defineProperty(this, "scheduleApi", undefined);
|
|
2364
|
+
_defineProperty(this, "threadsApi", undefined);
|
|
2365
|
+
_defineProperty(this, "directMessageApi", undefined);
|
|
2366
|
+
_defineProperty(this, "channelPermissionsApi", undefined);
|
|
2367
|
+
_defineProperty(this, "audioApi", undefined);
|
|
2368
|
+
_defineProperty(this, "reactionApi", undefined);
|
|
2369
|
+
_defineProperty(this, "interactionApi", undefined);
|
|
2370
|
+
_defineProperty(this, "pinsMessageApi", undefined);
|
|
2371
|
+
_defineProperty(this, "guildPermissionsApi", undefined);
|
|
2372
2372
|
this.config = config;
|
|
2373
2373
|
this.register(this);
|
|
2374
2374
|
}
|
|
@@ -2417,13 +2417,13 @@ var OpenAPI = /*#__PURE__*/function () {
|
|
|
2417
2417
|
return result;
|
|
2418
2418
|
}, function (error) {
|
|
2419
2419
|
var _error$response, _error$response2;
|
|
2420
|
-
var traceid = error === null || error ===
|
|
2421
|
-
if (error !== null && error !==
|
|
2420
|
+
var traceid = error === null || error === undefined || (_error$response = error.response) === null || _error$response === undefined || (_error$response = _error$response.headers) === null || _error$response === undefined ? undefined : _error$response['x-tps-trace-id'];
|
|
2421
|
+
if (error !== null && error !== undefined && (_error$response2 = error.response) !== null && _error$response2 !== undefined && _error$response2.data) {
|
|
2422
2422
|
return Promise.reject(_objectSpread(_objectSpread({}, error.response.data), {}, {
|
|
2423
2423
|
traceid: traceid
|
|
2424
2424
|
}));
|
|
2425
2425
|
}
|
|
2426
|
-
if (error !== null && error !==
|
|
2426
|
+
if (error !== null && error !== undefined && error.response) {
|
|
2427
2427
|
return Promise.reject(_objectSpread(_objectSpread({}, error.response), {}, {
|
|
2428
2428
|
traceid: traceid
|
|
2429
2429
|
}));
|
|
@@ -2445,13 +2445,13 @@ function v1Setup() {
|
|
|
2445
2445
|
}
|
|
2446
2446
|
|
|
2447
2447
|
function _assertThisInitialized(e) {
|
|
2448
|
-
if (
|
|
2448
|
+
if (undefined === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2449
2449
|
return e;
|
|
2450
2450
|
}
|
|
2451
2451
|
|
|
2452
2452
|
function _possibleConstructorReturn(t, e) {
|
|
2453
2453
|
if (e && ("object" == _typeof$1(e) || "function" == typeof e)) return e;
|
|
2454
|
-
if (
|
|
2454
|
+
if (undefined !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
2455
2455
|
return _assertThisInitialized(t);
|
|
2456
2456
|
}
|
|
2457
2457
|
|
|
@@ -2472,11 +2472,11 @@ function _inherits(t, e) {
|
|
|
2472
2472
|
t.prototype = Object.create(e && e.prototype, {
|
|
2473
2473
|
constructor: {
|
|
2474
2474
|
value: t,
|
|
2475
|
-
writable:
|
|
2476
|
-
configurable:
|
|
2475
|
+
writable: true,
|
|
2476
|
+
configurable: true
|
|
2477
2477
|
}
|
|
2478
2478
|
}), Object.defineProperty(t, "prototype", {
|
|
2479
|
-
writable:
|
|
2479
|
+
writable: false
|
|
2480
2480
|
}), e && _setPrototypeOf(t, e);
|
|
2481
2481
|
}
|
|
2482
2482
|
|
|
@@ -2813,17 +2813,17 @@ var Properties = {
|
|
|
2813
2813
|
var Ws = /*#__PURE__*/function () {
|
|
2814
2814
|
function Ws(config, event, sessionRecord) {
|
|
2815
2815
|
_classCallCheck(this, Ws);
|
|
2816
|
-
_defineProperty(this, "ws",
|
|
2817
|
-
_defineProperty(this, "event",
|
|
2818
|
-
_defineProperty(this, "config",
|
|
2819
|
-
_defineProperty(this, "heartbeatInterval",
|
|
2816
|
+
_defineProperty(this, "ws", undefined);
|
|
2817
|
+
_defineProperty(this, "event", undefined);
|
|
2818
|
+
_defineProperty(this, "config", undefined);
|
|
2819
|
+
_defineProperty(this, "heartbeatInterval", undefined);
|
|
2820
2820
|
// 心跳参数,默认为心跳测试
|
|
2821
2821
|
_defineProperty(this, "heartbeatParam", {
|
|
2822
2822
|
op: OpCode.HEARTBEAT,
|
|
2823
2823
|
d: null // 心跳唯一值
|
|
2824
2824
|
});
|
|
2825
2825
|
// 是否是断线重连,如果是断线重连的话,不需要走鉴权
|
|
2826
|
-
_defineProperty(this, "isReconnect",
|
|
2826
|
+
_defineProperty(this, "isReconnect", undefined);
|
|
2827
2827
|
// 记录会话参数
|
|
2828
2828
|
_defineProperty(this, "sessionRecord", {
|
|
2829
2829
|
sessionID: '',
|
|
@@ -2869,10 +2869,10 @@ var Ws = /*#__PURE__*/function () {
|
|
|
2869
2869
|
// 先将消息解析
|
|
2870
2870
|
var wsRes = toObject(data);
|
|
2871
2871
|
// 先判断websocket连接是否成功
|
|
2872
|
-
if ((wsRes === null || wsRes ===
|
|
2872
|
+
if ((wsRes === null || wsRes === undefined ? undefined : wsRes.op) === OpCode.HELLO && wsRes !== null && wsRes !== undefined && (_wsRes$d = wsRes.d) !== null && _wsRes$d !== undefined && _wsRes$d.heartbeat_interval) {
|
|
2873
2873
|
var _wsRes$d2;
|
|
2874
2874
|
// websocket连接成功,拿到心跳周期
|
|
2875
|
-
_this.heartbeatInterval = wsRes === null || wsRes ===
|
|
2875
|
+
_this.heartbeatInterval = wsRes === null || wsRes === undefined || (_wsRes$d2 = wsRes.d) === null || _wsRes$d2 === undefined ? undefined : _wsRes$d2.heartbeat_interval;
|
|
2876
2876
|
// 非断线重连时,需要鉴权
|
|
2877
2877
|
_this.isReconnect ? _this.reconnectWs() : _this.authWs();
|
|
2878
2878
|
return;
|
|
@@ -3140,11 +3140,11 @@ var Ws = /*#__PURE__*/function () {
|
|
|
3140
3140
|
var Session = /*#__PURE__*/function () {
|
|
3141
3141
|
function Session(config, event, sessionRecord) {
|
|
3142
3142
|
_classCallCheck(this, Session);
|
|
3143
|
-
_defineProperty(this, "config",
|
|
3144
|
-
_defineProperty(this, "heartbeatInterval",
|
|
3145
|
-
_defineProperty(this, "ws",
|
|
3146
|
-
_defineProperty(this, "event",
|
|
3147
|
-
_defineProperty(this, "sessionRecord",
|
|
3143
|
+
_defineProperty(this, "config", undefined);
|
|
3144
|
+
_defineProperty(this, "heartbeatInterval", undefined);
|
|
3145
|
+
_defineProperty(this, "ws", undefined);
|
|
3146
|
+
_defineProperty(this, "event", undefined);
|
|
3147
|
+
_defineProperty(this, "sessionRecord", undefined);
|
|
3148
3148
|
this.config = config;
|
|
3149
3149
|
this.event = event;
|
|
3150
3150
|
// 如果会话记录存在的话,继续透传
|
|
@@ -3193,7 +3193,7 @@ var WebsocketClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
3193
3193
|
var _this;
|
|
3194
3194
|
_classCallCheck(this, WebsocketClient);
|
|
3195
3195
|
_this = _callSuper(this, WebsocketClient);
|
|
3196
|
-
_defineProperty(_this, "session",
|
|
3196
|
+
_defineProperty(_this, "session", undefined);
|
|
3197
3197
|
_defineProperty(_this, "retry", 0);
|
|
3198
3198
|
_this.connect(config);
|
|
3199
3199
|
_this.on(SessionEvents.EVENT_WS, function (data) {
|
|
@@ -3207,7 +3207,7 @@ var WebsocketClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
3207
3207
|
BotLogger.info('[CLIENT] 重新连接中,尝试次数:', _this.retry + 1);
|
|
3208
3208
|
_this.connect(config, (_WebsocketCloseReason = WebsocketCloseReason.find(function (v) {
|
|
3209
3209
|
return v.code === data.code;
|
|
3210
|
-
})) !== null && _WebsocketCloseReason !==
|
|
3210
|
+
})) !== null && _WebsocketCloseReason !== undefined && _WebsocketCloseReason.resume ? data.eventMsg : null);
|
|
3211
3211
|
_this.retry += 1;
|
|
3212
3212
|
} else {
|
|
3213
3213
|
BotLogger.info('[CLIENT] 超过重试次数,连接终止');
|
package/lib/index.js
CHANGED
|
@@ -22,7 +22,7 @@ function _typeof$1(o) {
|
|
|
22
22
|
function toPrimitive(t, r) {
|
|
23
23
|
if ("object" != _typeof$1(t) || !t) return t;
|
|
24
24
|
var e = t[Symbol.toPrimitive];
|
|
25
|
-
if (
|
|
25
|
+
if (undefined !== e) {
|
|
26
26
|
var i = e.call(t, r || "default");
|
|
27
27
|
if ("object" != _typeof$1(i)) return i;
|
|
28
28
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
@@ -38,21 +38,21 @@ function toPropertyKey(t) {
|
|
|
38
38
|
function _defineProperties(e, r) {
|
|
39
39
|
for (var t = 0; t < r.length; t++) {
|
|
40
40
|
var o = r[t];
|
|
41
|
-
o.enumerable = o.enumerable ||
|
|
41
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, toPropertyKey(o.key), o);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
function _createClass(e, r, t) {
|
|
45
45
|
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
46
|
-
writable:
|
|
46
|
+
writable: false
|
|
47
47
|
}), e;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function _defineProperty(e, r, t) {
|
|
51
51
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
52
52
|
value: t,
|
|
53
|
-
enumerable:
|
|
54
|
-
configurable:
|
|
55
|
-
writable:
|
|
53
|
+
enumerable: true,
|
|
54
|
+
configurable: true,
|
|
55
|
+
writable: true
|
|
56
56
|
}) : e[r] = t, e;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -124,8 +124,8 @@ var getURL = function getURL(endpoint) {
|
|
|
124
124
|
var PinsMessage = /*#__PURE__*/function () {
|
|
125
125
|
function PinsMessage(request, config) {
|
|
126
126
|
_classCallCheck(this, PinsMessage);
|
|
127
|
-
_defineProperty(this, "request",
|
|
128
|
-
_defineProperty(this, "config",
|
|
127
|
+
_defineProperty(this, "request", undefined);
|
|
128
|
+
_defineProperty(this, "config", undefined);
|
|
129
129
|
this.request = request;
|
|
130
130
|
this.config = config;
|
|
131
131
|
}
|
|
@@ -182,8 +182,8 @@ var PinsMessage = /*#__PURE__*/function () {
|
|
|
182
182
|
var Reaction = /*#__PURE__*/function () {
|
|
183
183
|
function Reaction(request, config) {
|
|
184
184
|
_classCallCheck(this, Reaction);
|
|
185
|
-
_defineProperty(this, "request",
|
|
186
|
-
_defineProperty(this, "config",
|
|
185
|
+
_defineProperty(this, "request", undefined);
|
|
186
|
+
_defineProperty(this, "config", undefined);
|
|
187
187
|
this.request = request;
|
|
188
188
|
this.config = config;
|
|
189
189
|
}
|
|
@@ -197,9 +197,9 @@ var Reaction = /*#__PURE__*/function () {
|
|
|
197
197
|
url: getURL('reactionURI'),
|
|
198
198
|
rest: {
|
|
199
199
|
channelID: channelId,
|
|
200
|
-
messageID: reactionToCreate === null || reactionToCreate ===
|
|
201
|
-
emojiType: reactionToCreate === null || reactionToCreate ===
|
|
202
|
-
emojiID: reactionToCreate === null || reactionToCreate ===
|
|
200
|
+
messageID: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.message_id,
|
|
201
|
+
emojiType: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.emoji_type,
|
|
202
|
+
emojiID: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.emoji_id
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
return this.request(options);
|
|
@@ -214,9 +214,9 @@ var Reaction = /*#__PURE__*/function () {
|
|
|
214
214
|
url: getURL('reactionURI'),
|
|
215
215
|
rest: {
|
|
216
216
|
channelID: channelId,
|
|
217
|
-
messageID: reactionToDelete === null || reactionToDelete ===
|
|
218
|
-
emojiType: reactionToDelete === null || reactionToDelete ===
|
|
219
|
-
emojiID: reactionToDelete === null || reactionToDelete ===
|
|
217
|
+
messageID: reactionToDelete === null || reactionToDelete === undefined ? undefined : reactionToDelete.message_id,
|
|
218
|
+
emojiType: reactionToDelete === null || reactionToDelete === undefined ? undefined : reactionToDelete.emoji_type,
|
|
219
|
+
emojiID: reactionToDelete === null || reactionToDelete === undefined ? undefined : reactionToDelete.emoji_id
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
222
|
return this.request(options);
|
|
@@ -234,9 +234,9 @@ var Reaction = /*#__PURE__*/function () {
|
|
|
234
234
|
url: getURL('reactionURI'),
|
|
235
235
|
rest: {
|
|
236
236
|
channelID: channelId,
|
|
237
|
-
messageID: reactionToCreate === null || reactionToCreate ===
|
|
238
|
-
emojiType: reactionToCreate === null || reactionToCreate ===
|
|
239
|
-
emojiID: reactionToCreate === null || reactionToCreate ===
|
|
237
|
+
messageID: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.message_id,
|
|
238
|
+
emojiType: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.emoji_type,
|
|
239
|
+
emojiID: reactionToCreate === null || reactionToCreate === undefined ? undefined : reactionToCreate.emoji_id
|
|
240
240
|
},
|
|
241
241
|
params: options
|
|
242
242
|
};
|
|
@@ -248,8 +248,8 @@ var Reaction = /*#__PURE__*/function () {
|
|
|
248
248
|
var Guild = /*#__PURE__*/function () {
|
|
249
249
|
function Guild(request, config) {
|
|
250
250
|
_classCallCheck(this, Guild);
|
|
251
|
-
_defineProperty(this, "request",
|
|
252
|
-
_defineProperty(this, "config",
|
|
251
|
+
_defineProperty(this, "request", undefined);
|
|
252
|
+
_defineProperty(this, "config", undefined);
|
|
253
253
|
this.request = request;
|
|
254
254
|
this.config = config;
|
|
255
255
|
}
|
|
@@ -362,7 +362,7 @@ function _asyncToGenerator(n) {
|
|
|
362
362
|
function _throw(n) {
|
|
363
363
|
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
364
364
|
}
|
|
365
|
-
_next(
|
|
365
|
+
_next(undefined);
|
|
366
366
|
});
|
|
367
367
|
};
|
|
368
368
|
}
|
|
@@ -420,9 +420,9 @@ function requireRegeneratorRuntime () {
|
|
|
420
420
|
function define(t, e, r) {
|
|
421
421
|
return Object.defineProperty(t, e, {
|
|
422
422
|
value: r,
|
|
423
|
-
enumerable:
|
|
424
|
-
configurable:
|
|
425
|
-
writable:
|
|
423
|
+
enumerable: true,
|
|
424
|
+
configurable: true,
|
|
425
|
+
writable: true
|
|
426
426
|
}), t[e];
|
|
427
427
|
}
|
|
428
428
|
try {
|
|
@@ -515,7 +515,7 @@ function requireRegeneratorRuntime () {
|
|
|
515
515
|
if ("throw" === i) throw a;
|
|
516
516
|
return {
|
|
517
517
|
value: t,
|
|
518
|
-
done:
|
|
518
|
+
done: true
|
|
519
519
|
};
|
|
520
520
|
}
|
|
521
521
|
for (n.method = i, n.arg = a;;) {
|
|
@@ -566,7 +566,7 @@ function requireRegeneratorRuntime () {
|
|
|
566
566
|
function Context(t) {
|
|
567
567
|
this.tryEntries = [{
|
|
568
568
|
tryLoc: "root"
|
|
569
|
-
}], t.forEach(pushTryEntry, this), this.reset(
|
|
569
|
+
}], t.forEach(pushTryEntry, this), this.reset(true);
|
|
570
570
|
}
|
|
571
571
|
function values(e) {
|
|
572
572
|
if (e || "" === e) {
|
|
@@ -576,8 +576,8 @@ function requireRegeneratorRuntime () {
|
|
|
576
576
|
if (!isNaN(e.length)) {
|
|
577
577
|
var o = -1,
|
|
578
578
|
i = function next() {
|
|
579
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done =
|
|
580
|
-
return next.value = t, next.done =
|
|
579
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = false, next;
|
|
580
|
+
return next.value = t, next.done = true, next;
|
|
581
581
|
};
|
|
582
582
|
return i.next = i;
|
|
583
583
|
}
|
|
@@ -586,10 +586,10 @@ function requireRegeneratorRuntime () {
|
|
|
586
586
|
}
|
|
587
587
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
588
588
|
value: GeneratorFunctionPrototype,
|
|
589
|
-
configurable:
|
|
589
|
+
configurable: true
|
|
590
590
|
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
591
591
|
value: GeneratorFunction,
|
|
592
|
-
configurable:
|
|
592
|
+
configurable: true
|
|
593
593
|
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
594
594
|
var e = "function" == typeof t && t.constructor;
|
|
595
595
|
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
@@ -602,7 +602,7 @@ function requireRegeneratorRuntime () {
|
|
|
602
602
|
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
603
603
|
return this;
|
|
604
604
|
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
605
|
-
|
|
605
|
+
undefined === i && (i = Promise);
|
|
606
606
|
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
607
607
|
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
608
608
|
return t.done ? t.value : a.next();
|
|
@@ -618,17 +618,17 @@ function requireRegeneratorRuntime () {
|
|
|
618
618
|
return r.reverse(), function next() {
|
|
619
619
|
for (; r.length;) {
|
|
620
620
|
var t = r.pop();
|
|
621
|
-
if (t in e) return next.value = t, next.done =
|
|
621
|
+
if (t in e) return next.value = t, next.done = false, next;
|
|
622
622
|
}
|
|
623
|
-
return next.done =
|
|
623
|
+
return next.done = true, next;
|
|
624
624
|
};
|
|
625
625
|
}, e.values = values, Context.prototype = {
|
|
626
626
|
constructor: Context,
|
|
627
627
|
reset: function reset(e) {
|
|
628
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done =
|
|
628
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
629
629
|
},
|
|
630
630
|
stop: function stop() {
|
|
631
|
-
this.done =
|
|
631
|
+
this.done = true;
|
|
632
632
|
var t = this.tryEntries[0].completion;
|
|
633
633
|
if ("throw" === t.type) throw t.arg;
|
|
634
634
|
return this.rval;
|
|
@@ -647,10 +647,10 @@ function requireRegeneratorRuntime () {
|
|
|
647
647
|
var c = n.call(i, "catchLoc"),
|
|
648
648
|
u = n.call(i, "finallyLoc");
|
|
649
649
|
if (c && u) {
|
|
650
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
650
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
651
651
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
652
652
|
} else if (c) {
|
|
653
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
653
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
654
654
|
} else {
|
|
655
655
|
if (!u) throw Error("try statement without catch or finally");
|
|
656
656
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
@@ -735,7 +735,7 @@ function requireRegenerator () {
|
|
|
735
735
|
var regeneratorExports = requireRegenerator();
|
|
736
736
|
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regeneratorExports);
|
|
737
737
|
|
|
738
|
-
var version = "3.3.
|
|
738
|
+
var version = "3.3.6";
|
|
739
739
|
|
|
740
740
|
var loglevel$1 = {exports: {}};
|
|
741
741
|
|
|
@@ -1268,8 +1268,8 @@ var buildUrl = function buildUrl() {
|
|
|
1268
1268
|
var Channel = /*#__PURE__*/function () {
|
|
1269
1269
|
function Channel(request, config) {
|
|
1270
1270
|
_classCallCheck(this, Channel);
|
|
1271
|
-
_defineProperty(this, "request",
|
|
1272
|
-
_defineProperty(this, "config",
|
|
1271
|
+
_defineProperty(this, "request", undefined);
|
|
1272
|
+
_defineProperty(this, "config", undefined);
|
|
1273
1273
|
this.request = request;
|
|
1274
1274
|
this.config = config;
|
|
1275
1275
|
}
|
|
@@ -1357,8 +1357,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1357
1357
|
var Me = /*#__PURE__*/function () {
|
|
1358
1358
|
function Me(request, config) {
|
|
1359
1359
|
_classCallCheck(this, Me);
|
|
1360
|
-
_defineProperty(this, "request",
|
|
1361
|
-
_defineProperty(this, "config",
|
|
1360
|
+
_defineProperty(this, "request", undefined);
|
|
1361
|
+
_defineProperty(this, "config", undefined);
|
|
1362
1362
|
this.request = request;
|
|
1363
1363
|
this.config = config;
|
|
1364
1364
|
}
|
|
@@ -1391,8 +1391,8 @@ var Me = /*#__PURE__*/function () {
|
|
|
1391
1391
|
var Message = /*#__PURE__*/function () {
|
|
1392
1392
|
function Message(request, config) {
|
|
1393
1393
|
_classCallCheck(this, Message);
|
|
1394
|
-
_defineProperty(this, "request",
|
|
1395
|
-
_defineProperty(this, "config",
|
|
1394
|
+
_defineProperty(this, "request", undefined);
|
|
1395
|
+
_defineProperty(this, "config", undefined);
|
|
1396
1396
|
this.request = request;
|
|
1397
1397
|
this.config = config;
|
|
1398
1398
|
}
|
|
@@ -1594,8 +1594,8 @@ var Message = /*#__PURE__*/function () {
|
|
|
1594
1594
|
var Member = /*#__PURE__*/function () {
|
|
1595
1595
|
function Member(request, config) {
|
|
1596
1596
|
_classCallCheck(this, Member);
|
|
1597
|
-
_defineProperty(this, "request",
|
|
1598
|
-
_defineProperty(this, "config",
|
|
1597
|
+
_defineProperty(this, "request", undefined);
|
|
1598
|
+
_defineProperty(this, "config", undefined);
|
|
1599
1599
|
this.request = request;
|
|
1600
1600
|
this.config = config;
|
|
1601
1601
|
}
|
|
@@ -1680,8 +1680,8 @@ var defaultColor = 4278245297;
|
|
|
1680
1680
|
var Role = /*#__PURE__*/function () {
|
|
1681
1681
|
function Role(request, config) {
|
|
1682
1682
|
_classCallCheck(this, Role);
|
|
1683
|
-
_defineProperty(this, "request",
|
|
1684
|
-
_defineProperty(this, "config",
|
|
1683
|
+
_defineProperty(this, "request", undefined);
|
|
1684
|
+
_defineProperty(this, "config", undefined);
|
|
1685
1685
|
this.request = request;
|
|
1686
1686
|
this.config = config;
|
|
1687
1687
|
}
|
|
@@ -1767,8 +1767,8 @@ var Role = /*#__PURE__*/function () {
|
|
|
1767
1767
|
var DirectMessage = /*#__PURE__*/function () {
|
|
1768
1768
|
function DirectMessage(request, config) {
|
|
1769
1769
|
_classCallCheck(this, DirectMessage);
|
|
1770
|
-
_defineProperty(this, "request",
|
|
1771
|
-
_defineProperty(this, "config",
|
|
1770
|
+
_defineProperty(this, "request", undefined);
|
|
1771
|
+
_defineProperty(this, "config", undefined);
|
|
1772
1772
|
this.request = request;
|
|
1773
1773
|
this.config = config;
|
|
1774
1774
|
}
|
|
@@ -1805,8 +1805,8 @@ var DirectMessage = /*#__PURE__*/function () {
|
|
|
1805
1805
|
var ChannelPermissions = /*#__PURE__*/function () {
|
|
1806
1806
|
function ChannelPermissions(request, config) {
|
|
1807
1807
|
_classCallCheck(this, ChannelPermissions);
|
|
1808
|
-
_defineProperty(this, "request",
|
|
1809
|
-
_defineProperty(this, "config",
|
|
1808
|
+
_defineProperty(this, "request", undefined);
|
|
1809
|
+
_defineProperty(this, "config", undefined);
|
|
1810
1810
|
this.request = request;
|
|
1811
1811
|
this.config = config;
|
|
1812
1812
|
}
|
|
@@ -1892,8 +1892,8 @@ var ChannelPermissions = /*#__PURE__*/function () {
|
|
|
1892
1892
|
var Audio = /*#__PURE__*/function () {
|
|
1893
1893
|
function Audio(request, config) {
|
|
1894
1894
|
_classCallCheck(this, Audio);
|
|
1895
|
-
_defineProperty(this, "request",
|
|
1896
|
-
_defineProperty(this, "config",
|
|
1895
|
+
_defineProperty(this, "request", undefined);
|
|
1896
|
+
_defineProperty(this, "config", undefined);
|
|
1897
1897
|
this.request = request;
|
|
1898
1898
|
this.config = config;
|
|
1899
1899
|
}
|
|
@@ -1946,12 +1946,12 @@ var Audio = /*#__PURE__*/function () {
|
|
|
1946
1946
|
}();
|
|
1947
1947
|
|
|
1948
1948
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1949
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t),
|
|
1949
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1950
1950
|
var Mute = /*#__PURE__*/function () {
|
|
1951
1951
|
function Mute(request, config) {
|
|
1952
1952
|
_classCallCheck(this, Mute);
|
|
1953
|
-
_defineProperty(this, "request",
|
|
1954
|
-
_defineProperty(this, "config",
|
|
1953
|
+
_defineProperty(this, "request", undefined);
|
|
1954
|
+
_defineProperty(this, "config", undefined);
|
|
1955
1955
|
this.request = request;
|
|
1956
1956
|
this.config = config;
|
|
1957
1957
|
}
|
|
@@ -2019,8 +2019,8 @@ var Mute = /*#__PURE__*/function () {
|
|
|
2019
2019
|
var Announce = /*#__PURE__*/function () {
|
|
2020
2020
|
function Announce(request, config) {
|
|
2021
2021
|
_classCallCheck(this, Announce);
|
|
2022
|
-
_defineProperty(this, "request",
|
|
2023
|
-
_defineProperty(this, "config",
|
|
2022
|
+
_defineProperty(this, "request", undefined);
|
|
2023
|
+
_defineProperty(this, "config", undefined);
|
|
2024
2024
|
this.request = request;
|
|
2025
2025
|
this.config = config;
|
|
2026
2026
|
}
|
|
@@ -2110,8 +2110,8 @@ var Announce = /*#__PURE__*/function () {
|
|
|
2110
2110
|
var Schedule = /*#__PURE__*/function () {
|
|
2111
2111
|
function Schedule(request, config) {
|
|
2112
2112
|
_classCallCheck(this, Schedule);
|
|
2113
|
-
_defineProperty(this, "request",
|
|
2114
|
-
_defineProperty(this, "config",
|
|
2113
|
+
_defineProperty(this, "request", undefined);
|
|
2114
|
+
_defineProperty(this, "config", undefined);
|
|
2115
2115
|
this.request = request;
|
|
2116
2116
|
this.config = config;
|
|
2117
2117
|
}
|
|
@@ -2206,8 +2206,8 @@ var Schedule = /*#__PURE__*/function () {
|
|
|
2206
2206
|
var Threads = /*#__PURE__*/function () {
|
|
2207
2207
|
function Threads(request, config) {
|
|
2208
2208
|
_classCallCheck(this, Threads);
|
|
2209
|
-
_defineProperty(this, "request",
|
|
2210
|
-
_defineProperty(this, "config",
|
|
2209
|
+
_defineProperty(this, "request", undefined);
|
|
2210
|
+
_defineProperty(this, "config", undefined);
|
|
2211
2211
|
this.request = request;
|
|
2212
2212
|
this.config = config;
|
|
2213
2213
|
}
|
|
@@ -2278,8 +2278,8 @@ var Threads = /*#__PURE__*/function () {
|
|
|
2278
2278
|
var GuildPermissions = /*#__PURE__*/function () {
|
|
2279
2279
|
function GuildPermissions(request, config) {
|
|
2280
2280
|
_classCallCheck(this, GuildPermissions);
|
|
2281
|
-
_defineProperty(this, "request",
|
|
2282
|
-
_defineProperty(this, "config",
|
|
2281
|
+
_defineProperty(this, "request", undefined);
|
|
2282
|
+
_defineProperty(this, "config", undefined);
|
|
2283
2283
|
this.request = request;
|
|
2284
2284
|
this.config = config;
|
|
2285
2285
|
}
|
|
@@ -2318,8 +2318,8 @@ var GuildPermissions = /*#__PURE__*/function () {
|
|
|
2318
2318
|
var Interaction = /*#__PURE__*/function () {
|
|
2319
2319
|
function Interaction(request, config) {
|
|
2320
2320
|
_classCallCheck(this, Interaction);
|
|
2321
|
-
_defineProperty(this, "request",
|
|
2322
|
-
_defineProperty(this, "config",
|
|
2321
|
+
_defineProperty(this, "request", undefined);
|
|
2322
|
+
_defineProperty(this, "config", undefined);
|
|
2323
2323
|
this.request = request;
|
|
2324
2324
|
this.config = config;
|
|
2325
2325
|
}
|
|
@@ -2345,7 +2345,7 @@ var Interaction = /*#__PURE__*/function () {
|
|
|
2345
2345
|
}();
|
|
2346
2346
|
|
|
2347
2347
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2348
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t),
|
|
2348
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2349
2349
|
var apiVersion = 'v1';
|
|
2350
2350
|
var OpenAPI = /*#__PURE__*/function () {
|
|
2351
2351
|
function OpenAPI(config) {
|
|
@@ -2354,23 +2354,23 @@ var OpenAPI = /*#__PURE__*/function () {
|
|
|
2354
2354
|
appID: '',
|
|
2355
2355
|
token: ''
|
|
2356
2356
|
});
|
|
2357
|
-
_defineProperty(this, "guildApi",
|
|
2358
|
-
_defineProperty(this, "channelApi",
|
|
2359
|
-
_defineProperty(this, "meApi",
|
|
2360
|
-
_defineProperty(this, "messageApi",
|
|
2361
|
-
_defineProperty(this, "memberApi",
|
|
2362
|
-
_defineProperty(this, "roleApi",
|
|
2363
|
-
_defineProperty(this, "muteApi",
|
|
2364
|
-
_defineProperty(this, "announceApi",
|
|
2365
|
-
_defineProperty(this, "scheduleApi",
|
|
2366
|
-
_defineProperty(this, "threadsApi",
|
|
2367
|
-
_defineProperty(this, "directMessageApi",
|
|
2368
|
-
_defineProperty(this, "channelPermissionsApi",
|
|
2369
|
-
_defineProperty(this, "audioApi",
|
|
2370
|
-
_defineProperty(this, "reactionApi",
|
|
2371
|
-
_defineProperty(this, "interactionApi",
|
|
2372
|
-
_defineProperty(this, "pinsMessageApi",
|
|
2373
|
-
_defineProperty(this, "guildPermissionsApi",
|
|
2357
|
+
_defineProperty(this, "guildApi", undefined);
|
|
2358
|
+
_defineProperty(this, "channelApi", undefined);
|
|
2359
|
+
_defineProperty(this, "meApi", undefined);
|
|
2360
|
+
_defineProperty(this, "messageApi", undefined);
|
|
2361
|
+
_defineProperty(this, "memberApi", undefined);
|
|
2362
|
+
_defineProperty(this, "roleApi", undefined);
|
|
2363
|
+
_defineProperty(this, "muteApi", undefined);
|
|
2364
|
+
_defineProperty(this, "announceApi", undefined);
|
|
2365
|
+
_defineProperty(this, "scheduleApi", undefined);
|
|
2366
|
+
_defineProperty(this, "threadsApi", undefined);
|
|
2367
|
+
_defineProperty(this, "directMessageApi", undefined);
|
|
2368
|
+
_defineProperty(this, "channelPermissionsApi", undefined);
|
|
2369
|
+
_defineProperty(this, "audioApi", undefined);
|
|
2370
|
+
_defineProperty(this, "reactionApi", undefined);
|
|
2371
|
+
_defineProperty(this, "interactionApi", undefined);
|
|
2372
|
+
_defineProperty(this, "pinsMessageApi", undefined);
|
|
2373
|
+
_defineProperty(this, "guildPermissionsApi", undefined);
|
|
2374
2374
|
this.config = config;
|
|
2375
2375
|
this.register(this);
|
|
2376
2376
|
}
|
|
@@ -2419,13 +2419,13 @@ var OpenAPI = /*#__PURE__*/function () {
|
|
|
2419
2419
|
return result;
|
|
2420
2420
|
}, function (error) {
|
|
2421
2421
|
var _error$response, _error$response2;
|
|
2422
|
-
var traceid = error === null || error ===
|
|
2423
|
-
if (error !== null && error !==
|
|
2422
|
+
var traceid = error === null || error === undefined || (_error$response = error.response) === null || _error$response === undefined || (_error$response = _error$response.headers) === null || _error$response === undefined ? undefined : _error$response['x-tps-trace-id'];
|
|
2423
|
+
if (error !== null && error !== undefined && (_error$response2 = error.response) !== null && _error$response2 !== undefined && _error$response2.data) {
|
|
2424
2424
|
return Promise.reject(_objectSpread(_objectSpread({}, error.response.data), {}, {
|
|
2425
2425
|
traceid: traceid
|
|
2426
2426
|
}));
|
|
2427
2427
|
}
|
|
2428
|
-
if (error !== null && error !==
|
|
2428
|
+
if (error !== null && error !== undefined && error.response) {
|
|
2429
2429
|
return Promise.reject(_objectSpread(_objectSpread({}, error.response), {}, {
|
|
2430
2430
|
traceid: traceid
|
|
2431
2431
|
}));
|
|
@@ -2447,13 +2447,13 @@ function v1Setup() {
|
|
|
2447
2447
|
}
|
|
2448
2448
|
|
|
2449
2449
|
function _assertThisInitialized(e) {
|
|
2450
|
-
if (
|
|
2450
|
+
if (undefined === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2451
2451
|
return e;
|
|
2452
2452
|
}
|
|
2453
2453
|
|
|
2454
2454
|
function _possibleConstructorReturn(t, e) {
|
|
2455
2455
|
if (e && ("object" == _typeof$1(e) || "function" == typeof e)) return e;
|
|
2456
|
-
if (
|
|
2456
|
+
if (undefined !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
2457
2457
|
return _assertThisInitialized(t);
|
|
2458
2458
|
}
|
|
2459
2459
|
|
|
@@ -2474,11 +2474,11 @@ function _inherits(t, e) {
|
|
|
2474
2474
|
t.prototype = Object.create(e && e.prototype, {
|
|
2475
2475
|
constructor: {
|
|
2476
2476
|
value: t,
|
|
2477
|
-
writable:
|
|
2478
|
-
configurable:
|
|
2477
|
+
writable: true,
|
|
2478
|
+
configurable: true
|
|
2479
2479
|
}
|
|
2480
2480
|
}), Object.defineProperty(t, "prototype", {
|
|
2481
|
-
writable:
|
|
2481
|
+
writable: false
|
|
2482
2482
|
}), e && _setPrototypeOf(t, e);
|
|
2483
2483
|
}
|
|
2484
2484
|
|
|
@@ -2815,17 +2815,17 @@ var Properties = {
|
|
|
2815
2815
|
var Ws = /*#__PURE__*/function () {
|
|
2816
2816
|
function Ws(config, event, sessionRecord) {
|
|
2817
2817
|
_classCallCheck(this, Ws);
|
|
2818
|
-
_defineProperty(this, "ws",
|
|
2819
|
-
_defineProperty(this, "event",
|
|
2820
|
-
_defineProperty(this, "config",
|
|
2821
|
-
_defineProperty(this, "heartbeatInterval",
|
|
2818
|
+
_defineProperty(this, "ws", undefined);
|
|
2819
|
+
_defineProperty(this, "event", undefined);
|
|
2820
|
+
_defineProperty(this, "config", undefined);
|
|
2821
|
+
_defineProperty(this, "heartbeatInterval", undefined);
|
|
2822
2822
|
// 心跳参数,默认为心跳测试
|
|
2823
2823
|
_defineProperty(this, "heartbeatParam", {
|
|
2824
2824
|
op: OpCode.HEARTBEAT,
|
|
2825
2825
|
d: null // 心跳唯一值
|
|
2826
2826
|
});
|
|
2827
2827
|
// 是否是断线重连,如果是断线重连的话,不需要走鉴权
|
|
2828
|
-
_defineProperty(this, "isReconnect",
|
|
2828
|
+
_defineProperty(this, "isReconnect", undefined);
|
|
2829
2829
|
// 记录会话参数
|
|
2830
2830
|
_defineProperty(this, "sessionRecord", {
|
|
2831
2831
|
sessionID: '',
|
|
@@ -2871,10 +2871,10 @@ var Ws = /*#__PURE__*/function () {
|
|
|
2871
2871
|
// 先将消息解析
|
|
2872
2872
|
var wsRes = toObject(data);
|
|
2873
2873
|
// 先判断websocket连接是否成功
|
|
2874
|
-
if ((wsRes === null || wsRes ===
|
|
2874
|
+
if ((wsRes === null || wsRes === undefined ? undefined : wsRes.op) === OpCode.HELLO && wsRes !== null && wsRes !== undefined && (_wsRes$d = wsRes.d) !== null && _wsRes$d !== undefined && _wsRes$d.heartbeat_interval) {
|
|
2875
2875
|
var _wsRes$d2;
|
|
2876
2876
|
// websocket连接成功,拿到心跳周期
|
|
2877
|
-
_this.heartbeatInterval = wsRes === null || wsRes ===
|
|
2877
|
+
_this.heartbeatInterval = wsRes === null || wsRes === undefined || (_wsRes$d2 = wsRes.d) === null || _wsRes$d2 === undefined ? undefined : _wsRes$d2.heartbeat_interval;
|
|
2878
2878
|
// 非断线重连时,需要鉴权
|
|
2879
2879
|
_this.isReconnect ? _this.reconnectWs() : _this.authWs();
|
|
2880
2880
|
return;
|
|
@@ -3142,11 +3142,11 @@ var Ws = /*#__PURE__*/function () {
|
|
|
3142
3142
|
var Session = /*#__PURE__*/function () {
|
|
3143
3143
|
function Session(config, event, sessionRecord) {
|
|
3144
3144
|
_classCallCheck(this, Session);
|
|
3145
|
-
_defineProperty(this, "config",
|
|
3146
|
-
_defineProperty(this, "heartbeatInterval",
|
|
3147
|
-
_defineProperty(this, "ws",
|
|
3148
|
-
_defineProperty(this, "event",
|
|
3149
|
-
_defineProperty(this, "sessionRecord",
|
|
3145
|
+
_defineProperty(this, "config", undefined);
|
|
3146
|
+
_defineProperty(this, "heartbeatInterval", undefined);
|
|
3147
|
+
_defineProperty(this, "ws", undefined);
|
|
3148
|
+
_defineProperty(this, "event", undefined);
|
|
3149
|
+
_defineProperty(this, "sessionRecord", undefined);
|
|
3150
3150
|
this.config = config;
|
|
3151
3151
|
this.event = event;
|
|
3152
3152
|
// 如果会话记录存在的话,继续透传
|
|
@@ -3195,7 +3195,7 @@ var WebsocketClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
3195
3195
|
var _this;
|
|
3196
3196
|
_classCallCheck(this, WebsocketClient);
|
|
3197
3197
|
_this = _callSuper(this, WebsocketClient);
|
|
3198
|
-
_defineProperty(_this, "session",
|
|
3198
|
+
_defineProperty(_this, "session", undefined);
|
|
3199
3199
|
_defineProperty(_this, "retry", 0);
|
|
3200
3200
|
_this.connect(config);
|
|
3201
3201
|
_this.on(SessionEvents.EVENT_WS, function (data) {
|
|
@@ -3209,7 +3209,7 @@ var WebsocketClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
3209
3209
|
BotLogger.info('[CLIENT] 重新连接中,尝试次数:', _this.retry + 1);
|
|
3210
3210
|
_this.connect(config, (_WebsocketCloseReason = WebsocketCloseReason.find(function (v) {
|
|
3211
3211
|
return v.code === data.code;
|
|
3212
|
-
})) !== null && _WebsocketCloseReason !==
|
|
3212
|
+
})) !== null && _WebsocketCloseReason !== undefined && _WebsocketCloseReason.resume ? data.eventMsg : null);
|
|
3213
3213
|
_this.retry += 1;
|
|
3214
3214
|
} else {
|
|
3215
3215
|
BotLogger.info('[CLIENT] 超过重试次数,连接终止');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "woodenfish-bot",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.6",
|
|
4
4
|
"description": "woodenfish-bot",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@types/lodash.assignin": "^4.2.9",
|
|
51
51
|
"@types/node": "^22.10.5",
|
|
52
52
|
"@types/ws": "^8.5.13",
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^8.19.
|
|
54
|
-
"@typescript-eslint/parser": "^8.19.
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^8.19.1",
|
|
54
|
+
"@typescript-eslint/parser": "^8.19.1",
|
|
55
55
|
"chalk": "^5.4.1",
|
|
56
56
|
"commitizen": "^4.3.1",
|
|
57
57
|
"cross-env": "^7.0.3",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"prettier": "^3.4.2",
|
|
70
70
|
"readline-sync": "^1.4.10",
|
|
71
71
|
"rimraf": "^6.0.1",
|
|
72
|
-
"rollup": "^4.
|
|
72
|
+
"rollup": "^4.30.1",
|
|
73
73
|
"rollup-plugin-dts": "^6.1.1",
|
|
74
74
|
"rollup-plugin-typescript-paths": "^1.5.0",
|
|
75
75
|
"standard-version": "^9.5.0",
|