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.
- package/LICENSE +674 -674
- package/README.md +183 -183
- package/dist/lib/bin.mjs +67 -67
- package/dist/lib/esm.mjs +1 -1
- package/dist/lib/index.js +33 -33
- package/dist/lib/reciple/classes/RecipleClient.js +307 -307
- 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 -309
- package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +126 -126
- 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 -99
- package/dist/lib/reciple/classes/managers/CommandManager.js +60 -60
- package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +25 -25
- package/dist/lib/reciple/classes/managers/ModuleManager.js +180 -176
- 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 +71 -71
- 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 -17
- package/dist/types/reciple/classes/RecipleClient.d.ts +114 -114
- 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 -189
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +53 -53
- 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 -34
- 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 -15
- package/dist/types/reciple/types/builders.d.ts +205 -205
- 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 -26
- package/dist/types/reciple/version.d.ts +25 -25
- package/package.json +1 -1
- package/resource/reciple.yml +120 -120
|
@@ -1,189 +1,189 @@
|
|
|
1
|
-
import { CommandType, CommandHaltFunction, CommandExecuteFunction, SharedCommandBuilderProperties, MessageCommandData, MessageCommandOptionResolvable, MessageCommandResolvable } from '../../types/builders';
|
|
2
|
-
import { Message, PermissionResolvable, RestOrArray } from 'discord.js';
|
|
3
|
-
import { MessageCommandOptionManager } from '../managers/MessageCommandOptionManager';
|
|
4
|
-
import { BaseCommandExecuteData, CommandHaltData } from '../../types/commands';
|
|
5
|
-
import { MessageCommandOptionBuilder } from './MessageCommandOptionBuilder';
|
|
6
|
-
import { Command } from 'fallout-utility';
|
|
7
|
-
/**
|
|
8
|
-
* Execute data for message command
|
|
9
|
-
*/
|
|
10
|
-
export interface MessageCommandExecuteData<T = unknown> extends BaseCommandExecuteData {
|
|
11
|
-
/**
|
|
12
|
-
* Command message
|
|
13
|
-
*/
|
|
14
|
-
message: Message;
|
|
15
|
-
/**
|
|
16
|
-
* Command option args
|
|
17
|
-
*/
|
|
18
|
-
options: MessageCommandOptionManager;
|
|
19
|
-
/**
|
|
20
|
-
* Command parsed args
|
|
21
|
-
*/
|
|
22
|
-
command: Command;
|
|
23
|
-
/**
|
|
24
|
-
* Command builder
|
|
25
|
-
*/
|
|
26
|
-
builder: MessageCommandBuilder<T>;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Validated message command option
|
|
30
|
-
*/
|
|
31
|
-
export interface MessageCommandValidatedOption {
|
|
32
|
-
/**
|
|
33
|
-
* Option name
|
|
34
|
-
*/
|
|
35
|
-
name: string;
|
|
36
|
-
/**
|
|
37
|
-
* Option value
|
|
38
|
-
*/
|
|
39
|
-
value?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Is the option required
|
|
42
|
-
*/
|
|
43
|
-
required: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Is the option invalid
|
|
46
|
-
*/
|
|
47
|
-
invalid: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Is the option missing
|
|
50
|
-
*/
|
|
51
|
-
missing: boolean;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Halt data for message command
|
|
55
|
-
*/
|
|
56
|
-
export declare type MessageCommandHaltData<T = unknown> = CommandHaltData<CommandType.MessageCommand, T>;
|
|
57
|
-
/**
|
|
58
|
-
* Message command halt function
|
|
59
|
-
*/
|
|
60
|
-
export declare type MessageCommandHaltFunction<T = unknown> = CommandHaltFunction<CommandType.MessageCommand, T>;
|
|
61
|
-
/**
|
|
62
|
-
* Message command execute function
|
|
63
|
-
*/
|
|
64
|
-
export declare type MessageCommandExecuteFunction<T = unknown> = CommandExecuteFunction<CommandType.MessageCommand, T>;
|
|
65
|
-
/**
|
|
66
|
-
* Reciple builder for message command
|
|
67
|
-
*/
|
|
68
|
-
export declare class MessageCommandBuilder<T = unknown> implements SharedCommandBuilderProperties<T> {
|
|
69
|
-
readonly type = CommandType.MessageCommand;
|
|
70
|
-
protected _name: string;
|
|
71
|
-
protected _description: string;
|
|
72
|
-
protected _cooldown: number;
|
|
73
|
-
protected _aliases: string[];
|
|
74
|
-
protected _validateOptions: boolean;
|
|
75
|
-
protected _options: MessageCommandOptionBuilder[];
|
|
76
|
-
protected _requiredBotPermissions: PermissionResolvable[];
|
|
77
|
-
protected _requiredMemberPermissions: PermissionResolvable[];
|
|
78
|
-
protected _allowExecuteInDM: boolean;
|
|
79
|
-
protected _allowExecuteByBots: boolean;
|
|
80
|
-
protected _halt?: MessageCommandHaltFunction<T>;
|
|
81
|
-
protected _execute: MessageCommandExecuteFunction<T>;
|
|
82
|
-
metadata?: T;
|
|
83
|
-
get name(): typeof this._name;
|
|
84
|
-
get description(): typeof this._description;
|
|
85
|
-
get cooldown(): typeof this._cooldown;
|
|
86
|
-
get aliases(): typeof this._aliases;
|
|
87
|
-
get validateOptions(): typeof this._validateOptions;
|
|
88
|
-
get options(): typeof this._options;
|
|
89
|
-
get requiredBotPermissions(): typeof this._requiredBotPermissions;
|
|
90
|
-
get requiredMemberPermissions(): typeof this._requiredMemberPermissions;
|
|
91
|
-
get allowExecuteInDM(): typeof this._allowExecuteInDM;
|
|
92
|
-
get allowExecuteByBots(): typeof this._allowExecuteByBots;
|
|
93
|
-
get halt(): typeof this._halt;
|
|
94
|
-
get execute(): typeof this._execute;
|
|
95
|
-
set name(name: typeof this._name);
|
|
96
|
-
set description(description: typeof this._description);
|
|
97
|
-
set cooldown(cooldown: typeof this._cooldown);
|
|
98
|
-
set aliases(aliases: typeof this._aliases);
|
|
99
|
-
set validateOptions(validate: typeof this._validateOptions);
|
|
100
|
-
set options(options: MessageCommandOptionResolvable[]);
|
|
101
|
-
set requiredBotPermissions(permissions: typeof this._requiredBotPermissions);
|
|
102
|
-
set requiredMemberPermissions(permissions: typeof this._requiredMemberPermissions);
|
|
103
|
-
set allowExecuteInDM(allow: typeof this._allowExecuteInDM);
|
|
104
|
-
set allowExecuteByBots(allow: typeof this._allowExecuteByBots);
|
|
105
|
-
set halt(halt: typeof this._halt);
|
|
106
|
-
set execute(execute: typeof this._execute);
|
|
107
|
-
constructor(data?: Partial<Omit<MessageCommandData<T>, 'type'>>);
|
|
108
|
-
/**
|
|
109
|
-
* Sets the command name
|
|
110
|
-
* @param name Command name
|
|
111
|
-
*/
|
|
112
|
-
setName(name: string): this;
|
|
113
|
-
/**
|
|
114
|
-
* Sets the command description
|
|
115
|
-
* @param description Command description
|
|
116
|
-
*/
|
|
117
|
-
setDescription(description: string): this;
|
|
118
|
-
/**
|
|
119
|
-
* Add aliases to the command
|
|
120
|
-
* @param aliases Command aliases
|
|
121
|
-
*/
|
|
122
|
-
addAliases(...aliases: RestOrArray<string>): this;
|
|
123
|
-
/**
|
|
124
|
-
* Replace aliases from command builder
|
|
125
|
-
* @param aliases Command aliases
|
|
126
|
-
*/
|
|
127
|
-
setAliases(...aliases: RestOrArray<string>): this;
|
|
128
|
-
/**
|
|
129
|
-
* Set if command can be executed in dms
|
|
130
|
-
* @param allowExecuteInDM `true` if the command can execute in DMs
|
|
131
|
-
*/
|
|
132
|
-
setAllowExecuteInDM(allowExecuteInDM: boolean): this;
|
|
133
|
-
/**
|
|
134
|
-
* Allow command to be executed by bots
|
|
135
|
-
* @param allowExecuteByBots `true` if the command can be executed by bots
|
|
136
|
-
*/
|
|
137
|
-
setAllowExecuteByBots(allowExecuteByBots: boolean): this;
|
|
138
|
-
/**
|
|
139
|
-
* Add new command options
|
|
140
|
-
* @param options Message options
|
|
141
|
-
*/
|
|
142
|
-
addOptions(...options: RestOrArray<MessageCommandOptionResolvable | ((builder: MessageCommandOptionBuilder) => MessageCommandOptionBuilder)>): this;
|
|
143
|
-
/**
|
|
144
|
-
* Add new command option
|
|
145
|
-
* @param option Message option
|
|
146
|
-
*/
|
|
147
|
-
addOption(option: MessageCommandOptionResolvable | ((builder: MessageCommandOptionBuilder) => MessageCommandOptionBuilder)): this;
|
|
148
|
-
/**
|
|
149
|
-
* Set options from command
|
|
150
|
-
* @params options Message options
|
|
151
|
-
*/
|
|
152
|
-
setOptions(...options: RestOrArray<MessageCommandOptionResolvable | ((builder: MessageCommandOptionBuilder) => MessageCommandOptionBuilder)>): this;
|
|
153
|
-
/**
|
|
154
|
-
* Validate options before executing
|
|
155
|
-
* @param validateOptions `true` if the command options needs to be validated before executing
|
|
156
|
-
*/
|
|
157
|
-
setValidateOptions(validateOptions: boolean): this;
|
|
158
|
-
setCooldown(cooldown: number): this;
|
|
159
|
-
setRequiredBotPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
|
|
160
|
-
setRequiredMemberPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
|
|
161
|
-
setHalt(halt?: MessageCommandHaltFunction<T> | null): this;
|
|
162
|
-
setExecute(execute: MessageCommandExecuteFunction<T>): this;
|
|
163
|
-
setMetadata(metadata?: T): this;
|
|
164
|
-
/**
|
|
165
|
-
* Returns JSON object of this builder
|
|
166
|
-
*/
|
|
167
|
-
toJSON(): MessageCommandData<T>;
|
|
168
|
-
/**
|
|
169
|
-
* Resolve message command data/builder
|
|
170
|
-
* @param commandData Command data to resolve
|
|
171
|
-
*/
|
|
172
|
-
static resolveMessageCommand<T = unknown>(commandData: MessageCommandData<T> | MessageCommandBuilder<T>): MessageCommandBuilder<T>;
|
|
173
|
-
/**
|
|
174
|
-
* Is a message command builder
|
|
175
|
-
* @param builder data to check
|
|
176
|
-
*/
|
|
177
|
-
static isMessageCommandBuilder<T>(builder: unknown): builder is MessageCommandBuilder<T>;
|
|
178
|
-
/**
|
|
179
|
-
* Is a message command execute data
|
|
180
|
-
* @param executeData data to check
|
|
181
|
-
*/
|
|
182
|
-
static isMessageCommandExecuteData(executeData: unknown): executeData is MessageCommandExecuteData;
|
|
183
|
-
/**
|
|
184
|
-
* Validate message command options
|
|
185
|
-
* @param builder Command builder
|
|
186
|
-
* @param options Parsed command args
|
|
187
|
-
*/
|
|
188
|
-
static validateOptions(builder: MessageCommandResolvable, commandArgs: Command | string[]): Promise<MessageCommandOptionManager>;
|
|
189
|
-
}
|
|
1
|
+
import { CommandType, CommandHaltFunction, CommandExecuteFunction, SharedCommandBuilderProperties, MessageCommandData, MessageCommandOptionResolvable, MessageCommandResolvable } from '../../types/builders';
|
|
2
|
+
import { Message, PermissionResolvable, RestOrArray } from 'discord.js';
|
|
3
|
+
import { MessageCommandOptionManager } from '../managers/MessageCommandOptionManager';
|
|
4
|
+
import { BaseCommandExecuteData, CommandHaltData } from '../../types/commands';
|
|
5
|
+
import { MessageCommandOptionBuilder } from './MessageCommandOptionBuilder';
|
|
6
|
+
import { Command } from 'fallout-utility';
|
|
7
|
+
/**
|
|
8
|
+
* Execute data for message command
|
|
9
|
+
*/
|
|
10
|
+
export interface MessageCommandExecuteData<T = unknown> extends BaseCommandExecuteData {
|
|
11
|
+
/**
|
|
12
|
+
* Command message
|
|
13
|
+
*/
|
|
14
|
+
message: Message;
|
|
15
|
+
/**
|
|
16
|
+
* Command option args
|
|
17
|
+
*/
|
|
18
|
+
options: MessageCommandOptionManager;
|
|
19
|
+
/**
|
|
20
|
+
* Command parsed args
|
|
21
|
+
*/
|
|
22
|
+
command: Command;
|
|
23
|
+
/**
|
|
24
|
+
* Command builder
|
|
25
|
+
*/
|
|
26
|
+
builder: MessageCommandBuilder<T>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Validated message command option
|
|
30
|
+
*/
|
|
31
|
+
export interface MessageCommandValidatedOption {
|
|
32
|
+
/**
|
|
33
|
+
* Option name
|
|
34
|
+
*/
|
|
35
|
+
name: string;
|
|
36
|
+
/**
|
|
37
|
+
* Option value
|
|
38
|
+
*/
|
|
39
|
+
value?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Is the option required
|
|
42
|
+
*/
|
|
43
|
+
required: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Is the option invalid
|
|
46
|
+
*/
|
|
47
|
+
invalid: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Is the option missing
|
|
50
|
+
*/
|
|
51
|
+
missing: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Halt data for message command
|
|
55
|
+
*/
|
|
56
|
+
export declare type MessageCommandHaltData<T = unknown> = CommandHaltData<CommandType.MessageCommand, T>;
|
|
57
|
+
/**
|
|
58
|
+
* Message command halt function
|
|
59
|
+
*/
|
|
60
|
+
export declare type MessageCommandHaltFunction<T = unknown> = CommandHaltFunction<CommandType.MessageCommand, T>;
|
|
61
|
+
/**
|
|
62
|
+
* Message command execute function
|
|
63
|
+
*/
|
|
64
|
+
export declare type MessageCommandExecuteFunction<T = unknown> = CommandExecuteFunction<CommandType.MessageCommand, T>;
|
|
65
|
+
/**
|
|
66
|
+
* Reciple builder for message command
|
|
67
|
+
*/
|
|
68
|
+
export declare class MessageCommandBuilder<T = unknown> implements SharedCommandBuilderProperties<T> {
|
|
69
|
+
readonly type = CommandType.MessageCommand;
|
|
70
|
+
protected _name: string;
|
|
71
|
+
protected _description: string;
|
|
72
|
+
protected _cooldown: number;
|
|
73
|
+
protected _aliases: string[];
|
|
74
|
+
protected _validateOptions: boolean;
|
|
75
|
+
protected _options: MessageCommandOptionBuilder[];
|
|
76
|
+
protected _requiredBotPermissions: PermissionResolvable[];
|
|
77
|
+
protected _requiredMemberPermissions: PermissionResolvable[];
|
|
78
|
+
protected _allowExecuteInDM: boolean;
|
|
79
|
+
protected _allowExecuteByBots: boolean;
|
|
80
|
+
protected _halt?: MessageCommandHaltFunction<T>;
|
|
81
|
+
protected _execute: MessageCommandExecuteFunction<T>;
|
|
82
|
+
metadata?: T;
|
|
83
|
+
get name(): typeof this._name;
|
|
84
|
+
get description(): typeof this._description;
|
|
85
|
+
get cooldown(): typeof this._cooldown;
|
|
86
|
+
get aliases(): typeof this._aliases;
|
|
87
|
+
get validateOptions(): typeof this._validateOptions;
|
|
88
|
+
get options(): typeof this._options;
|
|
89
|
+
get requiredBotPermissions(): typeof this._requiredBotPermissions;
|
|
90
|
+
get requiredMemberPermissions(): typeof this._requiredMemberPermissions;
|
|
91
|
+
get allowExecuteInDM(): typeof this._allowExecuteInDM;
|
|
92
|
+
get allowExecuteByBots(): typeof this._allowExecuteByBots;
|
|
93
|
+
get halt(): typeof this._halt;
|
|
94
|
+
get execute(): typeof this._execute;
|
|
95
|
+
set name(name: typeof this._name);
|
|
96
|
+
set description(description: typeof this._description);
|
|
97
|
+
set cooldown(cooldown: typeof this._cooldown);
|
|
98
|
+
set aliases(aliases: typeof this._aliases);
|
|
99
|
+
set validateOptions(validate: typeof this._validateOptions);
|
|
100
|
+
set options(options: MessageCommandOptionResolvable[]);
|
|
101
|
+
set requiredBotPermissions(permissions: typeof this._requiredBotPermissions);
|
|
102
|
+
set requiredMemberPermissions(permissions: typeof this._requiredMemberPermissions);
|
|
103
|
+
set allowExecuteInDM(allow: typeof this._allowExecuteInDM);
|
|
104
|
+
set allowExecuteByBots(allow: typeof this._allowExecuteByBots);
|
|
105
|
+
set halt(halt: typeof this._halt);
|
|
106
|
+
set execute(execute: typeof this._execute);
|
|
107
|
+
constructor(data?: Partial<Omit<MessageCommandData<T>, 'type'>>);
|
|
108
|
+
/**
|
|
109
|
+
* Sets the command name
|
|
110
|
+
* @param name Command name
|
|
111
|
+
*/
|
|
112
|
+
setName(name: string): this;
|
|
113
|
+
/**
|
|
114
|
+
* Sets the command description
|
|
115
|
+
* @param description Command description
|
|
116
|
+
*/
|
|
117
|
+
setDescription(description: string): this;
|
|
118
|
+
/**
|
|
119
|
+
* Add aliases to the command
|
|
120
|
+
* @param aliases Command aliases
|
|
121
|
+
*/
|
|
122
|
+
addAliases(...aliases: RestOrArray<string>): this;
|
|
123
|
+
/**
|
|
124
|
+
* Replace aliases from command builder
|
|
125
|
+
* @param aliases Command aliases
|
|
126
|
+
*/
|
|
127
|
+
setAliases(...aliases: RestOrArray<string>): this;
|
|
128
|
+
/**
|
|
129
|
+
* Set if command can be executed in dms
|
|
130
|
+
* @param allowExecuteInDM `true` if the command can execute in DMs
|
|
131
|
+
*/
|
|
132
|
+
setAllowExecuteInDM(allowExecuteInDM: boolean): this;
|
|
133
|
+
/**
|
|
134
|
+
* Allow command to be executed by bots
|
|
135
|
+
* @param allowExecuteByBots `true` if the command can be executed by bots
|
|
136
|
+
*/
|
|
137
|
+
setAllowExecuteByBots(allowExecuteByBots: boolean): this;
|
|
138
|
+
/**
|
|
139
|
+
* Add new command options
|
|
140
|
+
* @param options Message options
|
|
141
|
+
*/
|
|
142
|
+
addOptions(...options: RestOrArray<MessageCommandOptionResolvable | ((builder: MessageCommandOptionBuilder) => MessageCommandOptionBuilder)>): this;
|
|
143
|
+
/**
|
|
144
|
+
* Add new command option
|
|
145
|
+
* @param option Message option
|
|
146
|
+
*/
|
|
147
|
+
addOption(option: MessageCommandOptionResolvable | ((builder: MessageCommandOptionBuilder) => MessageCommandOptionBuilder)): this;
|
|
148
|
+
/**
|
|
149
|
+
* Set options from command
|
|
150
|
+
* @params options Message options
|
|
151
|
+
*/
|
|
152
|
+
setOptions(...options: RestOrArray<MessageCommandOptionResolvable | ((builder: MessageCommandOptionBuilder) => MessageCommandOptionBuilder)>): this;
|
|
153
|
+
/**
|
|
154
|
+
* Validate options before executing
|
|
155
|
+
* @param validateOptions `true` if the command options needs to be validated before executing
|
|
156
|
+
*/
|
|
157
|
+
setValidateOptions(validateOptions: boolean): this;
|
|
158
|
+
setCooldown(cooldown: number): this;
|
|
159
|
+
setRequiredBotPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
|
|
160
|
+
setRequiredMemberPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
|
|
161
|
+
setHalt(halt?: MessageCommandHaltFunction<T> | null): this;
|
|
162
|
+
setExecute(execute: MessageCommandExecuteFunction<T>): this;
|
|
163
|
+
setMetadata(metadata?: T): this;
|
|
164
|
+
/**
|
|
165
|
+
* Returns JSON object of this builder
|
|
166
|
+
*/
|
|
167
|
+
toJSON(): MessageCommandData<T>;
|
|
168
|
+
/**
|
|
169
|
+
* Resolve message command data/builder
|
|
170
|
+
* @param commandData Command data to resolve
|
|
171
|
+
*/
|
|
172
|
+
static resolveMessageCommand<T = unknown>(commandData: MessageCommandData<T> | MessageCommandBuilder<T>): MessageCommandBuilder<T>;
|
|
173
|
+
/**
|
|
174
|
+
* Is a message command builder
|
|
175
|
+
* @param builder data to check
|
|
176
|
+
*/
|
|
177
|
+
static isMessageCommandBuilder<T>(builder: unknown): builder is MessageCommandBuilder<T>;
|
|
178
|
+
/**
|
|
179
|
+
* Is a message command execute data
|
|
180
|
+
* @param executeData data to check
|
|
181
|
+
*/
|
|
182
|
+
static isMessageCommandExecuteData(executeData: unknown): executeData is MessageCommandExecuteData;
|
|
183
|
+
/**
|
|
184
|
+
* Validate message command options
|
|
185
|
+
* @param builder Command builder
|
|
186
|
+
* @param options Parsed command args
|
|
187
|
+
*/
|
|
188
|
+
static validateOptions(builder: MessageCommandResolvable, commandArgs: Command | string[]): Promise<MessageCommandOptionManager>;
|
|
189
|
+
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { MessageCommandOptionData, MessageCommandOptionResolvable } from '../../types/builders';
|
|
2
|
-
import { Awaitable } from 'discord.js';
|
|
3
|
-
import { MessageCommandValidatedOption } from './MessageCommandBuilder';
|
|
4
|
-
/**
|
|
5
|
-
* Option builder for MessageCommandBuilder
|
|
6
|
-
*/
|
|
7
|
-
export declare class MessageCommandOptionBuilder {
|
|
8
|
-
protected _name: string;
|
|
9
|
-
protected _description: string;
|
|
10
|
-
protected _required: boolean;
|
|
11
|
-
protected _validator?: (value: string) => Awaitable<boolean>;
|
|
12
|
-
get name(): typeof this._name;
|
|
13
|
-
get description(): typeof this._description;
|
|
14
|
-
get required(): typeof this._required;
|
|
15
|
-
get validator(): typeof this._validator;
|
|
16
|
-
set name(name: typeof this._name);
|
|
17
|
-
set description(description: typeof this._description);
|
|
18
|
-
set required(required: typeof this._required);
|
|
19
|
-
set validator(validator: typeof this._validator);
|
|
20
|
-
constructor(data?: Partial<MessageCommandOptionData>);
|
|
21
|
-
/**
|
|
22
|
-
* Set command option name
|
|
23
|
-
* @param name Option name
|
|
24
|
-
*/
|
|
25
|
-
setName(name: string): this;
|
|
26
|
-
/**
|
|
27
|
-
* Set command option description
|
|
28
|
-
* @param description Option description
|
|
29
|
-
*/
|
|
30
|
-
setDescription(description: string): this;
|
|
31
|
-
/**
|
|
32
|
-
* Set if this option is required
|
|
33
|
-
* @param required `true` if this option is required
|
|
34
|
-
*/
|
|
35
|
-
setRequired(required: boolean): this;
|
|
36
|
-
/**
|
|
37
|
-
* Set your custom function to validate given value for this option
|
|
38
|
-
* @param validator Custom function to validate value given for this option
|
|
39
|
-
*/
|
|
40
|
-
setValidator(validator?: (value: string) => Awaitable<boolean>): this;
|
|
41
|
-
toJSON(): MessageCommandOptionData;
|
|
42
|
-
/**
|
|
43
|
-
* Resolves message command option data/builder
|
|
44
|
-
* @param option Option data to resolve
|
|
45
|
-
*/
|
|
46
|
-
static resolveMessageCommandOption(option: MessageCommandOptionResolvable): MessageCommandOptionBuilder;
|
|
47
|
-
/**
|
|
48
|
-
* Is a Message command option builder
|
|
49
|
-
* @param builder data to check
|
|
50
|
-
*/
|
|
51
|
-
static isMessageCommandOption(builder: unknown): builder is MessageCommandOptionBuilder;
|
|
52
|
-
static validateOption(option: MessageCommandOptionResolvable, value?: string): Promise<MessageCommandValidatedOption>;
|
|
53
|
-
}
|
|
1
|
+
import { MessageCommandOptionData, MessageCommandOptionResolvable } from '../../types/builders';
|
|
2
|
+
import { Awaitable } from 'discord.js';
|
|
3
|
+
import { MessageCommandValidatedOption } from './MessageCommandBuilder';
|
|
4
|
+
/**
|
|
5
|
+
* Option builder for MessageCommandBuilder
|
|
6
|
+
*/
|
|
7
|
+
export declare class MessageCommandOptionBuilder {
|
|
8
|
+
protected _name: string;
|
|
9
|
+
protected _description: string;
|
|
10
|
+
protected _required: boolean;
|
|
11
|
+
protected _validator?: (value: string) => Awaitable<boolean>;
|
|
12
|
+
get name(): typeof this._name;
|
|
13
|
+
get description(): typeof this._description;
|
|
14
|
+
get required(): typeof this._required;
|
|
15
|
+
get validator(): typeof this._validator;
|
|
16
|
+
set name(name: typeof this._name);
|
|
17
|
+
set description(description: typeof this._description);
|
|
18
|
+
set required(required: typeof this._required);
|
|
19
|
+
set validator(validator: typeof this._validator);
|
|
20
|
+
constructor(data?: Partial<MessageCommandOptionData>);
|
|
21
|
+
/**
|
|
22
|
+
* Set command option name
|
|
23
|
+
* @param name Option name
|
|
24
|
+
*/
|
|
25
|
+
setName(name: string): this;
|
|
26
|
+
/**
|
|
27
|
+
* Set command option description
|
|
28
|
+
* @param description Option description
|
|
29
|
+
*/
|
|
30
|
+
setDescription(description: string): this;
|
|
31
|
+
/**
|
|
32
|
+
* Set if this option is required
|
|
33
|
+
* @param required `true` if this option is required
|
|
34
|
+
*/
|
|
35
|
+
setRequired(required: boolean): this;
|
|
36
|
+
/**
|
|
37
|
+
* Set your custom function to validate given value for this option
|
|
38
|
+
* @param validator Custom function to validate value given for this option
|
|
39
|
+
*/
|
|
40
|
+
setValidator(validator?: (value: string) => Awaitable<boolean>): this;
|
|
41
|
+
toJSON(): MessageCommandOptionData;
|
|
42
|
+
/**
|
|
43
|
+
* Resolves message command option data/builder
|
|
44
|
+
* @param option Option data to resolve
|
|
45
|
+
*/
|
|
46
|
+
static resolveMessageCommandOption(option: MessageCommandOptionResolvable): MessageCommandOptionBuilder;
|
|
47
|
+
/**
|
|
48
|
+
* Is a Message command option builder
|
|
49
|
+
* @param builder data to check
|
|
50
|
+
*/
|
|
51
|
+
static isMessageCommandOption(builder: unknown): builder is MessageCommandOptionBuilder;
|
|
52
|
+
static validateOption(option: MessageCommandOptionResolvable, value?: string): Promise<MessageCommandValidatedOption>;
|
|
53
|
+
}
|