@kotori-bot/core 1.5.0 → 1.5.1
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/components/config.js +8 -39
- package/lib/components/core.js +16 -786
- package/lib/components/index.js +6 -830
- package/lib/components/message.js +39 -686
- package/lib/global/constants.js +9 -11
- package/lib/global/index.js +7 -55
- package/lib/global/symbols.js +4 -6
- package/lib/index.js +20 -835
- package/lib/service/adapter.js +23 -739
- package/lib/service/api.js +4 -6
- package/lib/service/cache.js +4 -6
- package/lib/service/elements.js +5 -7
- package/lib/service/index.js +10 -822
- package/lib/types/adapter.js +2 -4
- package/lib/types/config.js +2 -4
- package/lib/types/index.js +9 -47
- package/lib/types/message.js +4 -6
- package/lib/utils/command.js +19 -63
- package/lib/utils/commandError.js +5 -33
- package/lib/utils/container.js +5 -7
- package/lib/utils/error.js +7 -9
- package/lib/utils/factory.js +13 -728
- package/lib/utils/jsxFactory.js +2 -4
- package/package.json +3 -3
package/lib/service/api.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/core
|
|
4
|
-
* @Version 1.
|
|
4
|
+
* @Version 1.5.0
|
|
5
5
|
* @Author Hotaru <biyuehuya@gmail.com>
|
|
6
6
|
* @Copyright 2024 Hotaru. All rights reserved.
|
|
7
7
|
* @License GPL-3.0
|
|
8
8
|
* @Link https://github.com/kotorijs/kotori
|
|
9
|
-
* @Date 2024/6/
|
|
9
|
+
* @Date 2024/6/7 11:22:22
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
|
@@ -27,8 +27,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
27
27
|
return to;
|
|
28
28
|
};
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/service/api.ts
|
|
32
30
|
var api_exports = {};
|
|
33
31
|
__export(api_exports, {
|
|
34
32
|
Api: () => Api,
|
|
@@ -36,7 +34,7 @@ __export(api_exports, {
|
|
|
36
34
|
});
|
|
37
35
|
module.exports = __toCommonJS(api_exports);
|
|
38
36
|
var import_tools = require("@kotori-bot/tools");
|
|
39
|
-
|
|
37
|
+
class Api {
|
|
40
38
|
adapter;
|
|
41
39
|
constructor(adapter) {
|
|
42
40
|
this.adapter = adapter;
|
|
@@ -74,7 +72,7 @@ var Api = class {
|
|
|
74
72
|
setGroupLeave(groupId, ...extra) {
|
|
75
73
|
(0, import_tools.none)(this, groupId, groupId, extra);
|
|
76
74
|
}
|
|
77
|
-
}
|
|
75
|
+
}
|
|
78
76
|
var api_default = Api;
|
|
79
77
|
// Annotate the CommonJS export names for ESM import in node:
|
|
80
78
|
0 && (module.exports = {
|
package/lib/service/cache.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/core
|
|
4
|
-
* @Version 1.
|
|
4
|
+
* @Version 1.5.0
|
|
5
5
|
* @Author Hotaru <biyuehuya@gmail.com>
|
|
6
6
|
* @Copyright 2024 Hotaru. All rights reserved.
|
|
7
7
|
* @License GPL-3.0
|
|
8
8
|
* @Link https://github.com/kotorijs/kotori
|
|
9
|
-
* @Date 2024/6/
|
|
9
|
+
* @Date 2024/6/7 11:22:22
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
|
@@ -27,8 +27,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
27
27
|
return to;
|
|
28
28
|
};
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/service/cache.ts
|
|
32
30
|
var cache_exports = {};
|
|
33
31
|
__export(cache_exports, {
|
|
34
32
|
Cache: () => Cache,
|
|
@@ -36,7 +34,7 @@ __export(cache_exports, {
|
|
|
36
34
|
});
|
|
37
35
|
module.exports = __toCommonJS(cache_exports);
|
|
38
36
|
var import_fluoro = require("fluoro");
|
|
39
|
-
|
|
37
|
+
class Cache extends import_fluoro.Service {
|
|
40
38
|
cache;
|
|
41
39
|
constructor(ctx) {
|
|
42
40
|
super(ctx, {}, "cache");
|
|
@@ -61,7 +59,7 @@ var Cache = class extends import_fluoro.Service {
|
|
|
61
59
|
set(prop, value) {
|
|
62
60
|
this.getContainer().set(prop, value);
|
|
63
61
|
}
|
|
64
|
-
}
|
|
62
|
+
}
|
|
65
63
|
var cache_default = Cache;
|
|
66
64
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
65
|
0 && (module.exports = {
|
package/lib/service/elements.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/core
|
|
4
|
-
* @Version 1.
|
|
4
|
+
* @Version 1.5.0
|
|
5
5
|
* @Author Hotaru <biyuehuya@gmail.com>
|
|
6
6
|
* @Copyright 2024 Hotaru. All rights reserved.
|
|
7
7
|
* @License GPL-3.0
|
|
8
8
|
* @Link https://github.com/kotorijs/kotori
|
|
9
|
-
* @Date 2024/6/
|
|
9
|
+
* @Date 2024/6/7 11:22:22
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
|
@@ -27,8 +27,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
27
27
|
return to;
|
|
28
28
|
};
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/service/elements.ts
|
|
32
30
|
var elements_exports = {};
|
|
33
31
|
__export(elements_exports, {
|
|
34
32
|
Elements: () => Elements,
|
|
@@ -36,7 +34,7 @@ __export(elements_exports, {
|
|
|
36
34
|
});
|
|
37
35
|
module.exports = __toCommonJS(elements_exports);
|
|
38
36
|
var import_tools = require("@kotori-bot/tools");
|
|
39
|
-
|
|
37
|
+
class Elements {
|
|
40
38
|
default(...args) {
|
|
41
39
|
(0, import_tools.none)(this, args);
|
|
42
40
|
return "";
|
|
@@ -63,11 +61,11 @@ var Elements = class _Elements {
|
|
|
63
61
|
const supports = [];
|
|
64
62
|
const keys = ["at", "image", "voice", "video", "face", "file"];
|
|
65
63
|
keys.forEach((key) => {
|
|
66
|
-
if (this[key] !== new
|
|
64
|
+
if (this[key] !== new Elements()[key]) supports.push(key);
|
|
67
65
|
});
|
|
68
66
|
return supports;
|
|
69
67
|
}
|
|
70
|
-
}
|
|
68
|
+
}
|
|
71
69
|
var elements_default = Elements;
|
|
72
70
|
// Annotate the CommonJS export names for ESM import in node:
|
|
73
71
|
0 && (module.exports = {
|