zumito-framework 1.1.45 → 1.1.47
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/TranslationManager.d.ts +15 -15
- package/dist/TranslationManager.js +41 -41
- package/dist/ZumitoFramework.d.ts +51 -51
- package/dist/ZumitoFramework.js +312 -312
- package/dist/baseModule/BaseModule.d.ts +6 -6
- package/dist/baseModule/BaseModule.js +16 -16
- package/dist/baseModule/events/discord/interactionCreate.d.ts +6 -6
- package/dist/baseModule/events/discord/interactionCreate.js +50 -50
- package/dist/baseModule/events/discord/messageCreate.d.ts +16 -16
- package/dist/baseModule/events/discord/messageCreate.js +233 -233
- package/dist/baseModule/index.d.ts +6 -6
- package/dist/baseModule/index.js +15 -15
- package/dist/baseModule/models/errors.json +13 -13
- package/dist/baseModule/models/guild.json +22 -22
- package/dist/definitions/ApiResponse.d.ts +4 -4
- package/dist/definitions/ApiResponse.js +16 -16
- package/dist/index.d.ts +17 -17
- package/dist/index.js +12 -12
- package/dist/managers/EmojiManager.d.ts +11 -11
- package/dist/managers/EmojiManager.js +32 -32
- package/dist/types/Command.d.ts +24 -24
- package/dist/types/Command.js +25 -25
- package/dist/types/CommandArgDefinition.d.ts +7 -7
- package/dist/types/CommandArgDefinition.js +1 -1
- package/dist/types/CommandArguments.d.ts +8 -8
- package/dist/types/CommandArguments.js +15 -15
- package/dist/types/CommandChoiceDefinition.d.ts +4 -4
- package/dist/types/CommandChoiceDefinition.js +1 -1
- package/dist/types/CommandParameters.d.ts +18 -18
- package/dist/types/CommandParameters.js +1 -1
- package/dist/types/CommandType.d.ts +6 -6
- package/dist/types/CommandType.js +6 -6
- package/dist/types/Commands.d.ts +23 -23
- package/dist/types/Commands.js +26 -26
- package/dist/types/EventParameters.d.ts +8 -8
- package/dist/types/EventParameters.js +1 -1
- package/dist/types/FrameworkEvent.d.ts +5 -5
- package/dist/types/FrameworkEvent.js +4 -4
- package/dist/types/FrameworkSettings.d.ts +11 -11
- package/dist/types/FrameworkSettings.js +1 -1
- package/dist/types/Module.d.ts +26 -25
- package/dist/types/Module.js +201 -191
- package/dist/types/SelectMenuParameters.d.ts +9 -9
- package/dist/types/SelectMenuParameters.js +1 -1
- package/dist/types/Translation.d.ts +9 -9
- package/dist/types/Translation.js +31 -31
- package/dist/utils/EmojiFallback.d.ts +6 -6
- package/dist/utils/EmojiFallback.js +14 -14
- package/dist/utils/TextFormatter.d.ts +26 -26
- package/dist/utils/TextFormatter.js +82 -82
- package/package.json +1 -1
- package/plop-templates/command.js.hbs +16 -16
- package/plop-templates/translation.json.hbs +7 -7
- package/plopfile.js +88 -88
- package/templateGenerator.mjs +25 -25
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Translation } from "./types/Translation.js";
|
|
2
|
-
export declare class TranslationManager {
|
|
3
|
-
private translations;
|
|
4
|
-
private defaultLanguage;
|
|
5
|
-
private languages;
|
|
6
|
-
constructor();
|
|
7
|
-
get(key: string, language?: string, params?: any): string;
|
|
8
|
-
set(key: string, language: string, text: string): void;
|
|
9
|
-
has(key: string): boolean;
|
|
10
|
-
getAll(): Map<string, Translation>;
|
|
11
|
-
setAll(translations: Map<string, Translation>): void;
|
|
12
|
-
getDefaultLanguage(): string;
|
|
13
|
-
setDefaultLanguage(language: string): void;
|
|
14
|
-
getLanguages(): string[];
|
|
15
|
-
}
|
|
1
|
+
import { Translation } from "./types/Translation.js";
|
|
2
|
+
export declare class TranslationManager {
|
|
3
|
+
private translations;
|
|
4
|
+
private defaultLanguage;
|
|
5
|
+
private languages;
|
|
6
|
+
constructor();
|
|
7
|
+
get(key: string, language?: string, params?: any): string;
|
|
8
|
+
set(key: string, language: string, text: string): void;
|
|
9
|
+
has(key: string): boolean;
|
|
10
|
+
getAll(): Map<string, Translation>;
|
|
11
|
+
setAll(translations: Map<string, Translation>): void;
|
|
12
|
+
getDefaultLanguage(): string;
|
|
13
|
+
setDefaultLanguage(language: string): void;
|
|
14
|
+
getLanguages(): string[];
|
|
15
|
+
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { Translation } from "./types/Translation.js";
|
|
2
|
-
export class TranslationManager {
|
|
3
|
-
translations = new Map();
|
|
4
|
-
defaultLanguage = 'en';
|
|
5
|
-
languages = [];
|
|
6
|
-
constructor() { }
|
|
7
|
-
get(key, language, params) {
|
|
8
|
-
if (this.translations.has(key)) {
|
|
9
|
-
return this.translations.get(key).get(language, params);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
return key;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
set(key, language, text) {
|
|
16
|
-
if (!this.translations.has(key)) {
|
|
17
|
-
this.translations.set(key, new Translation());
|
|
18
|
-
}
|
|
19
|
-
this.translations.get(key).set(language, text);
|
|
20
|
-
if (!this.languages.includes(language))
|
|
21
|
-
this.languages.push(language);
|
|
22
|
-
}
|
|
23
|
-
has(key) {
|
|
24
|
-
return this.translations.has(key);
|
|
25
|
-
}
|
|
26
|
-
getAll() {
|
|
27
|
-
return this.translations;
|
|
28
|
-
}
|
|
29
|
-
setAll(translations) {
|
|
30
|
-
this.translations = translations;
|
|
31
|
-
}
|
|
32
|
-
getDefaultLanguage() {
|
|
33
|
-
return this.defaultLanguage;
|
|
34
|
-
}
|
|
35
|
-
setDefaultLanguage(language) {
|
|
36
|
-
this.defaultLanguage = language;
|
|
37
|
-
}
|
|
38
|
-
getLanguages() {
|
|
39
|
-
return this.languages;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
import { Translation } from "./types/Translation.js";
|
|
2
|
+
export class TranslationManager {
|
|
3
|
+
translations = new Map();
|
|
4
|
+
defaultLanguage = 'en';
|
|
5
|
+
languages = [];
|
|
6
|
+
constructor() { }
|
|
7
|
+
get(key, language, params) {
|
|
8
|
+
if (this.translations.has(key)) {
|
|
9
|
+
return this.translations.get(key).get(language, params);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return key;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
set(key, language, text) {
|
|
16
|
+
if (!this.translations.has(key)) {
|
|
17
|
+
this.translations.set(key, new Translation());
|
|
18
|
+
}
|
|
19
|
+
this.translations.get(key).set(language, text);
|
|
20
|
+
if (!this.languages.includes(language))
|
|
21
|
+
this.languages.push(language);
|
|
22
|
+
}
|
|
23
|
+
has(key) {
|
|
24
|
+
return this.translations.has(key);
|
|
25
|
+
}
|
|
26
|
+
getAll() {
|
|
27
|
+
return this.translations;
|
|
28
|
+
}
|
|
29
|
+
setAll(translations) {
|
|
30
|
+
this.translations = translations;
|
|
31
|
+
}
|
|
32
|
+
getDefaultLanguage() {
|
|
33
|
+
return this.defaultLanguage;
|
|
34
|
+
}
|
|
35
|
+
setDefaultLanguage(language) {
|
|
36
|
+
this.defaultLanguage = language;
|
|
37
|
+
}
|
|
38
|
+
getLanguages() {
|
|
39
|
+
return this.languages;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { GuildMember, TextChannel } from "discord.js";
|
|
2
|
-
import { Command } from "./types/Command.js";
|
|
3
|
-
import { FrameworkSettings } from "./types/FrameworkSettings.js";
|
|
4
|
-
import { Module } from "./types/Module.js";
|
|
5
|
-
import { FrameworkEvent } from "./types/FrameworkEvent.js";
|
|
6
|
-
import { TranslationManager } from "./TranslationManager.js";
|
|
7
|
-
/**
|
|
8
|
-
* @class ZumitoFramework
|
|
9
|
-
* @classdesc The main class of the framework.
|
|
10
|
-
*
|
|
11
|
-
* @property {FrameworkSettings} settings - The settings of the framework.
|
|
12
|
-
* @property {Client} client - The client client instance.
|
|
13
|
-
* @property {Collection<string, Module>} modules - The modules loaded in the framework.
|
|
14
|
-
* @property {Collection<string, Command>} commands - The commands loaded in the framework.
|
|
15
|
-
*/
|
|
16
|
-
export declare class ZumitoFramework {
|
|
17
|
-
client: any;
|
|
18
|
-
settings: FrameworkSettings;
|
|
19
|
-
modules: Map<string, Module>;
|
|
20
|
-
commands: Map<string, Command>;
|
|
21
|
-
events: Map<string, FrameworkEvent>;
|
|
22
|
-
translations: TranslationManager;
|
|
23
|
-
routes: any;
|
|
24
|
-
models: any;
|
|
25
|
-
database: any;
|
|
26
|
-
app: any;
|
|
27
|
-
/**
|
|
28
|
-
* @constructor
|
|
29
|
-
* @description Creates a new instance of the framework.
|
|
30
|
-
* @param {FrameworkSettings} settings - The settings of the framework.
|
|
31
|
-
* @example new ZumitoFramework({
|
|
32
|
-
* prefix: '!',
|
|
33
|
-
* discordClientOptions: {
|
|
34
|
-
* token: 'token',
|
|
35
|
-
* clientId: 'clientId',
|
|
36
|
-
* intents: 0
|
|
37
|
-
* }
|
|
38
|
-
* });
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
|
-
constructor(settings: FrameworkSettings, callback?: Function);
|
|
42
|
-
initialize(): Promise<void>;
|
|
43
|
-
startApiServer(): void;
|
|
44
|
-
private registerModules;
|
|
45
|
-
private registerModule;
|
|
46
|
-
private initializeDiscordClient;
|
|
47
|
-
static splitCommandLine(commandLine: any): any;
|
|
48
|
-
memberHasPermission(member: GuildMember, channel: TextChannel, permission: bigint): Promise<boolean>;
|
|
49
|
-
getGuildSettings(guildId: string): Promise<any>;
|
|
50
|
-
refreshSlashCommands(): Promise<void>;
|
|
51
|
-
}
|
|
1
|
+
import { GuildMember, TextChannel } from "discord.js";
|
|
2
|
+
import { Command } from "./types/Command.js";
|
|
3
|
+
import { FrameworkSettings } from "./types/FrameworkSettings.js";
|
|
4
|
+
import { Module } from "./types/Module.js";
|
|
5
|
+
import { FrameworkEvent } from "./types/FrameworkEvent.js";
|
|
6
|
+
import { TranslationManager } from "./TranslationManager.js";
|
|
7
|
+
/**
|
|
8
|
+
* @class ZumitoFramework
|
|
9
|
+
* @classdesc The main class of the framework.
|
|
10
|
+
*
|
|
11
|
+
* @property {FrameworkSettings} settings - The settings of the framework.
|
|
12
|
+
* @property {Client} client - The client client instance.
|
|
13
|
+
* @property {Collection<string, Module>} modules - The modules loaded in the framework.
|
|
14
|
+
* @property {Collection<string, Command>} commands - The commands loaded in the framework.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ZumitoFramework {
|
|
17
|
+
client: any;
|
|
18
|
+
settings: FrameworkSettings;
|
|
19
|
+
modules: Map<string, Module>;
|
|
20
|
+
commands: Map<string, Command>;
|
|
21
|
+
events: Map<string, FrameworkEvent>;
|
|
22
|
+
translations: TranslationManager;
|
|
23
|
+
routes: any;
|
|
24
|
+
models: any;
|
|
25
|
+
database: any;
|
|
26
|
+
app: any;
|
|
27
|
+
/**
|
|
28
|
+
* @constructor
|
|
29
|
+
* @description Creates a new instance of the framework.
|
|
30
|
+
* @param {FrameworkSettings} settings - The settings of the framework.
|
|
31
|
+
* @example new ZumitoFramework({
|
|
32
|
+
* prefix: '!',
|
|
33
|
+
* discordClientOptions: {
|
|
34
|
+
* token: 'token',
|
|
35
|
+
* clientId: 'clientId',
|
|
36
|
+
* intents: 0
|
|
37
|
+
* }
|
|
38
|
+
* });
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
constructor(settings: FrameworkSettings, callback?: Function);
|
|
42
|
+
initialize(): Promise<void>;
|
|
43
|
+
startApiServer(): void;
|
|
44
|
+
private registerModules;
|
|
45
|
+
private registerModule;
|
|
46
|
+
private initializeDiscordClient;
|
|
47
|
+
static splitCommandLine(commandLine: any): any;
|
|
48
|
+
memberHasPermission(member: GuildMember, channel: TextChannel, permission: bigint): Promise<boolean>;
|
|
49
|
+
getGuildSettings(guildId: string): Promise<any>;
|
|
50
|
+
refreshSlashCommands(): Promise<void>;
|
|
51
|
+
}
|