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.
- package/LICENSE +674 -674
- package/README.md +183 -183
- package/dist/lib/bin.mjs +66 -65
- package/dist/lib/esm.mjs +1 -1
- package/dist/lib/index.js +33 -35
- package/dist/lib/reciple/classes/RecipleClient.js +296 -296
- package/dist/lib/reciple/classes/RecipleConfig.js +106 -106
- package/dist/lib/reciple/classes/RecipleModule.js +94 -94
- package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js +309 -325
- package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +126 -107
- package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js +246 -246
- package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js +178 -178
- package/dist/lib/reciple/classes/managers/CommandCooldownManager.js +99 -100
- package/dist/lib/reciple/classes/managers/CommandManager.js +59 -59
- package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +25 -25
- package/dist/lib/reciple/classes/managers/ModuleManager.js +176 -179
- package/dist/lib/reciple/flags.js +31 -31
- package/dist/lib/reciple/permissions.js +30 -30
- package/dist/lib/reciple/types/builders.js +11 -11
- package/dist/lib/reciple/types/commands.js +15 -15
- package/dist/lib/reciple/types/paramOptions.js +2 -2
- package/dist/lib/reciple/util.js +69 -68
- package/dist/lib/reciple/version.js +47 -47
- package/dist/types/bin.d.mts +2 -2
- package/dist/types/esm.d.mts +1 -1
- package/dist/types/index.d.ts +17 -19
- package/dist/types/reciple/classes/RecipleClient.d.ts +104 -103
- package/dist/types/reciple/classes/RecipleConfig.d.ts +100 -100
- package/dist/types/reciple/classes/RecipleModule.d.ts +56 -56
- package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts +189 -184
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +53 -51
- package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +98 -98
- package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +53 -53
- package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +70 -70
- package/dist/types/reciple/classes/managers/CommandManager.d.ts +34 -36
- package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +22 -22
- package/dist/types/reciple/classes/managers/ModuleManager.d.ts +49 -49
- package/dist/types/reciple/flags.d.ts +17 -17
- package/dist/types/reciple/permissions.d.ts +15 -19
- package/dist/types/reciple/types/builders.d.ts +205 -197
- package/dist/types/reciple/types/commands.d.ts +81 -81
- package/dist/types/reciple/types/paramOptions.d.ts +101 -101
- package/dist/types/reciple/util.d.ts +26 -23
- package/dist/types/reciple/version.d.ts +25 -25
- package/package.json +21 -20
- 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 {
|
|
2
|
-
import {
|
|
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
|
+
}
|