reciple 6.0.0-dev.22 → 6.0.0-dev.25

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 (46) hide show
  1. package/LICENSE +674 -674
  2. package/README.md +183 -183
  3. package/dist/lib/bin.mjs +66 -65
  4. package/dist/lib/esm.mjs +1 -1
  5. package/dist/lib/index.js +33 -35
  6. package/dist/lib/reciple/classes/RecipleClient.js +296 -296
  7. package/dist/lib/reciple/classes/RecipleConfig.js +106 -106
  8. package/dist/lib/reciple/classes/RecipleModule.js +94 -94
  9. package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js +309 -325
  10. package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +126 -107
  11. package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js +246 -246
  12. package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js +178 -178
  13. package/dist/lib/reciple/classes/managers/CommandCooldownManager.js +99 -100
  14. package/dist/lib/reciple/classes/managers/CommandManager.js +59 -59
  15. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +25 -25
  16. package/dist/lib/reciple/classes/managers/ModuleManager.js +176 -179
  17. package/dist/lib/reciple/flags.js +31 -31
  18. package/dist/lib/reciple/permissions.js +30 -30
  19. package/dist/lib/reciple/types/builders.js +11 -11
  20. package/dist/lib/reciple/types/commands.js +15 -15
  21. package/dist/lib/reciple/types/paramOptions.js +2 -2
  22. package/dist/lib/reciple/util.js +69 -68
  23. package/dist/lib/reciple/version.js +47 -47
  24. package/dist/types/bin.d.mts +2 -2
  25. package/dist/types/esm.d.mts +1 -1
  26. package/dist/types/index.d.ts +17 -19
  27. package/dist/types/reciple/classes/RecipleClient.d.ts +104 -103
  28. package/dist/types/reciple/classes/RecipleConfig.d.ts +100 -100
  29. package/dist/types/reciple/classes/RecipleModule.d.ts +56 -56
  30. package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts +189 -184
  31. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +53 -51
  32. package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +98 -98
  33. package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +53 -53
  34. package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +70 -70
  35. package/dist/types/reciple/classes/managers/CommandManager.d.ts +34 -36
  36. package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +22 -22
  37. package/dist/types/reciple/classes/managers/ModuleManager.d.ts +49 -49
  38. package/dist/types/reciple/flags.d.ts +17 -17
  39. package/dist/types/reciple/permissions.d.ts +15 -19
  40. package/dist/types/reciple/types/builders.d.ts +205 -197
  41. package/dist/types/reciple/types/commands.d.ts +81 -81
  42. package/dist/types/reciple/types/paramOptions.d.ts +101 -101
  43. package/dist/types/reciple/util.d.ts +26 -23
  44. package/dist/types/reciple/version.d.ts +25 -25
  45. package/package.json +21 -20
  46. package/resource/reciple.yml +120 -120
@@ -1,100 +1,100 @@
1
- import { ClientOptions, PermissionResolvable } from 'discord.js';
2
- /**
3
- * Command permissions config object interface
4
- */
5
- export interface ConfigCommandPermissions {
6
- /**
7
- * Command name
8
- */
9
- command: string;
10
- /**
11
- * Override command builder permissions
12
- */
13
- permissions: PermissionResolvable[];
14
- }
15
- /**
16
- * Reciple config object interface
17
- */
18
- export interface Config {
19
- token: string;
20
- commands: {
21
- slashCommand: {
22
- enabled: boolean;
23
- replyOnError: boolean;
24
- registerCommands: boolean;
25
- allowRegisterEmptyCommandList: boolean;
26
- enableCooldown: boolean;
27
- setRequiredPermissions: boolean;
28
- acceptRepliedInteractions: boolean;
29
- guilds?: string[] | string;
30
- permissions: {
31
- enabled: boolean;
32
- commands: ConfigCommandPermissions[];
33
- };
34
- };
35
- messageCommand: {
36
- enabled: boolean;
37
- prefix?: string;
38
- replyOnError: boolean;
39
- allowCommandAlias: boolean;
40
- enableCooldown: boolean;
41
- commandArgumentSeparator: string;
42
- permissions: {
43
- enabled: boolean;
44
- commands: ConfigCommandPermissions[];
45
- };
46
- };
47
- };
48
- fileLogging: {
49
- enabled: boolean;
50
- debugmode: boolean;
51
- clientLogs: boolean;
52
- stringifyLoggedJSON: boolean;
53
- logFilePath: string;
54
- };
55
- client: ClientOptions;
56
- messages: {
57
- [messageKey: string]: any;
58
- };
59
- ignoredFiles: string[];
60
- modulesFolder: string | string[];
61
- disableVersionCheck: boolean;
62
- version: string;
63
- }
64
- /**
65
- * Create/parse reciple config
66
- */
67
- export declare class RecipleConfig {
68
- config: Config;
69
- configPath: string;
70
- static defaultConfigPath: string;
71
- /**
72
- * @param configPath Path to config
73
- */
74
- constructor(configPath: string);
75
- /**
76
- * Parse the config file
77
- */
78
- parseConfig(): this;
79
- /**
80
- * Returns the parsed config file
81
- */
82
- getConfig(): Config;
83
- /**
84
- * Parse token from config
85
- * @param askIfEmpty Ask for token if the token is undefined
86
- */
87
- parseToken(askIfEmpty?: boolean): string | null;
88
- /**
89
- * Check if the config version is supported
90
- */
91
- protected _isSupportedConfig(): boolean;
92
- /**
93
- * Ask for a token
94
- */
95
- protected _askToken(): string | null;
96
- /**
97
- * Get default config
98
- */
99
- static getDefaultConfig(): Config;
100
- }
1
+ import { ClientOptions, PermissionResolvable } from 'discord.js';
2
+ /**
3
+ * Command permissions config object interface
4
+ */
5
+ export interface ConfigCommandPermissions {
6
+ /**
7
+ * Command name
8
+ */
9
+ command: string;
10
+ /**
11
+ * Override command builder permissions
12
+ */
13
+ permissions: PermissionResolvable[];
14
+ }
15
+ /**
16
+ * Reciple config object interface
17
+ */
18
+ export interface Config {
19
+ token: string;
20
+ commands: {
21
+ slashCommand: {
22
+ enabled: boolean;
23
+ replyOnError: boolean;
24
+ registerCommands: boolean;
25
+ allowRegisterEmptyCommandList: boolean;
26
+ enableCooldown: boolean;
27
+ setRequiredPermissions: boolean;
28
+ acceptRepliedInteractions: boolean;
29
+ guilds?: string[] | string;
30
+ permissions: {
31
+ enabled: boolean;
32
+ commands: ConfigCommandPermissions[];
33
+ };
34
+ };
35
+ messageCommand: {
36
+ enabled: boolean;
37
+ prefix?: string;
38
+ replyOnError: boolean;
39
+ allowCommandAlias: boolean;
40
+ enableCooldown: boolean;
41
+ commandArgumentSeparator: string;
42
+ permissions: {
43
+ enabled: boolean;
44
+ commands: ConfigCommandPermissions[];
45
+ };
46
+ };
47
+ };
48
+ fileLogging: {
49
+ enabled: boolean;
50
+ debugmode: boolean;
51
+ clientLogs: boolean;
52
+ stringifyLoggedJSON: boolean;
53
+ logFilePath: string;
54
+ };
55
+ client: ClientOptions;
56
+ messages: {
57
+ [messageKey: string]: any;
58
+ };
59
+ ignoredFiles: string[];
60
+ modulesFolder: string | string[];
61
+ disableVersionCheck: boolean;
62
+ version: string;
63
+ }
64
+ /**
65
+ * Create/parse reciple config
66
+ */
67
+ export declare class RecipleConfig {
68
+ config: Config;
69
+ configPath: string;
70
+ static defaultConfigPath: string;
71
+ /**
72
+ * @param configPath Path to config
73
+ */
74
+ constructor(configPath: string);
75
+ /**
76
+ * Parse the config file
77
+ */
78
+ parseConfig(): this;
79
+ /**
80
+ * Returns the parsed config file
81
+ */
82
+ getConfig(): Config;
83
+ /**
84
+ * Parse token from config
85
+ * @param askIfEmpty Ask for token if the token is undefined
86
+ */
87
+ parseToken(askIfEmpty?: boolean): string | null;
88
+ /**
89
+ * Check if the config version is supported
90
+ */
91
+ protected _isSupportedConfig(): boolean;
92
+ /**
93
+ * Ask for a token
94
+ */
95
+ protected _askToken(): string | null;
96
+ /**
97
+ * Get default config
98
+ */
99
+ static getDefaultConfig(): Config;
100
+ }
@@ -1,56 +1,56 @@
1
- import { GuildResolvable, RestOrArray } from 'discord.js';
2
- import { AnyCommandBuilder, AnyCommandData } from '../types/builders';
3
- import { RecipleClient } from './RecipleClient';
4
- /**
5
- * Reciple script object
6
- */
7
- export interface RecipleScript {
8
- /**
9
- * Supported reciple versions
10
- */
11
- versions: string | string[];
12
- /**
13
- * Module commands
14
- */
15
- commands?: (AnyCommandBuilder | AnyCommandData)[];
16
- /**
17
- * Action on module start
18
- * @param client Bot client
19
- */
20
- onStart(client: RecipleClient<false>): boolean | Promise<boolean>;
21
- /**
22
- * Action on bot ready
23
- * @param client Bot client
24
- */
25
- onLoad?(client: RecipleClient<true>): void | Promise<void>;
26
- /**
27
- * Action when unloading this module
28
- * @param reason Unload reason
29
- * @param client Bot client
30
- */
31
- onUnload?(reason: unknown, client: RecipleClient<true>): void | Promise<void>;
32
- }
33
- export interface RecipleModuleOptions<M = unknown> {
34
- client: RecipleClient;
35
- script: RecipleScript;
36
- filePath?: string;
37
- metadata?: M;
38
- }
39
- export declare class RecipleModule<M = unknown> {
40
- readonly id: string;
41
- readonly client: RecipleClient;
42
- readonly commands: AnyCommandBuilder[];
43
- readonly script: RecipleScript;
44
- readonly filePath?: string;
45
- metadata?: M;
46
- get displayName(): string;
47
- constructor(options: RecipleModuleOptions<M>);
48
- start(): Promise<boolean>;
49
- load(resolveCommands?: boolean): Promise<void>;
50
- unload(reason?: any): Promise<void>;
51
- registerSlashCommands(...guilds: RestOrArray<GuildResolvable>): Promise<void>;
52
- unregisterSlashCommands(...guilds: RestOrArray<GuildResolvable>): Promise<void>;
53
- updateSlashCommands(...guilds: RestOrArray<GuildResolvable>): Promise<void>;
54
- resolveCommands(): AnyCommandBuilder[];
55
- toString(): string;
56
- }
1
+ import { AnyCommandBuilder, AnyCommandData } from '../types/builders';
2
+ import { GuildResolvable, RestOrArray } from 'discord.js';
3
+ import { RecipleClient } from './RecipleClient';
4
+ /**
5
+ * Reciple script object
6
+ */
7
+ export interface RecipleScript {
8
+ /**
9
+ * Supported reciple versions
10
+ */
11
+ versions: string | string[];
12
+ /**
13
+ * Module commands
14
+ */
15
+ commands?: (AnyCommandBuilder | AnyCommandData)[];
16
+ /**
17
+ * Action on module start
18
+ * @param client Bot client
19
+ */
20
+ onStart(client: RecipleClient<false>): boolean | Promise<boolean>;
21
+ /**
22
+ * Action on bot ready
23
+ * @param client Bot client
24
+ */
25
+ onLoad?(client: RecipleClient<true>): void | Promise<void>;
26
+ /**
27
+ * Action when unloading this module
28
+ * @param reason Unload reason
29
+ * @param client Bot client
30
+ */
31
+ onUnload?(reason: unknown, client: RecipleClient<true>): void | Promise<void>;
32
+ }
33
+ export interface RecipleModuleOptions<M = unknown> {
34
+ client: RecipleClient;
35
+ script: RecipleScript;
36
+ filePath?: string;
37
+ metadata?: M;
38
+ }
39
+ export declare class RecipleModule<M = unknown> {
40
+ readonly id: string;
41
+ readonly client: RecipleClient;
42
+ readonly commands: AnyCommandBuilder[];
43
+ readonly script: RecipleScript;
44
+ readonly filePath?: string;
45
+ metadata?: M;
46
+ get displayName(): string;
47
+ constructor(options: RecipleModuleOptions<M>);
48
+ start(): Promise<boolean>;
49
+ load(resolveCommands?: boolean): Promise<void>;
50
+ unload(reason?: any): Promise<void>;
51
+ registerSlashCommands(...guilds: RestOrArray<GuildResolvable>): Promise<void>;
52
+ unregisterSlashCommands(...guilds: RestOrArray<GuildResolvable>): Promise<void>;
53
+ updateSlashCommands(...guilds: RestOrArray<GuildResolvable>): Promise<void>;
54
+ resolveCommands(): AnyCommandBuilder[];
55
+ toString(): string;
56
+ }