reciple 6.0.0-dev.17 → 6.0.0-dev.19

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 +65 -63
  4. package/dist/lib/esm.mjs +1 -1
  5. package/dist/lib/index.js +35 -35
  6. package/dist/lib/reciple/classes/RecipleClient.js +296 -300
  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 +242 -242
  10. package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +85 -85
  11. package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js +216 -216
  12. package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js +172 -172
  13. package/dist/lib/reciple/classes/managers/ClientCommandManager.js +62 -62
  14. package/dist/lib/reciple/classes/managers/ClientModuleManager.js +183 -183
  15. package/dist/lib/reciple/classes/managers/CommandCooldownManager.js +100 -100
  16. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +25 -25
  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 +68 -66
  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 +19 -19
  27. package/dist/types/reciple/classes/RecipleClient.d.ts +103 -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 +150 -150
  31. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +43 -43
  32. package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +88 -88
  33. package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +51 -51
  34. package/dist/types/reciple/classes/managers/ClientCommandManager.d.ts +37 -37
  35. package/dist/types/reciple/classes/managers/ClientModuleManager.d.ts +49 -49
  36. package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +70 -70
  37. package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +22 -22
  38. package/dist/types/reciple/flags.d.ts +17 -17
  39. package/dist/types/reciple/permissions.d.ts +19 -19
  40. package/dist/types/reciple/types/builders.d.ts +197 -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 +23 -20
  44. package/dist/types/reciple/version.d.ts +25 -25
  45. package/package.json +2 -2
  46. package/resource/reciple.yml +120 -120
@@ -1,101 +1,101 @@
1
- import { ConfigCommandPermissions } from '../classes/RecipleConfig';
2
- import { Awaitable, PermissionsBitField } from 'discord.js';
3
- import { AnyCommandBuilder } from './builders';
4
- import { RecipleModule } from '../classes/RecipleModule';
5
- export interface UserHasCommandPermissionsOptions {
6
- /**
7
- * Command builder
8
- */
9
- builder: AnyCommandBuilder;
10
- /**
11
- * Member permissions
12
- */
13
- memberPermissions?: PermissionsBitField;
14
- /***
15
- * Required command config permissions
16
- */
17
- commandPermissions?: {
18
- enabled: boolean;
19
- commands: ConfigCommandPermissions[];
20
- };
21
- }
22
- export interface ClientModuleManagerResolveModuleFilesOptions {
23
- /**
24
- * valid reciple module (ESM or CJS) Javascript file paths
25
- */
26
- files: string[];
27
- /**
28
- * Allow loading unsupported module versions
29
- * @default false
30
- */
31
- disabeVersionCheck?: boolean;
32
- /**
33
- * Ignore errors
34
- * @dafault true
35
- */
36
- ignoreErrors?: boolean;
37
- }
38
- export interface ClientModuleManagerGetModulePathsOptions {
39
- /**
40
- * Get javascript module file paths from folders
41
- */
42
- folders?: string[];
43
- /**
44
- * Add ignored files (wildcard)
45
- * @example _*.js // Ignores _module.js and _hi.js
46
- */
47
- ignoredFiles?: string[];
48
- /**
49
- * Filter found javascript files
50
- * @param file Loaded javascript file
51
- * @returns `true` if the path is acceptable
52
- */
53
- filter?: (file: string) => Awaitable<boolean>;
54
- }
55
- export interface ClientModuleManagerStartModulesOptions {
56
- /**
57
- * Modules to start
58
- */
59
- modules: RecipleModule[];
60
- /**
61
- * Add modules to Client modules collection
62
- * @default true
63
- */
64
- addToModulesCollection?: boolean;
65
- /**
66
- * Ignore errors
67
- * @default true
68
- */
69
- ignoreErrors?: boolean;
70
- }
71
- export interface ClientModuleManagerLoadModulesOptions {
72
- /**
73
- * Modules to execute `load` method
74
- */
75
- modules?: RecipleModule[];
76
- /**
77
- * Add commands to client
78
- * @default true
79
- */
80
- resolveCommands?: boolean;
81
- /**
82
- * Ignore errors
83
- * @default true
84
- */
85
- ignoreErrors?: boolean;
86
- }
87
- export interface ClientModuleManagerUnloadModulesOptions {
88
- /**
89
- * Modules to execute `unload` method
90
- */
91
- modules?: RecipleModule[];
92
- /**
93
- * Reason for unloading modules
94
- */
95
- reason?: string;
96
- /**
97
- * Ignore errors
98
- * @default true
99
- */
100
- ignoreErrors?: boolean;
101
- }
1
+ import { ConfigCommandPermissions } from '../classes/RecipleConfig';
2
+ import { Awaitable, PermissionsBitField } from 'discord.js';
3
+ import { AnyCommandBuilder } from './builders';
4
+ import { RecipleModule } from '../classes/RecipleModule';
5
+ export interface UserHasCommandPermissionsOptions {
6
+ /**
7
+ * Command builder
8
+ */
9
+ builder: AnyCommandBuilder;
10
+ /**
11
+ * Member permissions
12
+ */
13
+ memberPermissions?: PermissionsBitField;
14
+ /***
15
+ * Required command config permissions
16
+ */
17
+ commandPermissions?: {
18
+ enabled: boolean;
19
+ commands: ConfigCommandPermissions[];
20
+ };
21
+ }
22
+ export interface ClientModuleManagerResolveModuleFilesOptions {
23
+ /**
24
+ * valid reciple module (ESM or CJS) Javascript file paths
25
+ */
26
+ files: string[];
27
+ /**
28
+ * Allow loading unsupported module versions
29
+ * @default false
30
+ */
31
+ disabeVersionCheck?: boolean;
32
+ /**
33
+ * Ignore errors
34
+ * @dafault true
35
+ */
36
+ ignoreErrors?: boolean;
37
+ }
38
+ export interface ClientModuleManagerGetModulePathsOptions {
39
+ /**
40
+ * Get javascript module file paths from folders
41
+ */
42
+ folders?: string[];
43
+ /**
44
+ * Add ignored files (wildcard)
45
+ * @example _*.js // Ignores _module.js and _hi.js
46
+ */
47
+ ignoredFiles?: string[];
48
+ /**
49
+ * Filter found javascript files
50
+ * @param file Loaded javascript file
51
+ * @returns `true` if the path is acceptable
52
+ */
53
+ filter?: (file: string) => Awaitable<boolean>;
54
+ }
55
+ export interface ClientModuleManagerStartModulesOptions {
56
+ /**
57
+ * Modules to start
58
+ */
59
+ modules: RecipleModule[];
60
+ /**
61
+ * Add modules to Client modules collection
62
+ * @default true
63
+ */
64
+ addToModulesCollection?: boolean;
65
+ /**
66
+ * Ignore errors
67
+ * @default true
68
+ */
69
+ ignoreErrors?: boolean;
70
+ }
71
+ export interface ClientModuleManagerLoadModulesOptions {
72
+ /**
73
+ * Modules to execute `load` method
74
+ */
75
+ modules?: RecipleModule[];
76
+ /**
77
+ * Add commands to client
78
+ * @default true
79
+ */
80
+ resolveCommands?: boolean;
81
+ /**
82
+ * Ignore errors
83
+ * @default true
84
+ */
85
+ ignoreErrors?: boolean;
86
+ }
87
+ export interface ClientModuleManagerUnloadModulesOptions {
88
+ /**
89
+ * Modules to execute `unload` method
90
+ */
91
+ modules?: RecipleModule[];
92
+ /**
93
+ * Reason for unloading modules
94
+ */
95
+ reason?: string;
96
+ /**
97
+ * Ignore errors
98
+ * @default true
99
+ */
100
+ ignoreErrors?: boolean;
101
+ }
@@ -1,20 +1,23 @@
1
- import { Logger } from 'fallout-utility';
2
- import { AnyCommandBuilder } from './types/builders';
3
- /**
4
- * Check if an object is a class
5
- * @param object Object to identify
6
- */
7
- export declare function isClass<T = any>(object: any): object is T;
8
- /**
9
- * Emit process warning about deprecated method/function
10
- * @param content Warning content
11
- */
12
- export declare function deprecationWarning(content: string | Error): void;
13
- export declare function validateCommandBuilder(command: AnyCommandBuilder): boolean;
14
- /**
15
- * Create new logger
16
- * @param stringifyJSON stringify json objects in console
17
- * @param debugmode display debug messages
18
- * @param colorizeMessage add logger colours to messages
19
- */
20
- export declare function createLogger(stringifyJSON: boolean, debugmode?: boolean, colorizeMessage?: boolean): Logger;
1
+ /// <reference types="node" />
2
+ import { Logger } from 'fallout-utility';
3
+ import { default as _path } from 'path';
4
+ import { AnyCommandBuilder } from './types/builders';
5
+ /**
6
+ * Check if an object is a class
7
+ * @param object Object to identify
8
+ */
9
+ export declare function isClass<T = any>(object: any): object is T;
10
+ /**
11
+ * Emit process warning about deprecated method/function
12
+ * @param content Warning content
13
+ */
14
+ export declare function deprecationWarning(content: string | Error): void;
15
+ export declare function validateCommandBuilder(command: AnyCommandBuilder): boolean;
16
+ /**
17
+ * Create new logger
18
+ * @param stringifyJSON stringify json objects in console
19
+ * @param debugmode display debug messages
20
+ * @param colorizeMessage add logger colours to messages
21
+ */
22
+ export declare function createLogger(stringifyJSON: boolean, debugmode?: boolean, colorizeMessage?: boolean): Logger;
23
+ export declare const path: _path.PlatformPath;
@@ -1,25 +1,25 @@
1
- import semver from 'semver';
2
- /**
3
- * Current reciple version
4
- */
5
- export declare const version: string;
6
- /**
7
- * Current reciple version from package.json
8
- */
9
- export declare const rawVersion: any;
10
- /**
11
- * Check if the version is valid
12
- * @param ver Version string to validated
13
- */
14
- export declare function isValidVersion(ver: string): boolean;
15
- /**
16
- * Parse the version string
17
- * @param ver Parse version string
18
- */
19
- export declare function parseVersion(ver: string): semver.SemVer | null;
20
- /**
21
- * Check if the given version is supported by the given version range
22
- * @param versionRange Version range
23
- * @param supportedVersion Version to match given version range
24
- */
25
- export declare function isSupportedVersion(versionRange: string, supportedVersion?: string): boolean;
1
+ import semver from 'semver';
2
+ /**
3
+ * Current reciple version
4
+ */
5
+ export declare const version: string;
6
+ /**
7
+ * Current reciple version from package.json
8
+ */
9
+ export declare const rawVersion: any;
10
+ /**
11
+ * Check if the version is valid
12
+ * @param ver Version string to validated
13
+ */
14
+ export declare function isValidVersion(ver: string): boolean;
15
+ /**
16
+ * Parse the version string
17
+ * @param ver Parse version string
18
+ */
19
+ export declare function parseVersion(ver: string): semver.SemVer | null;
20
+ /**
21
+ * Check if the given version is supported by the given version range
22
+ * @param versionRange Version range
23
+ * @param supportedVersion Version to match given version range
24
+ */
25
+ export declare function isSupportedVersion(versionRange: string, supportedVersion?: string): boolean;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "6.0.0-dev.17",
3
+ "version": "6.0.0-dev.19",
4
4
  "bin": "./dist/lib/bin.mjs",
5
5
  "license": "GPL-3.0",
6
6
  "type": "commonjs",
7
7
  "main": "./dist/lib/index.js",
8
8
  "types": "./dist/types/index.d.ts",
9
- "module": "./esm.mjs",
9
+ "module": "./dist/lib/esm.mjs",
10
10
  "author": "FalloutStudios",
11
11
  "description": "Handler for Discord.js",
12
12
  "homepage": "https://reciple.js.org",
@@ -1,120 +1,120 @@
1
- # Your bot token here
2
- # To use env variable as a token just do it like this env:TOKEN_ENV
3
- token: TOKEN
4
-
5
- # Commands options
6
- commands:
7
- # Interaction command options
8
- slashCommand:
9
- # enable interaction commands
10
- enabled: true
11
- # reply when an error occured
12
- replyOnError: false
13
- # enable the use of command cooldowns
14
- enableCooldown: true
15
- # register interaction commands on bot ready
16
- registerCommands: true
17
- # allow register empty list of application commands
18
- allowRegisterEmptyCommandList: true
19
- # set required permissions for interaction commands
20
- setRequiredPermissions: true
21
- # accept replied or deffered command interaction
22
- acceptRepliedInteractions: false
23
- # register commands to specific guild(s) empty to make it global
24
- guilds: []
25
- # overwrite command permissions
26
- permissions:
27
- # enable overwriten command permissions
28
- enabled: false
29
- commands:
30
- - command: example-command
31
- permissions:
32
- - Administrator
33
-
34
- # message command options
35
- messageCommand:
36
- # enable message commands
37
- enabled: true
38
- # command prefix
39
- prefix: '!'
40
- # reply when an error occured
41
- replyOnError: false
42
- # enable the use of command cooldowns
43
- enableCooldown: true
44
- # allow executing commands via aliases
45
- allowCommandAlias: true
46
- # command argument separator
47
- commandArgumentSeparator: ' '
48
- # overwrite command permissions
49
- permissions:
50
- # enable overwriten command permissions
51
- enabled: false
52
- commands:
53
- - command: example-command
54
- permissions:
55
- - Administrator
56
-
57
- # Logger options
58
- fileLogging:
59
- # enable console output to file
60
- enabled: true
61
- # enable debug mode
62
- debugmode: false
63
- # enable if reciple will use the logger
64
- clientLogs: true
65
- # stringify logged JSONs
66
- stringifyLoggedJSON: false
67
- # log file path
68
- logFilePath: logs/latest.log
69
-
70
- # Client options
71
- # Learn more about client options at https://discord.js.org/#/docs/discord.js/main/typedef/ClientOptions
72
- client:
73
- intents:
74
- - Guilds
75
- - GuildMembers
76
- - GuildMessages
77
- - MessageContent
78
-
79
- # Bot messages
80
- messages:
81
- missingArguments: Not enough arguments.
82
- invalidArguments: Invalid argument(s) given.
83
- insufficientBotPerms:
84
- content: Insufficient bot permissions.
85
- ephemeral: true
86
- noPermissions:
87
- content: You do not have permission to use this command.
88
- ephemeral: true
89
- cooldown:
90
- content: You cannot execute this command right now due to the cooldown.
91
- ephemeral: true
92
- error:
93
- content: An error occurred.
94
- ephemeral: true
95
-
96
- # Ignored Files
97
- ignoredFiles:
98
- - '_*'
99
- - '.*'
100
-
101
-
102
- ####################################################
103
- # #
104
- # ##### ##### # # ### ##### #### #
105
- # # # # # # # # # # # # #
106
- # # # ##### # # # # ### ### #### #
107
- # # # # # # # # # # # # #
108
- # ### # # # # ### ##### # # #
109
- # #
110
- ####################################################
111
- ## Modifying the values below could break reciple ##
112
-
113
- # Modules folder
114
- modulesFolder: 'modules'
115
-
116
- # Load modules regardless of its supported versions
117
- disableVersionCheck: false
118
-
119
- # Current version
120
- version: ^VERSION
1
+ # Your bot token here
2
+ # To use env variable as a token just do it like this env:TOKEN_ENV
3
+ token: TOKEN
4
+
5
+ # Commands options
6
+ commands:
7
+ # Interaction command options
8
+ slashCommand:
9
+ # enable interaction commands
10
+ enabled: true
11
+ # reply when an error occured
12
+ replyOnError: false
13
+ # enable the use of command cooldowns
14
+ enableCooldown: true
15
+ # register interaction commands on bot ready
16
+ registerCommands: true
17
+ # allow register empty list of application commands
18
+ allowRegisterEmptyCommandList: true
19
+ # set required permissions for interaction commands
20
+ setRequiredPermissions: true
21
+ # accept replied or deffered command interaction
22
+ acceptRepliedInteractions: false
23
+ # register commands to specific guild(s) empty to make it global
24
+ guilds: []
25
+ # overwrite command permissions
26
+ permissions:
27
+ # enable overwriten command permissions
28
+ enabled: false
29
+ commands:
30
+ - command: example-command
31
+ permissions:
32
+ - Administrator
33
+
34
+ # message command options
35
+ messageCommand:
36
+ # enable message commands
37
+ enabled: true
38
+ # command prefix
39
+ prefix: '!'
40
+ # reply when an error occured
41
+ replyOnError: false
42
+ # enable the use of command cooldowns
43
+ enableCooldown: true
44
+ # allow executing commands via aliases
45
+ allowCommandAlias: true
46
+ # command argument separator
47
+ commandArgumentSeparator: ' '
48
+ # overwrite command permissions
49
+ permissions:
50
+ # enable overwriten command permissions
51
+ enabled: false
52
+ commands:
53
+ - command: example-command
54
+ permissions:
55
+ - Administrator
56
+
57
+ # Logger options
58
+ fileLogging:
59
+ # enable console output to file
60
+ enabled: true
61
+ # enable debug mode
62
+ debugmode: false
63
+ # enable if reciple will use the logger
64
+ clientLogs: true
65
+ # stringify logged JSONs
66
+ stringifyLoggedJSON: false
67
+ # log file path
68
+ logFilePath: logs/latest.log
69
+
70
+ # Client options
71
+ # Learn more about client options at https://discord.js.org/#/docs/discord.js/main/typedef/ClientOptions
72
+ client:
73
+ intents:
74
+ - Guilds
75
+ - GuildMembers
76
+ - GuildMessages
77
+ - MessageContent
78
+
79
+ # Bot messages
80
+ messages:
81
+ missingArguments: Not enough arguments.
82
+ invalidArguments: Invalid argument(s) given.
83
+ insufficientBotPerms:
84
+ content: Insufficient bot permissions.
85
+ ephemeral: true
86
+ noPermissions:
87
+ content: You do not have permission to use this command.
88
+ ephemeral: true
89
+ cooldown:
90
+ content: You cannot execute this command right now due to the cooldown.
91
+ ephemeral: true
92
+ error:
93
+ content: An error occurred.
94
+ ephemeral: true
95
+
96
+ # Ignored Files
97
+ ignoredFiles:
98
+ - '_*'
99
+ - '.*'
100
+
101
+
102
+ ####################################################
103
+ # #
104
+ # ##### ##### # # ### ##### #### #
105
+ # # # # # # # # # # # # #
106
+ # # # ##### # # # # ### ### #### #
107
+ # # # # # # # # # # # # #
108
+ # ### # # # # ### ##### # # #
109
+ # #
110
+ ####################################################
111
+ ## Modifying the values below could break reciple ##
112
+
113
+ # Modules folder
114
+ modulesFolder: 'modules'
115
+
116
+ # Load modules regardless of its supported versions
117
+ disableVersionCheck: false
118
+
119
+ # Current version
120
+ version: ^VERSION