reciple 6.0.0-dev.26 → 6.0.0-dev.27

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 +67 -67
  4. package/dist/lib/esm.mjs +1 -1
  5. package/dist/lib/index.js +33 -33
  6. package/dist/lib/reciple/classes/RecipleClient.js +307 -307
  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 -309
  10. package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +126 -126
  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 -99
  14. package/dist/lib/reciple/classes/managers/CommandManager.js +60 -60
  15. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +25 -25
  16. package/dist/lib/reciple/classes/managers/ModuleManager.js +180 -176
  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 +71 -71
  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 -17
  27. package/dist/types/reciple/classes/RecipleClient.d.ts +114 -114
  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 -189
  31. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +53 -53
  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 -34
  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 -15
  40. package/dist/types/reciple/types/builders.d.ts +205 -205
  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 -26
  44. package/dist/types/reciple/version.d.ts +25 -25
  45. package/package.json +1 -1
  46. package/resource/reciple.yml +120 -120
@@ -1,81 +1,81 @@
1
- import { MessageCommandExecuteData, MessageCommandHaltData } from '../classes/builders/MessageCommandBuilder';
2
- import { SlashCommandExecuteData, SlashCommandHaltData } from '../classes/builders/SlashCommandBuilder';
3
- import { MessageCommandOptionManager } from '../classes/managers/MessageCommandOptionManager';
4
- import { CooledDownUser } from '../classes/managers/CommandCooldownManager';
5
- import { RecipleClient } from '../classes/RecipleClient';
6
- import { CommandType } from '../types/builders';
7
- /**
8
- * Any command halt data
9
- */
10
- export declare type AnyCommandHaltData<T = unknown> = SlashCommandHaltData<T> | MessageCommandHaltData<T>;
11
- /**
12
- * command halt data
13
- */
14
- export declare type CommandHaltData<T extends CommandType, M = unknown> = CommandErrorHaltData<T, M> | CommandCooldownHaltData<T, M> | (T extends CommandType.SlashCommand ? never : CommandInvalidArgumentsHaltData<T, M> | CommandMissingArgumentsHaltData<T, M>) | CommandMissingMemberPermissionsHaltData<T, M> | CommandMissingBotPermissionsHaltData<T, M>;
15
- /**
16
- * Any command execute data
17
- */
18
- export declare type AnyCommandExecuteData<T = unknown> = SlashCommandExecuteData<T> | MessageCommandExecuteData<T>;
19
- /**
20
- * Command execute data
21
- */
22
- export interface BaseCommandExecuteData {
23
- /**
24
- * Bot client
25
- */
26
- client: RecipleClient<true>;
27
- }
28
- /**
29
- * Command halt reason base
30
- */
31
- export interface BaseCommandHaltData<T extends CommandType, M = unknown> {
32
- /**
33
- * Halt reason
34
- */
35
- reason: CommandHaltReason;
36
- /**
37
- * Command execute da6a
38
- */
39
- executeData: T extends CommandType.SlashCommand ? SlashCommandExecuteData<M> : T extends CommandType.MessageCommand ? MessageCommandExecuteData<M> : AnyCommandExecuteData<M>;
40
- }
41
- export interface CommandErrorHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
42
- reason: CommandHaltReason.Error;
43
- /**
44
- * Caught error
45
- */
46
- error: any;
47
- }
48
- export interface CommandCooldownHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M>, CooledDownUser {
49
- reason: CommandHaltReason.Cooldown;
50
- }
51
- export interface CommandInvalidArgumentsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
52
- reason: CommandHaltReason.InvalidArguments;
53
- /**
54
- * Arguments that are invalid
55
- */
56
- invalidArguments: MessageCommandOptionManager;
57
- }
58
- export interface CommandMissingArgumentsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
59
- reason: CommandHaltReason.MissingArguments;
60
- /**
61
- * Arguments that are missing
62
- */
63
- missingArguments: MessageCommandOptionManager;
64
- }
65
- export interface CommandMissingMemberPermissionsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
66
- reason: CommandHaltReason.MissingMemberPermissions;
67
- }
68
- export interface CommandMissingBotPermissionsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
69
- reason: CommandHaltReason.MissingBotPermissions;
70
- }
71
- /**
72
- * Command halt reasons
73
- */
74
- export declare enum CommandHaltReason {
75
- Error = 1,
76
- Cooldown = 2,
77
- InvalidArguments = 3,
78
- MissingArguments = 4,
79
- MissingMemberPermissions = 5,
80
- MissingBotPermissions = 6
81
- }
1
+ import { MessageCommandExecuteData, MessageCommandHaltData } from '../classes/builders/MessageCommandBuilder';
2
+ import { SlashCommandExecuteData, SlashCommandHaltData } from '../classes/builders/SlashCommandBuilder';
3
+ import { MessageCommandOptionManager } from '../classes/managers/MessageCommandOptionManager';
4
+ import { CooledDownUser } from '../classes/managers/CommandCooldownManager';
5
+ import { RecipleClient } from '../classes/RecipleClient';
6
+ import { CommandType } from '../types/builders';
7
+ /**
8
+ * Any command halt data
9
+ */
10
+ export declare type AnyCommandHaltData<T = unknown> = SlashCommandHaltData<T> | MessageCommandHaltData<T>;
11
+ /**
12
+ * command halt data
13
+ */
14
+ export declare type CommandHaltData<T extends CommandType, M = unknown> = CommandErrorHaltData<T, M> | CommandCooldownHaltData<T, M> | (T extends CommandType.SlashCommand ? never : CommandInvalidArgumentsHaltData<T, M> | CommandMissingArgumentsHaltData<T, M>) | CommandMissingMemberPermissionsHaltData<T, M> | CommandMissingBotPermissionsHaltData<T, M>;
15
+ /**
16
+ * Any command execute data
17
+ */
18
+ export declare type AnyCommandExecuteData<T = unknown> = SlashCommandExecuteData<T> | MessageCommandExecuteData<T>;
19
+ /**
20
+ * Command execute data
21
+ */
22
+ export interface BaseCommandExecuteData {
23
+ /**
24
+ * Bot client
25
+ */
26
+ client: RecipleClient<true>;
27
+ }
28
+ /**
29
+ * Command halt reason base
30
+ */
31
+ export interface BaseCommandHaltData<T extends CommandType, M = unknown> {
32
+ /**
33
+ * Halt reason
34
+ */
35
+ reason: CommandHaltReason;
36
+ /**
37
+ * Command execute da6a
38
+ */
39
+ executeData: T extends CommandType.SlashCommand ? SlashCommandExecuteData<M> : T extends CommandType.MessageCommand ? MessageCommandExecuteData<M> : AnyCommandExecuteData<M>;
40
+ }
41
+ export interface CommandErrorHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
42
+ reason: CommandHaltReason.Error;
43
+ /**
44
+ * Caught error
45
+ */
46
+ error: any;
47
+ }
48
+ export interface CommandCooldownHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M>, CooledDownUser {
49
+ reason: CommandHaltReason.Cooldown;
50
+ }
51
+ export interface CommandInvalidArgumentsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
52
+ reason: CommandHaltReason.InvalidArguments;
53
+ /**
54
+ * Arguments that are invalid
55
+ */
56
+ invalidArguments: MessageCommandOptionManager;
57
+ }
58
+ export interface CommandMissingArgumentsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
59
+ reason: CommandHaltReason.MissingArguments;
60
+ /**
61
+ * Arguments that are missing
62
+ */
63
+ missingArguments: MessageCommandOptionManager;
64
+ }
65
+ export interface CommandMissingMemberPermissionsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
66
+ reason: CommandHaltReason.MissingMemberPermissions;
67
+ }
68
+ export interface CommandMissingBotPermissionsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
69
+ reason: CommandHaltReason.MissingBotPermissions;
70
+ }
71
+ /**
72
+ * Command halt reasons
73
+ */
74
+ export declare enum CommandHaltReason {
75
+ Error = 1,
76
+ Cooldown = 2,
77
+ InvalidArguments = 3,
78
+ MissingArguments = 4,
79
+ MissingMemberPermissions = 5,
80
+ MissingBotPermissions = 6
81
+ }
@@ -1,101 +1,101 @@
1
- import { ConfigCommandPermissions } from '../classes/RecipleConfig';
2
- import { Awaitable, PermissionsBitField } from 'discord.js';
3
- import { RecipleModule } from '../classes/RecipleModule';
4
- import { AnyCommandBuilder } from './builders';
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 ModuleManagerResolveModuleFilesOptions {
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 ModuleManagerGetModulePathsOptions {
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 ModuleManagerStartModulesOptions {
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 ModuleManagerLoadModulesOptions {
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 ModuleManagerUnloadModulesOptions {
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 { RecipleModule } from '../classes/RecipleModule';
4
+ import { AnyCommandBuilder } from './builders';
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 ModuleManagerResolveModuleFilesOptions {
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 ModuleManagerGetModulePathsOptions {
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 ModuleManagerStartModulesOptions {
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 ModuleManagerLoadModulesOptions {
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 ModuleManagerUnloadModulesOptions {
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,26 +1,26 @@
1
- /// <reference types="node" />
2
- import { Logger } from 'fallout-utility';
3
- import { AnyCommandBuilder } from './types/builders';
4
- import _path from 'path';
5
- /**
6
- * Check if an object is a class
7
- * @param object Object to identify
8
- */
9
- export declare function isClass<T>(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): command is AnyCommandBuilder;
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
- /**
24
- * Path module that depending on os
25
- */
26
- export declare const path: _path.PlatformPath;
1
+ /// <reference types="node" />
2
+ import { Logger } from 'fallout-utility';
3
+ import { AnyCommandBuilder } from './types/builders';
4
+ import _path from 'path';
5
+ /**
6
+ * Check if an object is a class
7
+ * @param object Object to identify
8
+ */
9
+ export declare function isClass<T>(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): command is AnyCommandBuilder;
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
+ /**
24
+ * Path module that depending on os
25
+ */
26
+ 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,7 +1,7 @@
1
1
  {
2
2
  "name": "reciple",
3
3
  "license": "GPL-3.0",
4
- "version": "6.0.0-dev.26",
4
+ "version": "6.0.0-dev.27",
5
5
  "bin": "./dist/lib/bin.mjs",
6
6
  "author": "FalloutStudios",
7
7
  "main": "./dist/lib/index.js",