zumito-framework 1.2.19 → 1.2.20
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/dist/definitions/decorators/Injectable.decorator.d.ts +2 -0
- package/dist/definitions/decorators/Injectable.decorator.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/services/CommandManager.d.ts +1 -0
- package/dist/services/CommandManager.js +1 -0
- package/dist/services/InteractionHandler.d.ts +1 -0
- package/dist/services/InteractionHandler.js +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// eslint-disable-next-line check-file/filename-naming-convention
|
|
2
|
+
import { ServiceContainer } from "../..";
|
|
3
|
+
import 'reflect-metadata';
|
|
4
|
+
export function Injectable() {
|
|
5
|
+
return function (target) {
|
|
6
|
+
const paramTypes = Reflect.getMetadata('design:paramtypes', target);
|
|
7
|
+
const paramTypeNames = paramTypes.map((paramType) => paramType.name);
|
|
8
|
+
ServiceContainer.addService(target, paramTypeNames);
|
|
9
|
+
};
|
|
10
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -32,4 +32,5 @@ import { CommandManager } from './services/CommandManager.js';
|
|
|
32
32
|
import { ErrorType } from './definitions/ErrorType.js';
|
|
33
33
|
export { ModalSubmitParameters } from './definitions/parameters/ModalSubmitParameters.js';
|
|
34
34
|
export { CommandBinds } from './definitions/commands/CommandBinds.js';
|
|
35
|
+
export { Injectable } from './definitions/decorators/Injectable.decorator.js';
|
|
35
36
|
export { ZumitoFramework, FrameworkSettings, Command, Module, CommandParameters, CommandArguments, FrameworkEvent, Translation, TranslationManager, ApiResponse, SelectMenuParameters, CommandType, CommandArgDefinition, CommandChoiceDefinition, ButtonPressed, ButtonPressedParams, TextFormatter, EmojiFallback, DatabaseConfigLoader, DatabaseModel, PresenceDataRule, RuledPresenceData, StatusManagerOptions, discord, EventParameters, ServiceContainer, GuildDataGetter, SlashCommandRefresher, CommandParser, ErrorHandler, ErrorType, Route, RouteMethod, InteractionHandler, CommandManager };
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import { Route, RouteMethod } from './definitions/Route.js';
|
|
|
23
23
|
import { InteractionHandler } from './services/InteractionHandler.js';
|
|
24
24
|
import { CommandManager } from './services/CommandManager.js';
|
|
25
25
|
import { ErrorType } from './definitions/ErrorType.js';
|
|
26
|
+
export { Injectable } from './definitions/decorators/Injectable.decorator.js';
|
|
26
27
|
ServiceContainer.addService(TextFormatter, []);
|
|
27
28
|
ServiceContainer.addService(EmojiFallback, [discord.Client.name, TranslationManager.name]);
|
|
28
29
|
ServiceContainer.addService(GuildDataGetter, [ZumitoFramework.name]);
|
|
@@ -2,6 +2,7 @@ import { ZumitoFramework } from "../ZumitoFramework";
|
|
|
2
2
|
import { Command } from "../definitions/commands/Command.js";
|
|
3
3
|
import { CommandLoadOptions } from "../definitions/CommandLoadOptions";
|
|
4
4
|
import { ErrorHandler } from "./ErrorHandler";
|
|
5
|
+
import 'reflect-metadata';
|
|
5
6
|
export declare class CommandManager {
|
|
6
7
|
protected commands: Map<string, Command>;
|
|
7
8
|
protected framework: ZumitoFramework;
|
|
@@ -8,6 +8,7 @@ import { CommandType } from "../definitions/commands/CommandType.js";
|
|
|
8
8
|
import { ErrorHandler } from "./ErrorHandler";
|
|
9
9
|
import { ServiceContainer } from "./ServiceContainer";
|
|
10
10
|
import { ErrorType } from "../definitions/ErrorType";
|
|
11
|
+
import 'reflect-metadata';
|
|
11
12
|
export class CommandManager {
|
|
12
13
|
commands;
|
|
13
14
|
framework;
|
|
@@ -5,6 +5,7 @@ import { TranslationManager } from "./TranslationManager";
|
|
|
5
5
|
import { EventManager } from "./EventManager";
|
|
6
6
|
import { InteractionHandlerSettings } from "@definitions/settings/InteractionHandlerSettings";
|
|
7
7
|
import { ErrorHandler } from "./ErrorHandler";
|
|
8
|
+
import 'reflect-metadata';
|
|
8
9
|
export declare class InteractionHandler {
|
|
9
10
|
protected commandManager: CommandManager;
|
|
10
11
|
protected guildDataGetter: GuildDataGetter;
|
|
@@ -8,6 +8,7 @@ import { TranslationManager } from "./TranslationManager";
|
|
|
8
8
|
import { EventManager } from "./EventManager";
|
|
9
9
|
import { ErrorHandler } from "./ErrorHandler";
|
|
10
10
|
import { ErrorType } from "../definitions/ErrorType";
|
|
11
|
+
import 'reflect-metadata';
|
|
11
12
|
export class InteractionHandler {
|
|
12
13
|
commandManager;
|
|
13
14
|
guildDataGetter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zumito-framework",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.20",
|
|
4
4
|
"description": "Discord.js bot framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"express": "^4.18.1",
|
|
34
34
|
"leven": "^4.0.0",
|
|
35
35
|
"mongoose": "^6.6.5",
|
|
36
|
+
"reflect-metadata": "^0.2.2",
|
|
36
37
|
"source-fragment": "^1.1.0",
|
|
37
38
|
"tingodb": "^0.6.1",
|
|
38
39
|
"tseep": "^1.2.2",
|