@kotori-bot/core 1.6.5 → 1.7.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.
Files changed (71) hide show
  1. package/{LICENSE → LICENSE.md} +674 -674
  2. package/lib/app/common.js +8 -10
  3. package/lib/app/config.js +9 -10
  4. package/lib/app/core.js +8 -10
  5. package/lib/app/index.js +8 -10
  6. package/lib/app/message.js +17 -19
  7. package/lib/components/adapter.js +8 -10
  8. package/lib/components/api.js +18 -16
  9. package/lib/components/cache.js +8 -10
  10. package/lib/components/command.js +8 -10
  11. package/lib/components/elements.js +8 -10
  12. package/lib/components/filter.js +8 -10
  13. package/lib/components/index.js +8 -10
  14. package/lib/components/messages.js +8 -10
  15. package/lib/components/session.js +27 -17
  16. package/lib/decorators/index.js +8 -10
  17. package/lib/decorators/plugin.js +8 -10
  18. package/lib/decorators/utils.js +14 -12
  19. package/lib/global/constants.js +8 -10
  20. package/lib/global/index.js +8 -10
  21. package/lib/global/symbols.js +8 -10
  22. package/lib/index.js +23 -23
  23. package/lib/types/adapter.js +8 -10
  24. package/lib/types/api.js +8 -10
  25. package/lib/types/command.js +8 -10
  26. package/lib/types/config.js +8 -10
  27. package/lib/types/events.js +8 -10
  28. package/lib/types/filter.js +8 -10
  29. package/lib/types/index.js +8 -10
  30. package/lib/types/message.js +8 -10
  31. package/lib/types/session.js +8 -10
  32. package/lib/utils/container.js +8 -10
  33. package/lib/utils/error.js +8 -10
  34. package/lib/utils/factory.js +10 -11
  35. package/lib/utils/internal.js +8 -10
  36. package/lib/utils/jsx.js +97 -0
  37. package/package.json +5 -4
  38. package/lib/app/common.d.ts +0 -6
  39. package/lib/app/config.d.ts +0 -32
  40. package/lib/app/core.d.ts +0 -139
  41. package/lib/app/index.d.ts +0 -3
  42. package/lib/app/message.d.ts +0 -34
  43. package/lib/components/adapter.d.ts +0 -122
  44. package/lib/components/api.d.ts +0 -417
  45. package/lib/components/cache.d.ts +0 -37
  46. package/lib/components/command.d.ts +0 -153
  47. package/lib/components/elements.d.ts +0 -144
  48. package/lib/components/filter.d.ts +0 -22
  49. package/lib/components/index.d.ts +0 -8
  50. package/lib/components/messages.d.ts +0 -186
  51. package/lib/components/session.d.ts +0 -177
  52. package/lib/decorators/index.d.ts +0 -7
  53. package/lib/decorators/plugin.d.ts +0 -7
  54. package/lib/decorators/utils.d.ts +0 -60
  55. package/lib/global/constants.d.ts +0 -8
  56. package/lib/global/index.d.ts +0 -2
  57. package/lib/global/symbols.d.ts +0 -15
  58. package/lib/index.d.ts +0 -12
  59. package/lib/types/adapter.d.ts +0 -22
  60. package/lib/types/api.d.ts +0 -72
  61. package/lib/types/command.d.ts +0 -78
  62. package/lib/types/config.d.ts +0 -21
  63. package/lib/types/events.d.ts +0 -3
  64. package/lib/types/filter.d.ts +0 -51
  65. package/lib/types/index.d.ts +0 -7
  66. package/lib/types/message.d.ts +0 -176
  67. package/lib/types/session.d.ts +0 -349
  68. package/lib/utils/container.d.ts +0 -9
  69. package/lib/utils/error.d.ts +0 -49
  70. package/lib/utils/factory.d.ts +0 -12
  71. package/lib/utils/internal.d.ts +0 -46
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
package/lib/index.js CHANGED
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -24,25 +22,27 @@ var __copyProps = (to, from, except, desc) => {
24
22
  };
25
23
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
26
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var src_exports = {};
28
- module.exports = __toCommonJS(src_exports);
25
+ var index_exports = {};
26
+ module.exports = __toCommonJS(index_exports);
29
27
  var import_reflect_metadata = require("reflect-metadata");
30
- __reExport(src_exports, require("./app"), module.exports);
31
- __reExport(src_exports, require("./components"), module.exports);
32
- __reExport(src_exports, require("./decorators"), module.exports);
33
- __reExport(src_exports, require("./utils/error"), module.exports);
34
- __reExport(src_exports, require("./utils/factory"), module.exports);
35
- __reExport(src_exports, require("./utils/container"), module.exports);
36
- __reExport(src_exports, require("./global"), module.exports);
37
- __reExport(src_exports, require("./types"), module.exports);
38
- __reExport(src_exports, require("@kotori-bot/tools"), module.exports);
39
- __reExport(src_exports, require("@kotori-bot/i18n"), module.exports);
40
- __reExport(src_exports, require("tsukiko"), module.exports);
28
+ __reExport(index_exports, require("./app"), module.exports);
29
+ __reExport(index_exports, require("./components"), module.exports);
30
+ __reExport(index_exports, require("./decorators"), module.exports);
31
+ __reExport(index_exports, require("./utils/jsx"), module.exports);
32
+ __reExport(index_exports, require("./utils/error"), module.exports);
33
+ __reExport(index_exports, require("./utils/factory"), module.exports);
34
+ __reExport(index_exports, require("./utils/container"), module.exports);
35
+ __reExport(index_exports, require("./global"), module.exports);
36
+ __reExport(index_exports, require("./types"), module.exports);
37
+ __reExport(index_exports, require("@kotori-bot/tools"), module.exports);
38
+ __reExport(index_exports, require("@kotori-bot/i18n"), module.exports);
39
+ __reExport(index_exports, require("tsukiko"), module.exports);
41
40
  // Annotate the CommonJS export names for ESM import in node:
42
41
  0 && (module.exports = {
43
42
  ...require("./app"),
44
43
  ...require("./components"),
45
44
  ...require("./decorators"),
45
+ ...require("./utils/jsx"),
46
46
  ...require("./utils/error"),
47
47
  ...require("./utils/factory"),
48
48
  ...require("./utils/container"),
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
package/lib/types/api.js CHANGED
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __create = Object.create;
14
12
  var __defProp = Object.defineProperty;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __create = Object.create;
14
12
  var __defProp = Object.defineProperty;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -32,9 +30,10 @@ __export(factory_exports, {
32
30
  formatFactory: () => formatFactory
33
31
  });
34
32
  module.exports = __toCommonJS(factory_exports);
33
+ var import_i18n = require("@kotori-bot/i18n");
35
34
  var import_tools = require("@kotori-bot/tools");
36
35
  var import_components = require("../components");
37
- function formatFactory(i18n) {
36
+ function formatFactory(i18n = new import_i18n.I18n()) {
38
37
  function format(template, data) {
39
38
  if (!Array.isArray(data)) {
40
39
  for (const key of Object.keys(data)) {
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.4
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/17 11:57:41
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.1
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License GPL-3.0
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 2026/2/14 00:45:33
9
+ */
10
+ "use strict";
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var jsx_exports = {};
29
+ __export(jsx_exports, {
30
+ hRes: () => hRes,
31
+ hTs: () => hTs
32
+ });
33
+ module.exports = __toCommonJS(jsx_exports);
34
+ var import_factory = require("../utils/factory");
35
+ var import_messages = require("../components/messages");
36
+ const Fragment = Symbol("Fragment");
37
+ function hTs(type, props, ...children) {
38
+ if (type === Fragment) return hTs("list", props, ...children);
39
+ if (typeof type === "function") return type(Object.assign({}, props, { children }));
40
+ const flattenedChildren = children.flat(Number.MAX_SAFE_INTEGER).filter((child) => child != null && child !== false && child !== true);
41
+ switch (type) {
42
+ case "text":
43
+ return import_messages.Messages.text(flattenedChildren.map((child) => String(child)).join(""));
44
+ case "mention":
45
+ return import_messages.Messages.mention(props.userId);
46
+ case "mentionAll":
47
+ return import_messages.Messages.mentionAll();
48
+ case "reply":
49
+ return import_messages.Messages.reply(props.messageId);
50
+ case "image":
51
+ return import_messages.Messages.image(props.src);
52
+ case "audio":
53
+ return import_messages.Messages.audio(props.src);
54
+ case "video":
55
+ return import_messages.Messages.video(props.src);
56
+ case "file":
57
+ return import_messages.Messages.file(props.src);
58
+ case "location":
59
+ const locationProps = props;
60
+ return import_messages.Messages.location(
61
+ locationProps.latitude,
62
+ locationProps.longitude,
63
+ locationProps.title,
64
+ locationProps.content
65
+ );
66
+ case "seg":
67
+ return (0, import_messages.Messages)(
68
+ ...flattenedChildren.map(
69
+ (child) => child instanceof import_messages.MessageSingle || child instanceof import_messages.MessageList ? child : child && typeof child === "object" && "type" in child ? hTs(child.type, child.props, child.children) : String(child)
70
+ )
71
+ );
72
+ case "br":
73
+ return hTs("text", {}, "\n");
74
+ case "format":
75
+ return (0, import_factory.formatFactory)()(
76
+ props.template,
77
+ flattenedChildren
78
+ );
79
+ default:
80
+ throw new Error(`Unknown element type: ${type}`);
81
+ }
82
+ }
83
+ function hRes(type, props) {
84
+ return hTs(
85
+ type,
86
+ props,
87
+ ..."children" in props ? Array.isArray(props.children) ? props.children : [props.children] : []
88
+ );
89
+ }
90
+ ;
91
+ globalThis.kotoriHTs = hTs;
92
+ globalThis.kotoriHRes = hRes;
93
+ // Annotate the CommonJS export names for ESM import in node:
94
+ 0 && (module.exports = {
95
+ hRes,
96
+ hTs
97
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kotori-bot/core",
3
- "version": "1.6.5",
3
+ "version": "1.7.1",
4
4
  "description": "Kotori Core",
5
5
  "main": "lib/index.js",
6
6
  "license": "GPL-3.0",
@@ -25,12 +25,13 @@
25
25
  "homepage": "https://kotori.js.org",
26
26
  "dependencies": {
27
27
  "cron": "^3.1.7",
28
+ "fast-safe-stringify": "^2.1.1",
28
29
  "minimist": "^1.2.8",
29
30
  "reflect-metadata": "^0.2.2",
30
31
  "tsukiko": "^1.4.2",
31
- "@kotori-bot/i18n": "^1.3.2",
32
- "@kotori-bot/tools": "^1.5.1",
33
- "fluoro": "^1.1.1"
32
+ "@kotori-bot/i18n": "^1.3.3",
33
+ "fluoro": "^1.1.1",
34
+ "@kotori-bot/tools": "^1.5.2"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@types/minimist": "^1.2.5"
@@ -1,6 +0,0 @@
1
- import type Context from './core';
2
- import { Service as FluoroService, type EventsList as FluoroEventsList } from 'fluoro';
3
- import type { EventsMapping } from '../types/events';
4
- export type EventsList = FluoroEventsList<EventsMapping>;
5
- export type Service<T extends object = object> = FluoroService<T, Context>;
6
- export declare const Service: new <T extends object = object>(ctx: Context, config: T, identity: string) => Service<T>;
@@ -1,32 +0,0 @@
1
- import type { CoreConfig } from '../types';
2
- /** Meta information. */
3
- interface MetaInfo {
4
- /** Program name */
5
- name: string;
6
- /** Program core version */
7
- coreVersion: string;
8
- /** Program loader version if exists */
9
- loaderVersion?: string;
10
- /** Program version if exists */
11
- version?: string;
12
- /** Program description */
13
- description: string;
14
- /** Program entry file */
15
- main: string;
16
- /**
17
- * Program license
18
- *
19
- * @constant
20
- */
21
- license: 'GPL-3.0';
22
- /** Program author */
23
- author: string;
24
- }
25
- export declare class Config {
26
- readonly config: CoreConfig;
27
- readonly meta: MetaInfo;
28
- constructor(config?: Omit<Partial<CoreConfig>, 'global'> & {
29
- global?: Partial<CoreConfig['global']>;
30
- });
31
- }
32
- export default Config;