reciple 5.0.0-pre.1 → 5.0.0-pre.2
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/bin/reciple/classes/builders/MessageCommandBuilder.d.ts +5 -9
- package/bin/reciple/classes/builders/MessageCommandBuilder.js +0 -6
- package/bin/reciple/classes/builders/SlashCommandBuilder.d.ts +5 -9
- package/bin/reciple/classes/builders/SlashCommandBuilder.js +0 -6
- package/bin/reciple/types/builders.d.ts +11 -7
- package/bin/reciple/types/commands.d.ts +8 -4
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CommandBuilderType, AnyCommandExecuteData,
|
|
1
|
+
import { CommandBuilderType, AnyCommandExecuteData, CommandHaltFunction, CommandExecuteFunction } from '../../types/builders';
|
|
2
2
|
import { MessageCommandOptionManager } from '../MessageCommandOptionManager';
|
|
3
3
|
import { MessageCommandOptionBuilder } from './MessageCommandOptionBuilder';
|
|
4
4
|
import { Command as CommandMessage } from 'fallout-utility';
|
|
5
5
|
import { Message, PermissionResolvable } from 'discord.js';
|
|
6
|
-
import {
|
|
6
|
+
import { CommandHaltData } from '../../types/commands';
|
|
7
7
|
import { RecipleClient } from '../RecipleClient';
|
|
8
8
|
/**
|
|
9
9
|
* Execute data for message command
|
|
@@ -28,15 +28,15 @@ export interface MessageCommandValidatedOption {
|
|
|
28
28
|
/**
|
|
29
29
|
* Message command halt data
|
|
30
30
|
*/
|
|
31
|
-
export declare type MessageCommandHaltData =
|
|
31
|
+
export declare type MessageCommandHaltData = CommandHaltData<CommandBuilderType.MessageCommand>;
|
|
32
32
|
/**
|
|
33
33
|
* Message command halt function
|
|
34
34
|
*/
|
|
35
|
-
export declare type MessageCommandHaltFunction =
|
|
35
|
+
export declare type MessageCommandHaltFunction = CommandHaltFunction<CommandBuilderType.MessageCommand>;
|
|
36
36
|
/**
|
|
37
37
|
* Message command execute function
|
|
38
38
|
*/
|
|
39
|
-
export declare type MessageCommandExecuteFunction =
|
|
39
|
+
export declare type MessageCommandExecuteFunction = CommandExecuteFunction<CommandBuilderType.MessageCommand>;
|
|
40
40
|
/**
|
|
41
41
|
* Reciple builder for message command
|
|
42
42
|
*/
|
|
@@ -115,10 +115,6 @@ export declare class MessageCommandBuilder {
|
|
|
115
115
|
* @param validateOptions `true` if the command options needs to be validated before executing
|
|
116
116
|
*/
|
|
117
117
|
setValidateOptions(validateOptions: boolean): this;
|
|
118
|
-
/**
|
|
119
|
-
* True if this is a message command builder
|
|
120
|
-
*/
|
|
121
|
-
isMessageCommand(): this is MessageCommandBuilder;
|
|
122
118
|
/**
|
|
123
119
|
* Is a message command builder
|
|
124
120
|
*/
|
|
@@ -153,12 +153,6 @@ class MessageCommandBuilder {
|
|
|
153
153
|
this.validateOptions = validateOptions;
|
|
154
154
|
return this;
|
|
155
155
|
}
|
|
156
|
-
/**
|
|
157
|
-
* True if this is a message command builder
|
|
158
|
-
*/
|
|
159
|
-
isMessageCommand() {
|
|
160
|
-
return this instanceof MessageCommandBuilder;
|
|
161
|
-
}
|
|
162
156
|
/**
|
|
163
157
|
* Is a message command builder
|
|
164
158
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommandBuilderType, AnyCommandExecuteData,
|
|
2
|
-
import {
|
|
1
|
+
import { CommandBuilderType, AnyCommandExecuteData, CommandHaltFunction, CommandExecuteFunction } from '../../types/builders';
|
|
2
|
+
import { CommandHaltData } from '../../types/commands';
|
|
3
3
|
import { RecipleClient } from '../RecipleClient';
|
|
4
4
|
import { ChatInputCommandInteraction, PermissionResolvable, SlashCommandBuilder as DiscordJsSlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder as DiscordJsSlashCommandSubcommandsOnlyBuilder } from 'discord.js';
|
|
5
5
|
/**
|
|
@@ -19,15 +19,15 @@ export interface SlashCommandBuilder extends DiscordJsSlashCommandBuilder {
|
|
|
19
19
|
/**
|
|
20
20
|
* Slash command halt data
|
|
21
21
|
*/
|
|
22
|
-
export declare type SlashCommandHaltData =
|
|
22
|
+
export declare type SlashCommandHaltData = CommandHaltData<CommandBuilderType.SlashCommand>;
|
|
23
23
|
/**
|
|
24
24
|
* Slash command halt function
|
|
25
25
|
*/
|
|
26
|
-
export declare type SlashCommandHaltFunction =
|
|
26
|
+
export declare type SlashCommandHaltFunction = CommandHaltFunction<CommandBuilderType.SlashCommand>;
|
|
27
27
|
/**
|
|
28
28
|
* Slash command execute function
|
|
29
29
|
*/
|
|
30
|
-
export declare type SlashCommandExecuteFunction =
|
|
30
|
+
export declare type SlashCommandExecuteFunction = CommandExecuteFunction<CommandBuilderType.SlashCommand>;
|
|
31
31
|
/**
|
|
32
32
|
* Reciple builder for interaction/slash command
|
|
33
33
|
*/
|
|
@@ -65,10 +65,6 @@ export declare class SlashCommandBuilder extends DiscordJsSlashCommandBuilder {
|
|
|
65
65
|
* @param execute Function to execute when the command is called
|
|
66
66
|
*/
|
|
67
67
|
setExecute(execute: this["execute"]): this;
|
|
68
|
-
/**
|
|
69
|
-
* True if this is a slash command builder
|
|
70
|
-
*/
|
|
71
|
-
isSlashCommand(): this is SlashCommandBuilder;
|
|
72
68
|
/**
|
|
73
69
|
* Is a slash command builder
|
|
74
70
|
*/
|
|
@@ -59,12 +59,6 @@ class SlashCommandBuilder extends discord_js_1.SlashCommandBuilder {
|
|
|
59
59
|
this.execute = execute;
|
|
60
60
|
return this;
|
|
61
61
|
}
|
|
62
|
-
/**
|
|
63
|
-
* True if this is a slash command builder
|
|
64
|
-
*/
|
|
65
|
-
isSlashCommand() {
|
|
66
|
-
return this instanceof SlashCommandBuilder;
|
|
67
|
-
}
|
|
68
62
|
/**
|
|
69
63
|
* Is a slash command builder
|
|
70
64
|
*/
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { MessageCommandBuilder, MessageCommandExecuteData, MessageCommandHaltData } from '../classes/builders/MessageCommandBuilder';
|
|
2
|
-
import { SlashCommandBuilder, SlashCommandExecuteData, SlashCommandHaltData } from '../classes/builders/SlashCommandBuilder';
|
|
1
|
+
import { MessageCommandBuilder, MessageCommandExecuteData, MessageCommandHaltData, MessageCommandHaltFunction } from '../classes/builders/MessageCommandBuilder';
|
|
2
|
+
import { SlashCommandBuilder, SlashCommandExecuteData, SlashCommandHaltData, SlashCommandHaltFunction } from '../classes/builders/SlashCommandBuilder';
|
|
3
3
|
import { Awaitable } from 'discord.js';
|
|
4
4
|
/**
|
|
5
|
-
* Reciple command builders
|
|
5
|
+
* Any Reciple command builders
|
|
6
6
|
*/
|
|
7
|
-
export declare type AnyCommandBuilder =
|
|
7
|
+
export declare type AnyCommandBuilder = SlashCommandBuilder | MessageCommandBuilder;
|
|
8
8
|
/**
|
|
9
|
-
* Reciple command execute data
|
|
9
|
+
* Any Reciple command execute data
|
|
10
10
|
*/
|
|
11
11
|
export declare type AnyCommandExecuteData = SlashCommandExecuteData | MessageCommandExecuteData;
|
|
12
|
+
/**
|
|
13
|
+
* Any Reciple command halt functions
|
|
14
|
+
*/
|
|
15
|
+
export declare type AnyCommandHaltFunction = SlashCommandHaltFunction | MessageCommandHaltFunction;
|
|
12
16
|
/**
|
|
13
17
|
* Reciple command halt function
|
|
14
18
|
*/
|
|
15
|
-
export declare type
|
|
19
|
+
export declare type CommandHaltFunction<T extends CommandBuilderType> = (haltData: T extends CommandBuilderType.SlashCommand ? SlashCommandHaltData : MessageCommandHaltData) => Awaitable<boolean | null | undefined | void>;
|
|
16
20
|
/**
|
|
17
21
|
* Reciple command execute function
|
|
18
22
|
*/
|
|
19
|
-
export declare type
|
|
23
|
+
export declare type CommandExecuteFunction<T extends CommandBuilderType> = (executeData: T extends CommandBuilderType.SlashCommand ? SlashCommandExecuteData : MessageCommandExecuteData) => Awaitable<void>;
|
|
20
24
|
/**
|
|
21
25
|
* Types of Reciple command builders
|
|
22
26
|
*/
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { MessageCommandExecuteData } from '../classes/builders/MessageCommandBuilder';
|
|
1
|
+
import { MessageCommandExecuteData, MessageCommandHaltData } from '../classes/builders/MessageCommandBuilder';
|
|
2
|
+
import { SlashCommandExecuteData, SlashCommandHaltData } from '../classes/builders/SlashCommandBuilder';
|
|
2
3
|
import { MessageCommandOptionManager } from '../classes/MessageCommandOptionManager';
|
|
3
|
-
import { SlashCommandExecuteData } from '../classes/builders/SlashCommandBuilder';
|
|
4
4
|
import { CommandBuilderType, AnyCommandExecuteData } from '../types/builders';
|
|
5
5
|
import { CooledDownUser } from '../classes/CommandCooldownManager';
|
|
6
6
|
/**
|
|
7
|
-
* Any
|
|
7
|
+
* Any reciple halted command data
|
|
8
8
|
*/
|
|
9
|
-
export declare type AnyCommandHaltData
|
|
9
|
+
export declare type AnyCommandHaltData = SlashCommandHaltData | MessageCommandHaltData;
|
|
10
|
+
/**
|
|
11
|
+
* Halted command data
|
|
12
|
+
*/
|
|
13
|
+
export declare type CommandHaltData<T extends CommandBuilderType> = CommandErrorData<T> | CommandCooldownData<T> | (T extends CommandBuilderType.SlashCommand ? never : CommandInvalidArguments<T> | CommandMissingArguments<T>) | CommandMissingMemberPermissions<T> | CommandMissingBotPermissions<T>;
|
|
10
14
|
/**
|
|
11
15
|
* Command halt reason base interface
|
|
12
16
|
*/
|