@kotori-bot/core 1.6.1 → 1.6.3

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 (53) hide show
  1. package/lib/app/common.d.ts +6 -0
  2. package/lib/app/common.js +40 -0
  3. package/lib/app/config.js +2 -2
  4. package/lib/app/core.d.ts +128 -122
  5. package/lib/app/core.js +10 -4
  6. package/lib/app/index.js +2 -2
  7. package/lib/app/message.d.ts +1 -1
  8. package/lib/app/message.js +2 -2
  9. package/lib/components/adapter.d.ts +2 -2
  10. package/lib/components/adapter.js +2 -2
  11. package/lib/components/api.d.ts +1 -0
  12. package/lib/components/api.js +2 -2
  13. package/lib/components/cache.d.ts +2 -2
  14. package/lib/components/cache.js +4 -4
  15. package/lib/components/command.d.ts +1 -1
  16. package/lib/components/command.js +2 -2
  17. package/lib/components/elements.js +2 -2
  18. package/lib/components/filter.js +2 -2
  19. package/lib/components/index.js +2 -2
  20. package/lib/components/messages.js +2 -2
  21. package/lib/components/session.d.ts +2 -2
  22. package/lib/components/session.js +2 -2
  23. package/lib/decorators/index.js +2 -2
  24. package/lib/decorators/plugin.d.ts +1 -1
  25. package/lib/decorators/plugin.js +2 -2
  26. package/lib/decorators/utils.d.ts +3 -2
  27. package/lib/decorators/utils.js +2 -2
  28. package/lib/global/constants.js +2 -2
  29. package/lib/global/index.js +2 -2
  30. package/lib/global/symbols.js +2 -2
  31. package/lib/index.d.ts +0 -1
  32. package/lib/index.js +2 -4
  33. package/lib/types/adapter.d.ts +2 -2
  34. package/lib/types/adapter.js +2 -2
  35. package/lib/types/api.d.ts +1 -0
  36. package/lib/types/api.js +2 -2
  37. package/lib/types/command.js +2 -2
  38. package/lib/types/config.js +2 -2
  39. package/lib/types/events.d.ts +3 -0
  40. package/lib/types/events.js +27 -0
  41. package/lib/types/filter.js +2 -2
  42. package/lib/types/index.js +2 -2
  43. package/lib/types/message.d.ts +2 -2
  44. package/lib/types/message.js +2 -2
  45. package/lib/types/session.d.ts +1 -1
  46. package/lib/types/session.js +2 -2
  47. package/lib/utils/container.d.ts +1 -1
  48. package/lib/utils/container.js +2 -2
  49. package/lib/utils/error.js +2 -2
  50. package/lib/utils/factory.d.ts +1 -1
  51. package/lib/utils/factory.js +2 -2
  52. package/lib/utils/internal.js +2 -2
  53. package/package.json +3 -3
@@ -0,0 +1,6 @@
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>;
@@ -0,0 +1,40 @@
1
+
2
+ /**
3
+ * @Package @kotori-bot/core
4
+ * @Version 1.6.3
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 15:24:56
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 __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, { get: all[name], enumerable: true });
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var common_exports = {};
31
+ __export(common_exports, {
32
+ Service: () => Service
33
+ });
34
+ module.exports = __toCommonJS(common_exports);
35
+ var import_fluoro = require("fluoro");
36
+ const Service = import_fluoro.Service;
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ Service
40
+ });
package/lib/app/config.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
10
10
  */
11
11
 
12
12
  "use strict";
package/lib/app/core.d.ts CHANGED
@@ -1,138 +1,144 @@
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 from 'fluoro';
5
+ import type { Service as FluoroService, EventsList as FluoroEventsList } from 'fluoro';
5
6
  import Config from './config';
6
7
  import Message from './message';
7
8
  import type { AdapterClass } from '../types';
8
9
  import { Cache, type Api } from '../components';
9
10
  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
- }
11
+ import type { EventsMapping } from '../types/events';
12
+ export * from 'fluoro';
13
+ export type EventsList = FluoroEventsList<EventsMapping>;
14
+ export interface Context {
15
+ /**
16
+ * Adapter constructors list.
17
+ *
18
+ * @readonly
19
+ */
20
+ readonly [Symbols.adapter]: Context[typeof Symbols.adapter];
21
+ /**
22
+ * Bot instances list.
23
+ *
24
+ * @readonly
25
+ */
26
+ readonly [Symbols.bot]: Context[typeof Symbols.bot];
27
+ /**
28
+ * Core config.
29
+ *
30
+ * @readonly
31
+ */
32
+ readonly config: Config['config'];
33
+ /**
34
+ * Meta information.
35
+ *
36
+ * @readonly
37
+ */
38
+ readonly meta: Config['meta'];
39
+ /**
40
+ * Registered middlewares list.
41
+ *
42
+ * @readonly
43
+ */
44
+ readonly [Symbols.midware]: Message[typeof Symbols.midware];
45
+ /**
46
+ * Registered commands list.
47
+ *
48
+ * @readonly
49
+ */
50
+ readonly [Symbols.command]: Message[typeof Symbols.command];
51
+ /**
52
+ * Registered regexps list.
53
+ *
54
+ * @readonly
55
+ */
56
+ readonly [Symbols.regexp]: Message[typeof Symbols.regexp];
57
+ /**
58
+ * Registered scheduled tasks list.
59
+ *
60
+ * @readonly
61
+ */
62
+ readonly [Symbols.task]: Message[typeof Symbols.task];
63
+ /**
64
+ * Registered session filters list.
65
+ *
66
+ * @readonly
67
+ */
68
+ readonly [Symbols.filter]: Message[typeof Symbols.filter];
69
+ /**
70
+ * Session promises in progress list.
71
+ *
72
+ * @readonly
73
+ */
74
+ readonly [Symbols.promise]: Message[typeof Symbols.promise];
75
+ /**
76
+ * Register a message handled middleware.
77
+ *
78
+ * @param callback - Middleware callback
79
+ * @param priority - Middleware priority, default is 100
80
+ * @returns dispose function
81
+ */
82
+ midware: Message['midware'];
83
+ /**
84
+ * Register a command.
85
+ *
86
+ * @param template - Command template
87
+ * @param config - Command config, optional
88
+ * @returns Command instance
89
+ */
90
+ command: Message['command'];
91
+ /**
92
+ * Register a regexp.
93
+ *
94
+ * @param match - Regexp to match
95
+ * @param callback - Regexp callback
96
+ * @returns dispose function
97
+ */
98
+ regexp: Message['regexp'];
99
+ /**
100
+ * Register a scheduled task.
101
+ *
102
+ * @param options - Task options
103
+ * @param callback - Task callback
104
+ * @returns dispose function
105
+ */
106
+ task: Message['task'];
107
+ /**
108
+ * Register a session filter.
109
+ *
110
+ * @param option - Filter option
111
+ * @returns new context
112
+ */
113
+ filter: Message['filter'];
114
+ /**
115
+ * Send a notified message to the master of first bot instance at config.
116
+ *
117
+ * @experimental
118
+ */
119
+ notify: Message['notify'];
120
+ /**
121
+ * Send a message to all sessions on all bots.
122
+ *
123
+ * @experimental
124
+ */
125
+ boardcast: Message['boardcast'];
126
+ /** Http request methods */
127
+ http: Http;
128
+ /** International methods */
129
+ i18n: I18n;
130
+ /** Cache service */
131
+ cache: Cache;
130
132
  }
131
- export declare class Core extends Context {
133
+ export declare class Context extends FluoroContext<EventsMapping> implements Context {
132
134
  readonly [Symbols.adapter]: Map<string, [AdapterClass, Parser<unknown>?]>;
133
135
  readonly [Symbols.bot]: Map<string, Set<Api>>;
134
136
  constructor(config?: ConstructorParameters<typeof Config>[0]);
135
137
  start(): void;
136
138
  stop(): void;
137
139
  }
140
+ export type Core = Context;
141
+ export declare const Core: typeof Context;
142
+ export type Service<T extends object = object> = FluoroService<T, Context>;
143
+ export declare const Service: new <T extends object = object>(ctx: Context, config: T, identity: string) => Service<T>;
138
144
  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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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,6 +40,7 @@ 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,
43
45
  default: () => core_default
44
46
  });
@@ -50,7 +52,8 @@ var import_config = __toESM(require("./config"));
50
52
  var import_message = __toESM(require("./message"));
51
53
  var import_components = require("../components");
52
54
  var import_global = require("../global");
53
- class Core extends import_fluoro.default {
55
+ __reExport(core_exports, require("fluoro"), module.exports);
56
+ class Context extends import_fluoro.default {
54
57
  [import_global.Symbols.adapter] = /* @__PURE__ */ new Map();
55
58
  [import_global.Symbols.bot] = /* @__PURE__ */ new Map();
56
59
  constructor(config) {
@@ -86,8 +89,11 @@ class Core extends import_fluoro.default {
86
89
  this.emit("dispose");
87
90
  }
88
91
  }
92
+ const Core = Context;
89
93
  var core_default = Core;
90
94
  // Annotate the CommonJS export names for ESM import in node:
91
95
  0 && (module.exports = {
92
- Core
96
+ Context,
97
+ Core,
98
+ ...require("fluoro")
93
99
  });
package/lib/app/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type Adapter from './adapter';
2
3
  import type { ChannelInfoResponse, GetFileDataResponse, GetFilePathResponse, GetFileUrlResponse, GroupInfoResponse, GuildInfoResponse, Message, SelfInfoResponse, SendMessageResponse, UploadFileResponse, UserInfoResponse } from '../types';
3
4
  import type { EventsMapping } from 'fluoro';
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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");
@@ -127,7 +127,7 @@ export declare class Command<Template extends string = string, Opts extends Opts
127
127
  * @param template - Option template.
128
128
  * @returns Command instance
129
129
  */
130
- option<TemplateOpt extends string>(name: string, template: TemplateOpt): Command<Template, Opts & ParseOpts<TemplateOpt>>;
130
+ option<TemplateOpt extends string>(name: string, template: TemplateOpt): Command<Template, Opts & ParseOpts<TemplateOpt>, "all">;
131
131
  /**
132
132
  * Set command action.
133
133
  *
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,4 +1,4 @@
1
- import { type EventDataApiBase, type Message, type MessageQuick, type CommandResult, type EventDataPrivateMsg, type EventDataGroupMsg, type EventDataChannelMsg } from '../types';
1
+ import { type EventDataApiBase, type Message, MessageScope, type MessageQuick, type CommandResult, type EventDataPrivateMsg, type EventDataGroupMsg, type EventDataChannelMsg } from '../types';
2
2
  import type { Adapter } from './adapter';
3
3
  import { formatFactory } from '../utils/factory';
4
4
  import { CommandError } from '../utils/error';
@@ -173,5 +173,5 @@ export type SessionMsgChannel = Session<EventDataChannelMsg>;
173
173
  * @class
174
174
  * @template T - Session event data type
175
175
  */
176
- export declare const Session: new <T extends EventDataApiBase = EventDataApiBase>(data: T, bot: Adapter) => Session<T>;
176
+ export declare const Session: new <T extends EventDataApiBase<MessageScope> = EventDataApiBase<MessageScope>>(data: T, bot: Adapter) => Session<T>;
177
177
  export {};
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  /** Response for sending message */
2
3
  export interface SendMessageResponse {
3
4
  /** Message id */
package/lib/types/api.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.6.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.3
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 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
10
10
  */
11
11
 
12
12
  "use strict";
@@ -8,5 +8,5 @@ import { MessageList } 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: (Message<T> | CommandArgType | undefined)[]): MessageList<T | "text">;
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1
4
+ * @Version 1.6.3
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 18:47:17
9
+ * @Date 2024/8/16 15:24:56
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.1",
3
+ "version": "1.6.3",
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"