woodenfish-bot 4.1.6 → 4.1.7
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 +10 -10
- package/lib/index.js +10 -10
- package/package.json +8 -8
package/es/index.js
CHANGED
|
@@ -297,7 +297,7 @@ var Guild = /*#__PURE__*/function () {
|
|
|
297
297
|
}]);
|
|
298
298
|
}();
|
|
299
299
|
|
|
300
|
-
var version = "4.1.
|
|
300
|
+
var version = "4.1.7";
|
|
301
301
|
|
|
302
302
|
function getDefaultExportFromCjs (x) {
|
|
303
303
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -759,11 +759,11 @@ function getAccessToken(access_token_file, url, data, appID) {
|
|
|
759
759
|
var addAuthorization = /*#__PURE__*/function () {
|
|
760
760
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(header, appID, token, clientSecret, apiVersion) {
|
|
761
761
|
var now_time, url, data, access_token_file, default_token_json, access_token, expires_in, access_token_json;
|
|
762
|
-
return _regeneratorRuntime.wrap(function
|
|
762
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
763
763
|
while (1) switch (_context.prev = _context.next) {
|
|
764
764
|
case 0:
|
|
765
765
|
if (!(apiVersion == 'v2')) {
|
|
766
|
-
_context.next =
|
|
766
|
+
_context.next = 3;
|
|
767
767
|
break;
|
|
768
768
|
}
|
|
769
769
|
now_time = getTimeStampNumber();
|
|
@@ -799,22 +799,22 @@ var addAuthorization = /*#__PURE__*/function () {
|
|
|
799
799
|
}
|
|
800
800
|
// 判断access_token是否存在,不存在或者已经过期就重新获取
|
|
801
801
|
if (!(access_token === '' || now_time > expires_in - 50)) {
|
|
802
|
-
_context.next =
|
|
802
|
+
_context.next = 2;
|
|
803
803
|
break;
|
|
804
804
|
}
|
|
805
805
|
console.log('access_token', access_token, 'expire_time', expires_in);
|
|
806
|
-
_context.next =
|
|
806
|
+
_context.next = 1;
|
|
807
807
|
return getAccessToken(access_token_file, url, data, appID);
|
|
808
|
-
case
|
|
808
|
+
case 1:
|
|
809
809
|
access_token = _context.sent;
|
|
810
|
-
case
|
|
810
|
+
case 2:
|
|
811
811
|
// 更新header['Authorization']
|
|
812
812
|
header['Authorization'] = "QQBot ".concat(access_token);
|
|
813
|
-
_context.next =
|
|
813
|
+
_context.next = 4;
|
|
814
814
|
break;
|
|
815
|
-
case
|
|
815
|
+
case 3:
|
|
816
816
|
header['Authorization'] = "Bot ".concat(appID, ".").concat(token);
|
|
817
|
-
case
|
|
817
|
+
case 4:
|
|
818
818
|
case "end":
|
|
819
819
|
return _context.stop();
|
|
820
820
|
}
|
package/lib/index.js
CHANGED
|
@@ -299,7 +299,7 @@ var Guild = /*#__PURE__*/function () {
|
|
|
299
299
|
}]);
|
|
300
300
|
}();
|
|
301
301
|
|
|
302
|
-
var version = "4.1.
|
|
302
|
+
var version = "4.1.7";
|
|
303
303
|
|
|
304
304
|
function getDefaultExportFromCjs (x) {
|
|
305
305
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -761,11 +761,11 @@ function getAccessToken(access_token_file, url, data, appID) {
|
|
|
761
761
|
var addAuthorization = /*#__PURE__*/function () {
|
|
762
762
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(header, appID, token, clientSecret, apiVersion) {
|
|
763
763
|
var now_time, url, data, access_token_file, default_token_json, access_token, expires_in, access_token_json;
|
|
764
|
-
return _regeneratorRuntime.wrap(function
|
|
764
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
765
765
|
while (1) switch (_context.prev = _context.next) {
|
|
766
766
|
case 0:
|
|
767
767
|
if (!(apiVersion == 'v2')) {
|
|
768
|
-
_context.next =
|
|
768
|
+
_context.next = 3;
|
|
769
769
|
break;
|
|
770
770
|
}
|
|
771
771
|
now_time = getTimeStampNumber();
|
|
@@ -801,22 +801,22 @@ var addAuthorization = /*#__PURE__*/function () {
|
|
|
801
801
|
}
|
|
802
802
|
// 判断access_token是否存在,不存在或者已经过期就重新获取
|
|
803
803
|
if (!(access_token === '' || now_time > expires_in - 50)) {
|
|
804
|
-
_context.next =
|
|
804
|
+
_context.next = 2;
|
|
805
805
|
break;
|
|
806
806
|
}
|
|
807
807
|
console.log('access_token', access_token, 'expire_time', expires_in);
|
|
808
|
-
_context.next =
|
|
808
|
+
_context.next = 1;
|
|
809
809
|
return getAccessToken(access_token_file, url, data, appID);
|
|
810
|
-
case
|
|
810
|
+
case 1:
|
|
811
811
|
access_token = _context.sent;
|
|
812
|
-
case
|
|
812
|
+
case 2:
|
|
813
813
|
// 更新header['Authorization']
|
|
814
814
|
header['Authorization'] = "QQBot ".concat(access_token);
|
|
815
|
-
_context.next =
|
|
815
|
+
_context.next = 4;
|
|
816
816
|
break;
|
|
817
|
-
case
|
|
817
|
+
case 3:
|
|
818
818
|
header['Authorization'] = "Bot ".concat(appID, ".").concat(token);
|
|
819
|
-
case
|
|
819
|
+
case 4:
|
|
820
820
|
case "end":
|
|
821
821
|
return _context.stop();
|
|
822
822
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "woodenfish-bot",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.7",
|
|
4
4
|
"description": "woodenfish-bot",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"linkdev": "node scripts/dev.js"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@babel/core": "^7.
|
|
34
|
-
"@babel/generator": "^7.
|
|
35
|
-
"@babel/parser": "^7.
|
|
33
|
+
"@babel/core": "^7.28.0",
|
|
34
|
+
"@babel/generator": "^7.28.0",
|
|
35
|
+
"@babel/parser": "^7.28.0",
|
|
36
36
|
"@babel/plugin-transform-class-properties": "^7.27.1",
|
|
37
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
38
|
-
"@babel/preset-env": "^7.
|
|
37
|
+
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
38
|
+
"@babel/preset-env": "^7.28.0",
|
|
39
39
|
"@babel/preset-typescript": "^7.27.1",
|
|
40
|
-
"@babel/traverse": "^7.
|
|
41
|
-
"@babel/types": "^7.
|
|
40
|
+
"@babel/traverse": "^7.28.0",
|
|
41
|
+
"@babel/types": "^7.28.0",
|
|
42
42
|
"@commitlint/cli": "^19.8.1",
|
|
43
43
|
"@commitlint/config-conventional": "^19.8.1",
|
|
44
44
|
"@rollup/plugin-babel": "^6.0.4",
|