@kotori-bot/core 1.6.0 → 1.6.2

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 (47) hide show
  1. package/lib/app/config.js +2 -2
  2. package/lib/app/core.d.ts +127 -122
  3. package/lib/app/core.js +19 -4
  4. package/lib/app/index.js +2 -2
  5. package/lib/app/message.d.ts +1 -1
  6. package/lib/app/message.js +2 -2
  7. package/lib/components/adapter.d.ts +2 -2
  8. package/lib/components/adapter.js +2 -2
  9. package/lib/components/api.js +2 -2
  10. package/lib/components/cache.d.ts +2 -2
  11. package/lib/components/cache.js +4 -4
  12. package/lib/components/command.js +2 -2
  13. package/lib/components/elements.js +2 -2
  14. package/lib/components/filter.js +2 -2
  15. package/lib/components/index.js +2 -2
  16. package/lib/components/messages.js +2 -2
  17. package/lib/components/session.js +2 -2
  18. package/lib/decorators/index.js +2 -2
  19. package/lib/decorators/plugin.d.ts +1 -1
  20. package/lib/decorators/plugin.js +2 -2
  21. package/lib/decorators/utils.d.ts +3 -2
  22. package/lib/decorators/utils.js +2 -2
  23. package/lib/global/constants.js +2 -2
  24. package/lib/global/index.js +2 -2
  25. package/lib/global/symbols.js +2 -2
  26. package/lib/index.d.ts +0 -1
  27. package/lib/index.js +2 -4
  28. package/lib/types/adapter.d.ts +2 -2
  29. package/lib/types/adapter.js +2 -2
  30. package/lib/types/api.js +2 -2
  31. package/lib/types/command.js +2 -2
  32. package/lib/types/config.js +2 -2
  33. package/lib/types/events.d.ts +3 -0
  34. package/lib/types/events.js +27 -0
  35. package/lib/types/filter.js +2 -2
  36. package/lib/types/index.js +2 -2
  37. package/lib/types/message.d.ts +2 -2
  38. package/lib/types/message.js +2 -2
  39. package/lib/types/session.d.ts +1 -1
  40. package/lib/types/session.js +2 -2
  41. package/lib/utils/container.d.ts +1 -1
  42. package/lib/utils/container.js +2 -2
  43. package/lib/utils/error.js +2 -2
  44. package/lib/utils/factory.d.ts +2 -2
  45. package/lib/utils/factory.js +2 -2
  46. package/lib/utils/internal.js +2 -2
  47. package/package.json +3 -3
package/lib/app/config.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
package/lib/app/core.d.ts CHANGED
@@ -1,138 +1,143 @@
1
1
  import { Http } from '@kotori-bot/tools';
2
2
  import I18n from '@kotori-bot/i18n';
3
3
  import type { Parser } from 'tsukiko';
4
- import Context from 'fluoro';
4
+ import FluoroContext, { Service as FluoroService, type EventsList as FluoroEventsList } from 'fluoro';
5
5
  import Config from './config';
6
6
  import Message from './message';
7
7
  import type { AdapterClass } from '../types';
8
8
  import { Cache, type Api } from '../components';
9
9
  import { Symbols } from '../global';
10
- declare module 'fluoro' {
11
- interface Context {
12
- /**
13
- * Adapter constructors list.
14
- *
15
- * @readonly
16
- */
17
- readonly [Symbols.adapter]: Core[typeof Symbols.adapter];
18
- /**
19
- * Bot instances list.
20
- *
21
- * @readonly
22
- */
23
- readonly [Symbols.bot]: Core[typeof Symbols.bot];
24
- /**
25
- * Core config.
26
- *
27
- * @readonly
28
- */
29
- readonly config: Config['config'];
30
- /**
31
- * Meta information.
32
- *
33
- * @readonly
34
- */
35
- readonly meta: Config['meta'];
36
- /**
37
- * Registered middlewares list.
38
- *
39
- * @readonly
40
- */
41
- readonly [Symbols.midware]: Message[typeof Symbols.midware];
42
- /**
43
- * Registered commands list.
44
- *
45
- * @readonly
46
- */
47
- readonly [Symbols.command]: Message[typeof Symbols.command];
48
- /**
49
- * Registered regexps list.
50
- *
51
- * @readonly
52
- */
53
- readonly [Symbols.regexp]: Message[typeof Symbols.regexp];
54
- /**
55
- * Registered scheduled tasks list.
56
- *
57
- * @readonly
58
- */
59
- readonly [Symbols.task]: Message[typeof Symbols.task];
60
- /**
61
- * Registered session filters list.
62
- *
63
- * @readonly
64
- */
65
- readonly [Symbols.filter]: Message[typeof Symbols.filter];
66
- /**
67
- * Session promises in progress list.
68
- *
69
- * @readonly
70
- */
71
- readonly [Symbols.promise]: Message[typeof Symbols.promise];
72
- /**
73
- * Register a message handled middleware.
74
- *
75
- * @param callback - Middleware callback
76
- * @param priority - Middleware priority, default is 100
77
- * @returns dispose function
78
- */
79
- midware: Message['midware'];
80
- /**
81
- * Register a command.
82
- *
83
- * @param template - Command template
84
- * @param config - Command config, optional
85
- * @returns Command instance
86
- */
87
- command: Message['command'];
88
- /**
89
- * Register a regexp.
90
- *
91
- * @param match - Regexp to match
92
- * @param callback - Regexp callback
93
- * @returns dispose function
94
- */
95
- regexp: Message['regexp'];
96
- /**
97
- * Register a scheduled task.
98
- *
99
- * @param options - Task options
100
- * @param callback - Task callback
101
- * @returns dispose function
102
- */
103
- task: Message['task'];
104
- /**
105
- * Register a session filter.
106
- *
107
- * @param option - Filter option
108
- * @returns new context
109
- */
110
- filter: Message['filter'];
111
- /**
112
- * Send a notified message to the master of first bot instance at config.
113
- *
114
- * @experimental
115
- */
116
- notify: Message['notify'];
117
- /**
118
- * Send a message to all sessions on all bots.
119
- *
120
- * @experimental
121
- */
122
- boardcast: Message['boardcast'];
123
- /** Http request methods */
124
- http: Http;
125
- /** International methods */
126
- i18n: I18n;
127
- /** Cache service */
128
- cache: Cache;
129
- }
10
+ import type { EventsMapping } from '../types/events';
11
+ export * from 'fluoro';
12
+ export type EventsList = FluoroEventsList<EventsMapping>;
13
+ export interface Context {
14
+ /**
15
+ * Adapter constructors list.
16
+ *
17
+ * @readonly
18
+ */
19
+ readonly [Symbols.adapter]: Context[typeof Symbols.adapter];
20
+ /**
21
+ * Bot instances list.
22
+ *
23
+ * @readonly
24
+ */
25
+ readonly [Symbols.bot]: Context[typeof Symbols.bot];
26
+ /**
27
+ * Core config.
28
+ *
29
+ * @readonly
30
+ */
31
+ readonly config: Config['config'];
32
+ /**
33
+ * Meta information.
34
+ *
35
+ * @readonly
36
+ */
37
+ readonly meta: Config['meta'];
38
+ /**
39
+ * Registered middlewares list.
40
+ *
41
+ * @readonly
42
+ */
43
+ readonly [Symbols.midware]: Message[typeof Symbols.midware];
44
+ /**
45
+ * Registered commands list.
46
+ *
47
+ * @readonly
48
+ */
49
+ readonly [Symbols.command]: Message[typeof Symbols.command];
50
+ /**
51
+ * Registered regexps list.
52
+ *
53
+ * @readonly
54
+ */
55
+ readonly [Symbols.regexp]: Message[typeof Symbols.regexp];
56
+ /**
57
+ * Registered scheduled tasks list.
58
+ *
59
+ * @readonly
60
+ */
61
+ readonly [Symbols.task]: Message[typeof Symbols.task];
62
+ /**
63
+ * Registered session filters list.
64
+ *
65
+ * @readonly
66
+ */
67
+ readonly [Symbols.filter]: Message[typeof Symbols.filter];
68
+ /**
69
+ * Session promises in progress list.
70
+ *
71
+ * @readonly
72
+ */
73
+ readonly [Symbols.promise]: Message[typeof Symbols.promise];
74
+ /**
75
+ * Register a message handled middleware.
76
+ *
77
+ * @param callback - Middleware callback
78
+ * @param priority - Middleware priority, default is 100
79
+ * @returns dispose function
80
+ */
81
+ midware: Message['midware'];
82
+ /**
83
+ * Register a command.
84
+ *
85
+ * @param template - Command template
86
+ * @param config - Command config, optional
87
+ * @returns Command instance
88
+ */
89
+ command: Message['command'];
90
+ /**
91
+ * Register a regexp.
92
+ *
93
+ * @param match - Regexp to match
94
+ * @param callback - Regexp callback
95
+ * @returns dispose function
96
+ */
97
+ regexp: Message['regexp'];
98
+ /**
99
+ * Register a scheduled task.
100
+ *
101
+ * @param options - Task options
102
+ * @param callback - Task callback
103
+ * @returns dispose function
104
+ */
105
+ task: Message['task'];
106
+ /**
107
+ * Register a session filter.
108
+ *
109
+ * @param option - Filter option
110
+ * @returns new context
111
+ */
112
+ filter: Message['filter'];
113
+ /**
114
+ * Send a notified message to the master of first bot instance at config.
115
+ *
116
+ * @experimental
117
+ */
118
+ notify: Message['notify'];
119
+ /**
120
+ * Send a message to all sessions on all bots.
121
+ *
122
+ * @experimental
123
+ */
124
+ boardcast: Message['boardcast'];
125
+ /** Http request methods */
126
+ http: Http;
127
+ /** International methods */
128
+ i18n: I18n;
129
+ /** Cache service */
130
+ cache: Cache;
130
131
  }
131
- export declare class Core extends Context {
132
+ export declare class Context extends FluoroContext<EventsMapping> implements Context {
132
133
  readonly [Symbols.adapter]: Map<string, [AdapterClass, Parser<unknown>?]>;
133
134
  readonly [Symbols.bot]: Map<string, Set<Api>>;
134
135
  constructor(config?: ConstructorParameters<typeof Config>[0]);
135
136
  start(): void;
136
137
  stop(): void;
137
138
  }
139
+ export type Core = Context;
140
+ export declare const Core: typeof Context;
141
+ export type Service<T extends object = object> = FluoroService<T, Context>;
142
+ export declare const Service: new <T extends object = object>(ctx: Context, config: T, identity: string) => Service<T>;
138
143
  export default Core;
package/lib/app/core.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -28,6 +28,7 @@ var __copyProps = (to, from, except, desc) => {
28
28
  }
29
29
  return to;
30
30
  };
31
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
31
32
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
32
33
  // If the importer is in node compatibility mode or this is not an ESM
33
34
  // file that has been converted to a CommonJS file using a Babel-
@@ -39,7 +40,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
40
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
41
  var core_exports = {};
41
42
  __export(core_exports, {
43
+ Context: () => Context,
42
44
  Core: () => Core,
45
+ Service: () => Service,
43
46
  default: () => core_default
44
47
  });
45
48
  module.exports = __toCommonJS(core_exports);
@@ -50,7 +53,8 @@ var import_config = __toESM(require("./config"));
50
53
  var import_message = __toESM(require("./message"));
51
54
  var import_components = require("../components");
52
55
  var import_global = require("../global");
53
- class Core extends import_fluoro.default {
56
+ __reExport(core_exports, require("fluoro"), module.exports);
57
+ class Context extends import_fluoro.default {
54
58
  [import_global.Symbols.adapter] = /* @__PURE__ */ new Map();
55
59
  [import_global.Symbols.bot] = /* @__PURE__ */ new Map();
56
60
  constructor(config) {
@@ -79,9 +83,20 @@ class Core extends import_fluoro.default {
79
83
  this.inject("i18n");
80
84
  this.service("cache", new import_components.Cache(this.extends("cache")));
81
85
  }
86
+ start() {
87
+ this.emit("ready");
88
+ }
89
+ stop() {
90
+ this.emit("dispose");
91
+ }
82
92
  }
93
+ const Core = Context;
94
+ const Service = import_fluoro.Service;
83
95
  var core_default = Core;
84
96
  // Annotate the CommonJS export names for ESM import in node:
85
97
  0 && (module.exports = {
86
- Core
98
+ Context,
99
+ Core,
100
+ Service,
101
+ ...require("fluoro")
87
102
  });
package/lib/app/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,8 +1,8 @@
1
- import type { Context } from 'fluoro';
2
1
  import { CronJob } from 'cron';
3
2
  import { type CommandConfig, type MidwareCallback, type RegexpCallback, type TaskCallback, type FilterOption, type TaskOptions } from '../types';
4
3
  import { Filter, Command, type SessionMsg } from '../components';
5
4
  import { Symbols } from '../global';
5
+ import type { Context } from './core';
6
6
  interface MidwareData {
7
7
  callback: MidwareCallback;
8
8
  priority: number;
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,9 +1,9 @@
1
- import type { Context, EventsList } from 'fluoro';
2
1
  import type Api from './api';
3
2
  import type { AdapterConfig, EventDataApiBase } from '../types';
4
3
  import type Elements from './elements';
5
4
  import { Session } from './session';
6
- export type EventApiType = {
5
+ import type { EventsList, Context } from '../app';
6
+ type EventApiType = {
7
7
  [K in keyof EventsList]: EventsList[K] extends EventDataApiBase ? EventsList[K] : never;
8
8
  };
9
9
  /** Bot Status */
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,4 +1,4 @@
1
- import { Service } from 'fluoro';
1
+ import { Service, type Context } from '../app';
2
2
  type CacheKey = string | symbol | number;
3
3
  type CacheValue = string | number | object;
4
4
  type Container = Map<CacheKey, CacheValue>;
@@ -10,7 +10,7 @@ type Container = Map<CacheKey, CacheValue>;
10
10
  */
11
11
  export declare class Cache extends Service {
12
12
  private cache?;
13
- constructor(ctx: ConstructorParameters<typeof Service>[0]);
13
+ constructor(ctx: Context);
14
14
  start(): void;
15
15
  stop(): void;
16
16
  /**
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -33,9 +33,9 @@ __export(cache_exports, {
33
33
  default: () => cache_default
34
34
  });
35
35
  module.exports = __toCommonJS(cache_exports);
36
- var import_fluoro = require("fluoro");
37
36
  var import_error = require("../utils/error");
38
- class Cache extends import_fluoro.Service {
37
+ var import_app = require("../app");
38
+ class Cache extends import_app.Service {
39
39
  cache = /* @__PURE__ */ new Map();
40
40
  constructor(ctx) {
41
41
  super(ctx, {}, "cache");
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,4 +1,4 @@
1
- import type { Context } from 'fluoro';
1
+ import type { Context } from '../app';
2
2
  export declare abstract class KotoriPlugin<T extends object | undefined = undefined> {
3
3
  protected readonly ctx: Context;
4
4
  protected readonly config: T;
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,10 +1,11 @@
1
1
  import 'reflect-metadata';
2
- import { type Context, type EventsList, type ModuleConfig } from 'fluoro';
2
+ import { type EventsList, type ModuleConfig } from 'fluoro';
3
3
  import { type Constructor, Parser } from 'tsukiko';
4
4
  import { Symbols } from '../global';
5
5
  import type { CommandConfig } from '../types';
6
6
  import type { KotoriPlugin } from './plugin';
7
- declare module 'fluoro' {
7
+ import type { Context } from '../app';
8
+ declare module '../types/events' {
8
9
  interface EventsMapping {
9
10
  literal_ready_module_decorator(name: string, config: ModuleConfig): void;
10
11
  }
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
package/lib/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import 'reflect-metadata';
2
- export * from 'fluoro';
3
2
  export * from './app';
4
3
  export * from './components';
5
4
  export * from './decorators';
package/lib/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -27,7 +27,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
27
27
  var src_exports = {};
28
28
  module.exports = __toCommonJS(src_exports);
29
29
  var import_reflect_metadata = require("reflect-metadata");
30
- __reExport(src_exports, require("fluoro"), module.exports);
31
30
  __reExport(src_exports, require("./app"), module.exports);
32
31
  __reExport(src_exports, require("./components"), module.exports);
33
32
  __reExport(src_exports, require("./decorators"), module.exports);
@@ -41,7 +40,6 @@ __reExport(src_exports, require("@kotori-bot/i18n"), module.exports);
41
40
  __reExport(src_exports, require("tsukiko"), module.exports);
42
41
  // Annotate the CommonJS export names for ESM import in node:
43
42
  0 && (module.exports = {
44
- ...require("fluoro"),
45
43
  ...require("./app"),
46
44
  ...require("./components"),
47
45
  ...require("./decorators"),
@@ -1,7 +1,7 @@
1
- import type { Context } from 'fluoro';
1
+ import type { Context } from '../app';
2
2
  import type { Adapter } from '../components';
3
3
  import type { AdapterConfig } from './config';
4
- declare module 'fluoro' {
4
+ declare module './events' {
5
5
  interface EventsMapping {
6
6
  connect(data: EventDataConnect): void;
7
7
  status(data: EventDataStatus): void;
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
package/lib/types/api.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -0,0 +1,3 @@
1
+ import type { EventsMapping as EventsMappingFluoro } from 'fluoro';
2
+ export interface EventsMapping extends EventsMappingFluoro {
3
+ }
@@ -0,0 +1,27 @@
1
+
2
+ /**
3
+ * @Package @kotori-bot/core
4
+ * @Version 1.6.2
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/16 12:06:16
10
+ */
11
+
12
+ "use strict";
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (let key of __getOwnPropNames(from))
20
+ if (!__hasOwnProp.call(to, key) && key !== except)
21
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
+ }
23
+ return to;
24
+ };
25
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
+ var events_exports = {};
27
+ module.exports = __toCommonJS(events_exports);
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,8 +1,8 @@
1
- import type { Context } from 'fluoro';
2
1
  import type { CommandError } from '../utils/error';
3
2
  import type { Api, Command, MessageList, MessageSingle, SessionMsg } from '../components';
4
3
  import type { CommandAction, CommandArgType } from './command';
5
- declare module 'fluoro' {
4
+ import type { Context } from '../app';
5
+ declare module './events' {
6
6
  interface EventsMapping {
7
7
  before_command(data: EventDataBeforeCommand): void;
8
8
  /**
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,6 +1,6 @@
1
1
  import type { Session } from '../components';
2
2
  import type { Message, MessageScope } from './message';
3
- declare module 'fluoro' {
3
+ declare module './events' {
4
4
  interface EventsMapping {
5
5
  on_message(session: Session<EventDataPrivateMsg | EventDataGroupMsg | EventDataChannelMsg>): void;
6
6
  /**
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,5 +1,5 @@
1
- import type Context from 'fluoro';
2
1
  import { Symbols } from '../global';
2
+ import type { Context } from '../app';
3
3
  export declare class Container {
4
4
  private constructor();
5
5
  static instance: Context;
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,6 +1,6 @@
1
1
  import type { I18n } from '@kotori-bot/i18n';
2
2
  import type { CommandArgType, Message, MessageMapping } from '../types';
3
- import { MessageList, MessageSingle } from '../components';
3
+ import { MessageList } from '../components';
4
4
  /**
5
5
  * Create a format function base on i18n instance
6
6
  * @param i18n - i18n instance
@@ -8,5 +8,5 @@ import { MessageList, MessageSingle } from '../components';
8
8
  */
9
9
  export declare function formatFactory(i18n: I18n): {
10
10
  (template: string, data: Record<string, CommandArgType | undefined> | (CommandArgType | undefined)[]): string;
11
- <T extends keyof MessageMapping>(template: string, data: (string | number | boolean | MessageList<"text" | T> | MessageSingle<"text" | T> | undefined)[]): MessageList<"text" | T>;
11
+ <T extends keyof MessageMapping>(template: string, data: (Message<T> | CommandArgType | undefined)[]): MessageList<T | 'text'>;
12
12
  };
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.0-rc.1
4
+ * @Version 1.6.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:05
9
+ * @Date 2024/8/16 12:06:16
10
10
  */
11
11
 
12
12
  "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kotori-bot/core",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Kotori Core",
5
5
  "main": "lib/index.js",
6
6
  "license": "GPL-3.0",
@@ -29,8 +29,8 @@
29
29
  "reflect-metadata": "^0.2.2",
30
30
  "tsukiko": "^1.4.2",
31
31
  "@kotori-bot/i18n": "^1.3.2",
32
- "@kotori-bot/tools": "^1.5.0",
33
- "fluoro": "^1.1.0"
32
+ "fluoro": "^1.1.1",
33
+ "@kotori-bot/tools": "^1.5.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/minimist": "^1.2.5"