reciple 6.0.0-dev.12 → 6.0.0-dev.14
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/lib/bin.mjs +2 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/reciple/types/builders.js +1 -1
- package/dist/lib/reciple/types/commands.js +6 -6
- package/dist/types/index.d.ts +1 -0
- package/dist/types/reciple/classes/RecipleConfig.d.ts +1 -0
- package/dist/types/reciple/types/builders.d.ts +2 -2
- package/dist/types/reciple/types/commands.d.ts +13 -13
- package/package.json +1 -1
- package/resource/reciple.yml +22 -21
package/dist/lib/bin.mjs
CHANGED
|
@@ -41,8 +41,9 @@ client.on('ready', async () => {
|
|
|
41
41
|
await client.modules.loadModules(client.modules.modules.toJSON(), true);
|
|
42
42
|
if (!client.isClientLogsSilent)
|
|
43
43
|
client.logger.log(`Loaded ${client.commands.slashCommands.size} slash commands`, `Loaded ${client.commands.messageCommands.size} message commands`);
|
|
44
|
-
if (client.config.commands.slashCommand.registerCommands)
|
|
44
|
+
if (client.config.commands.slashCommand.registerCommands && (client.config.commands.slashCommand.allowRegisterEmptyCommandList || client.commands.applicationCommandsSize)) {
|
|
45
45
|
await client.commands.registerApplicationCommands();
|
|
46
|
+
}
|
|
46
47
|
if (!client.isClientLogsSilent)
|
|
47
48
|
client.logger.warn(`Logged in as ${client.user?.tag || 'Unknown'}!`);
|
|
48
49
|
client.on('cacheSweep', () => client.cooldowns.clean());
|
package/dist/lib/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __exportStar(require("./reciple/types/builders.js"), exports);
|
|
|
29
29
|
__exportStar(require("./reciple/types/commands.js"), exports);
|
|
30
30
|
__exportStar(require("./reciple/types/builders.js"), exports);
|
|
31
31
|
__exportStar(require("./reciple/types/builders.js"), exports);
|
|
32
|
+
__exportStar(require("./reciple/flags"), exports);
|
|
32
33
|
__exportStar(require("./reciple/permissions.js"), exports);
|
|
33
34
|
__exportStar(require("./reciple/util.js"), exports);
|
|
34
35
|
__exportStar(require("./reciple/version.js"), exports);
|
|
@@ -6,6 +6,6 @@ exports.CommandType = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
var CommandType;
|
|
8
8
|
(function (CommandType) {
|
|
9
|
-
CommandType[CommandType["MessageCommand"] = 0] = "MessageCommand";
|
|
10
9
|
CommandType[CommandType["SlashCommand"] = 1] = "SlashCommand";
|
|
10
|
+
CommandType[CommandType["MessageCommand"] = 2] = "MessageCommand";
|
|
11
11
|
})(CommandType = exports.CommandType || (exports.CommandType = {}));
|
|
@@ -6,10 +6,10 @@ exports.CommandHaltReason = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
var CommandHaltReason;
|
|
8
8
|
(function (CommandHaltReason) {
|
|
9
|
-
CommandHaltReason[CommandHaltReason["Error"] =
|
|
10
|
-
CommandHaltReason[CommandHaltReason["Cooldown"] =
|
|
11
|
-
CommandHaltReason[CommandHaltReason["InvalidArguments"] =
|
|
12
|
-
CommandHaltReason[CommandHaltReason["MissingArguments"] =
|
|
13
|
-
CommandHaltReason[CommandHaltReason["MissingMemberPermissions"] =
|
|
14
|
-
CommandHaltReason[CommandHaltReason["MissingBotPermissions"] =
|
|
9
|
+
CommandHaltReason[CommandHaltReason["Error"] = 1] = "Error";
|
|
10
|
+
CommandHaltReason[CommandHaltReason["Cooldown"] = 2] = "Cooldown";
|
|
11
|
+
CommandHaltReason[CommandHaltReason["InvalidArguments"] = 3] = "InvalidArguments";
|
|
12
|
+
CommandHaltReason[CommandHaltReason["MissingArguments"] = 4] = "MissingArguments";
|
|
13
|
+
CommandHaltReason[CommandHaltReason["MissingMemberPermissions"] = 5] = "MissingMemberPermissions";
|
|
14
|
+
CommandHaltReason[CommandHaltReason["MissingBotPermissions"] = 6] = "MissingBotPermissions";
|
|
15
15
|
})(CommandHaltReason = exports.CommandHaltReason || (exports.CommandHaltReason = {}));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './reciple/types/builders.js';
|
|
|
13
13
|
export * from './reciple/types/commands.js';
|
|
14
14
|
export * from './reciple/types/builders.js';
|
|
15
15
|
export * from './reciple/types/builders.js';
|
|
16
|
+
export * from './reciple/flags';
|
|
16
17
|
export * from './reciple/permissions.js';
|
|
17
18
|
export * from './reciple/util.js';
|
|
18
19
|
export * from './reciple/version.js';
|
|
@@ -54,8 +54,8 @@ export declare type AnySlashCommandOptionsOnlyOptionBuilder = SlashCommandAttach
|
|
|
54
54
|
* Types of command builders
|
|
55
55
|
*/
|
|
56
56
|
export declare enum CommandType {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
SlashCommand = 1,
|
|
58
|
+
MessageCommand = 2
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Shared command builder methods and properties
|
|
@@ -11,7 +11,7 @@ export declare type AnyCommandHaltData<T = unknown> = SlashCommandHaltData<T> |
|
|
|
11
11
|
/**
|
|
12
12
|
* command halt data
|
|
13
13
|
*/
|
|
14
|
-
export declare type CommandHaltData<T extends CommandType, M = unknown> =
|
|
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
15
|
/**
|
|
16
16
|
* Any command execute data
|
|
17
17
|
*/
|
|
@@ -38,44 +38,44 @@ export interface BaseCommandHaltData<T extends CommandType, M = unknown> {
|
|
|
38
38
|
*/
|
|
39
39
|
executeData: T extends CommandType.SlashCommand ? SlashCommandExecuteData<M> : T extends CommandType.MessageCommand ? MessageCommandExecuteData<M> : AnyCommandExecuteData<M>;
|
|
40
40
|
}
|
|
41
|
-
export interface
|
|
41
|
+
export interface CommandErrorHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
|
|
42
42
|
reason: CommandHaltReason.Error;
|
|
43
43
|
/**
|
|
44
44
|
* Caught error
|
|
45
45
|
*/
|
|
46
46
|
error: any;
|
|
47
47
|
}
|
|
48
|
-
export interface
|
|
48
|
+
export interface CommandCooldownHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M>, CooledDownUser {
|
|
49
49
|
reason: CommandHaltReason.Cooldown;
|
|
50
50
|
}
|
|
51
|
-
export interface
|
|
51
|
+
export interface CommandInvalidArgumentsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
|
|
52
52
|
reason: CommandHaltReason.InvalidArguments;
|
|
53
53
|
/**
|
|
54
54
|
* Arguments that are invalid
|
|
55
55
|
*/
|
|
56
56
|
invalidArguments: MessageCommandOptionManager;
|
|
57
57
|
}
|
|
58
|
-
export interface
|
|
58
|
+
export interface CommandMissingArgumentsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
|
|
59
59
|
reason: CommandHaltReason.MissingArguments;
|
|
60
60
|
/**
|
|
61
61
|
* Arguments that are missing
|
|
62
62
|
*/
|
|
63
63
|
missingArguments: MessageCommandOptionManager;
|
|
64
64
|
}
|
|
65
|
-
export interface
|
|
65
|
+
export interface CommandMissingMemberPermissionsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
|
|
66
66
|
reason: CommandHaltReason.MissingMemberPermissions;
|
|
67
67
|
}
|
|
68
|
-
export interface
|
|
68
|
+
export interface CommandMissingBotPermissionsHaltData<T extends CommandType, M = unknown> extends BaseCommandHaltData<T, M> {
|
|
69
69
|
reason: CommandHaltReason.MissingBotPermissions;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Command halt reasons
|
|
73
73
|
*/
|
|
74
74
|
export declare enum CommandHaltReason {
|
|
75
|
-
Error =
|
|
76
|
-
Cooldown =
|
|
77
|
-
InvalidArguments =
|
|
78
|
-
MissingArguments =
|
|
79
|
-
MissingMemberPermissions =
|
|
80
|
-
MissingBotPermissions =
|
|
75
|
+
Error = 1,
|
|
76
|
+
Cooldown = 2,
|
|
77
|
+
InvalidArguments = 3,
|
|
78
|
+
MissingArguments = 4,
|
|
79
|
+
MissingMemberPermissions = 5,
|
|
80
|
+
MissingBotPermissions = 6
|
|
81
81
|
}
|
package/package.json
CHANGED
package/resource/reciple.yml
CHANGED
|
@@ -4,20 +4,24 @@ token: TOKEN
|
|
|
4
4
|
|
|
5
5
|
# Commands options
|
|
6
6
|
commands:
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
# enable
|
|
7
|
+
# Interaction command options
|
|
8
|
+
slashCommand:
|
|
9
|
+
# enable interaction commands
|
|
10
10
|
enabled: true
|
|
11
|
-
# command prefix
|
|
12
|
-
prefix: '!'
|
|
13
11
|
# reply when an error occured
|
|
14
12
|
replyOnError: false
|
|
15
13
|
# enable the use of command cooldowns
|
|
16
14
|
enableCooldown: true
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
#
|
|
20
|
-
|
|
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: []
|
|
21
25
|
# overwrite command permissions
|
|
22
26
|
permissions:
|
|
23
27
|
# enable overwriten command permissions
|
|
@@ -27,22 +31,20 @@ commands:
|
|
|
27
31
|
permissions:
|
|
28
32
|
- Administrator
|
|
29
33
|
|
|
30
|
-
#
|
|
31
|
-
|
|
32
|
-
# enable
|
|
34
|
+
# message command options
|
|
35
|
+
messageCommand:
|
|
36
|
+
# enable message commands
|
|
33
37
|
enabled: true
|
|
38
|
+
# command prefix
|
|
39
|
+
prefix: '!'
|
|
34
40
|
# reply when an error occured
|
|
35
41
|
replyOnError: false
|
|
36
42
|
# enable the use of command cooldowns
|
|
37
43
|
enableCooldown: true
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
#
|
|
41
|
-
|
|
42
|
-
# accept replied or deffered command interaction
|
|
43
|
-
acceptRepliedInteractions: false
|
|
44
|
-
# register commands to specific guild(s) empty to make it global
|
|
45
|
-
guilds: []
|
|
44
|
+
# allow executing commands via aliases
|
|
45
|
+
allowCommandAlias: true
|
|
46
|
+
# command argument separator
|
|
47
|
+
commandArgumentSeparator: ' '
|
|
46
48
|
# overwrite command permissions
|
|
47
49
|
permissions:
|
|
48
50
|
# enable overwriten command permissions
|
|
@@ -52,7 +54,6 @@ commands:
|
|
|
52
54
|
permissions:
|
|
53
55
|
- Administrator
|
|
54
56
|
|
|
55
|
-
|
|
56
57
|
# Logger options
|
|
57
58
|
fileLogging:
|
|
58
59
|
# enable console output to file
|