reciple 6.0.0-dev.25 → 6.0.0-dev.26

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 -66
  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 -296
  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 -59
  15. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +25 -25
  16. package/dist/lib/reciple/classes/managers/ModuleManager.js +176 -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 -69
  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 -104
  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 +2 -2
  46. package/resource/reciple.yml +120 -120
@@ -1,98 +1,98 @@
1
- import { CommandType, CommandHaltFunction, CommandExecuteFunction, SharedCommandBuilderProperties, AnySlashCommandBuilder, SlashCommandData, AnySlashCommandOptionData, AnySlashCommandOptionBuilder } from '../../types/builders';
2
- import { BaseCommandExecuteData, CommandHaltData } from '../../types/commands';
3
- import { ChatInputCommandInteraction, PermissionResolvable, RestOrArray, SlashCommandBuilder as DiscordJsSlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandBooleanOption, SlashCommandUserOption, SlashCommandChannelOption, SlashCommandRoleOption, SlashCommandAttachmentOption, SlashCommandMentionableOption, SlashCommandStringOption, SlashCommandIntegerOption, SlashCommandNumberOption, SharedSlashCommandOptions } from 'discord.js';
4
- /**
5
- * Execute data for slash command
6
- */
7
- export interface SlashCommandExecuteData<T = unknown> extends BaseCommandExecuteData {
8
- /**
9
- * Command interaction
10
- */
11
- interaction: ChatInputCommandInteraction;
12
- /**
13
- * Command Builder
14
- */
15
- builder: AnySlashCommandBuilder<T>;
16
- }
17
- /**
18
- * Slash command halt data
19
- */
20
- export declare type SlashCommandHaltData<T = unknown> = CommandHaltData<CommandType.SlashCommand, T>;
21
- /**
22
- * Slash command halt function
23
- */
24
- export declare type SlashCommandHaltFunction<T = unknown> = CommandHaltFunction<CommandType.SlashCommand, T>;
25
- /**
26
- * Slash command execute function
27
- */
28
- export declare type SlashCommandExecuteFunction<T = unknown> = CommandExecuteFunction<CommandType.SlashCommand, T>;
29
- export declare type SlashCommandSubcommandsOnlyBuilder<T = unknown> = Omit<SlashCommandBuilder<T>, 'addBooleanOption' | 'addUserOption' | 'addChannelOption' | 'addRoleOption' | 'addAttachmentOption' | 'addMentionableOption' | 'addStringOption' | 'addIntegerOption' | 'addNumberOption'>;
30
- export declare type SlashCommandOptionsOnlyBuilder<T = unknown> = Omit<SlashCommandBuilder<T>, 'addSubcommand' | 'addSubcommandGroup'>;
31
- export interface SlashCommandBuilder<T = unknown> extends DiscordJsSlashCommandBuilder {
32
- addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder | ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): SlashCommandSubcommandsOnlyBuilder;
33
- addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder;
34
- addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
35
- addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
36
- addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
37
- addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
38
- addAttachmentOption(input: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
39
- addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
40
- addStringOption(input: SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoices'> | ((builder: SlashCommandStringOption) => SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoices'>)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
41
- addIntegerOption(input: SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoices'> | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoices'>)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
42
- addNumberOption(input: SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoices'> | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoices'>)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
43
- }
44
- /**
45
- * Reciple builder for slash command
46
- */
47
- export declare class SlashCommandBuilder<T = unknown> extends DiscordJsSlashCommandBuilder implements SharedCommandBuilderProperties<T> {
48
- readonly type = CommandType.SlashCommand;
49
- protected _cooldown: number;
50
- protected _requiredBotPermissions: PermissionResolvable[];
51
- protected _requiredMemberPermissions: PermissionResolvable[];
52
- protected _halt?: SlashCommandHaltFunction<T>;
53
- protected _execute: SlashCommandExecuteFunction<T>;
54
- metadata?: T;
55
- get cooldown(): typeof this._cooldown;
56
- get requiredBotPermissions(): typeof this._requiredBotPermissions;
57
- get requiredMemberPermissions(): typeof this._requiredMemberPermissions;
58
- get halt(): typeof this._halt;
59
- get execute(): typeof this._execute;
60
- set cooldown(cooldown: typeof this._cooldown);
61
- set requiredBotPermissions(permissions: typeof this._requiredBotPermissions);
62
- set requiredMemberPermissions(permissions: typeof this._requiredMemberPermissions);
63
- set halt(halt: typeof this._halt);
64
- set execute(execute: typeof this._execute);
65
- constructor(data?: Partial<Omit<SlashCommandData<T>, 'type'>>);
66
- setCooldown(cooldown: number): this;
67
- setRequiredBotPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
68
- setRequiredMemberPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
69
- setHalt(halt?: SlashCommandHaltFunction<T> | null): this;
70
- setExecute(execute: SlashCommandExecuteFunction<T>): this;
71
- setMetadata(metadata?: T): this;
72
- /**
73
- * Add option builder to command builder
74
- * @param builder Command/Subcommand builder
75
- * @param option Option builder
76
- */
77
- static addOption(builder: SharedSlashCommandOptions | SlashCommandBuilder, option: AnySlashCommandOptionBuilder): SharedSlashCommandOptions;
78
- /**
79
- * Resolve option data
80
- * @param option Option dara to resolve
81
- */
82
- static resolveOption<T extends AnySlashCommandOptionBuilder>(option: AnySlashCommandOptionData): T;
83
- /**
84
- * Resolve slash command data/builder
85
- * @param commandData Command data to resolve
86
- */
87
- static resolveSlashCommand<T = unknown>(commandData: SlashCommandData<T> | AnySlashCommandBuilder<T>): AnySlashCommandBuilder<T>;
88
- /**
89
- * Is a slash command builder
90
- * @param builder data to check
91
- */
92
- static isSlashCommandBuilder<T = unknown>(builder: unknown): builder is AnySlashCommandBuilder<T>;
93
- /**
94
- * Is a slash command execute data
95
- * @param executeData data to check
96
- */
97
- static isSlashCommandExecuteData(executeData: unknown): executeData is SlashCommandExecuteData;
98
- }
1
+ import { CommandType, CommandHaltFunction, CommandExecuteFunction, SharedCommandBuilderProperties, AnySlashCommandBuilder, SlashCommandData, AnySlashCommandOptionData, AnySlashCommandOptionBuilder } from '../../types/builders';
2
+ import { BaseCommandExecuteData, CommandHaltData } from '../../types/commands';
3
+ import { ChatInputCommandInteraction, PermissionResolvable, RestOrArray, SlashCommandBuilder as DiscordJsSlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandBooleanOption, SlashCommandUserOption, SlashCommandChannelOption, SlashCommandRoleOption, SlashCommandAttachmentOption, SlashCommandMentionableOption, SlashCommandStringOption, SlashCommandIntegerOption, SlashCommandNumberOption, SharedSlashCommandOptions } from 'discord.js';
4
+ /**
5
+ * Execute data for slash command
6
+ */
7
+ export interface SlashCommandExecuteData<T = unknown> extends BaseCommandExecuteData {
8
+ /**
9
+ * Command interaction
10
+ */
11
+ interaction: ChatInputCommandInteraction;
12
+ /**
13
+ * Command Builder
14
+ */
15
+ builder: AnySlashCommandBuilder<T>;
16
+ }
17
+ /**
18
+ * Slash command halt data
19
+ */
20
+ export declare type SlashCommandHaltData<T = unknown> = CommandHaltData<CommandType.SlashCommand, T>;
21
+ /**
22
+ * Slash command halt function
23
+ */
24
+ export declare type SlashCommandHaltFunction<T = unknown> = CommandHaltFunction<CommandType.SlashCommand, T>;
25
+ /**
26
+ * Slash command execute function
27
+ */
28
+ export declare type SlashCommandExecuteFunction<T = unknown> = CommandExecuteFunction<CommandType.SlashCommand, T>;
29
+ export declare type SlashCommandSubcommandsOnlyBuilder<T = unknown> = Omit<SlashCommandBuilder<T>, 'addBooleanOption' | 'addUserOption' | 'addChannelOption' | 'addRoleOption' | 'addAttachmentOption' | 'addMentionableOption' | 'addStringOption' | 'addIntegerOption' | 'addNumberOption'>;
30
+ export declare type SlashCommandOptionsOnlyBuilder<T = unknown> = Omit<SlashCommandBuilder<T>, 'addSubcommand' | 'addSubcommandGroup'>;
31
+ export interface SlashCommandBuilder<T = unknown> extends DiscordJsSlashCommandBuilder {
32
+ addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder | ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): SlashCommandSubcommandsOnlyBuilder;
33
+ addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder;
34
+ addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
35
+ addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
36
+ addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
37
+ addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
38
+ addAttachmentOption(input: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
39
+ addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
40
+ addStringOption(input: SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoices'> | ((builder: SlashCommandStringOption) => SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoices'>)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
41
+ addIntegerOption(input: SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoices'> | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoices'>)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
42
+ addNumberOption(input: SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoices'> | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoices'>)): Omit<this, 'addSubcommand' | 'addSubcommandGroup'>;
43
+ }
44
+ /**
45
+ * Reciple builder for slash command
46
+ */
47
+ export declare class SlashCommandBuilder<T = unknown> extends DiscordJsSlashCommandBuilder implements SharedCommandBuilderProperties<T> {
48
+ readonly type = CommandType.SlashCommand;
49
+ protected _cooldown: number;
50
+ protected _requiredBotPermissions: PermissionResolvable[];
51
+ protected _requiredMemberPermissions: PermissionResolvable[];
52
+ protected _halt?: SlashCommandHaltFunction<T>;
53
+ protected _execute: SlashCommandExecuteFunction<T>;
54
+ metadata?: T;
55
+ get cooldown(): typeof this._cooldown;
56
+ get requiredBotPermissions(): typeof this._requiredBotPermissions;
57
+ get requiredMemberPermissions(): typeof this._requiredMemberPermissions;
58
+ get halt(): typeof this._halt;
59
+ get execute(): typeof this._execute;
60
+ set cooldown(cooldown: typeof this._cooldown);
61
+ set requiredBotPermissions(permissions: typeof this._requiredBotPermissions);
62
+ set requiredMemberPermissions(permissions: typeof this._requiredMemberPermissions);
63
+ set halt(halt: typeof this._halt);
64
+ set execute(execute: typeof this._execute);
65
+ constructor(data?: Partial<Omit<SlashCommandData<T>, 'type'>>);
66
+ setCooldown(cooldown: number): this;
67
+ setRequiredBotPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
68
+ setRequiredMemberPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
69
+ setHalt(halt?: SlashCommandHaltFunction<T> | null): this;
70
+ setExecute(execute: SlashCommandExecuteFunction<T>): this;
71
+ setMetadata(metadata?: T): this;
72
+ /**
73
+ * Add option builder to command builder
74
+ * @param builder Command/Subcommand builder
75
+ * @param option Option builder
76
+ */
77
+ static addOption(builder: SharedSlashCommandOptions | SlashCommandBuilder, option: AnySlashCommandOptionBuilder): SharedSlashCommandOptions;
78
+ /**
79
+ * Resolve option data
80
+ * @param option Option dara to resolve
81
+ */
82
+ static resolveOption<T extends AnySlashCommandOptionBuilder>(option: AnySlashCommandOptionData): T;
83
+ /**
84
+ * Resolve slash command data/builder
85
+ * @param commandData Command data to resolve
86
+ */
87
+ static resolveSlashCommand<T = unknown>(commandData: SlashCommandData<T> | AnySlashCommandBuilder<T>): AnySlashCommandBuilder<T>;
88
+ /**
89
+ * Is a slash command builder
90
+ * @param builder data to check
91
+ */
92
+ static isSlashCommandBuilder<T = unknown>(builder: unknown): builder is AnySlashCommandBuilder<T>;
93
+ /**
94
+ * Is a slash command execute data
95
+ * @param executeData data to check
96
+ */
97
+ static isSlashCommandExecuteData(executeData: unknown): executeData is SlashCommandExecuteData;
98
+ }
@@ -1,53 +1,53 @@
1
- import { ApplicationCommand, ApplicationCommandData, ContextMenuCommandBuilder, GuildResolvable, RestOrArray, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder as DiscordJsSlashCommandBuilder } from 'discord.js';
2
- import { AnySlashCommandBuilder } from '../../types/builders';
3
- import { RecipleClient } from '../RecipleClient';
4
- export declare type ApplicationCommandBuilder = AnySlashCommandBuilder | ContextMenuCommandBuilder | DiscordJsSlashCommandBuilder;
5
- export declare class ApplicationCommandManager {
6
- readonly client: RecipleClient;
7
- get commands(): (DiscordJsSlashCommandBuilder | import("../builders/SlashCommandBuilder").SlashCommandOptionsOnlyBuilder<unknown> | import("../builders/SlashCommandBuilder").SlashCommandSubcommandsOnlyBuilder<unknown> | ContextMenuCommandBuilder | import("discord.js").UserApplicationCommandData | import("discord.js").MessageApplicationCommandData | import("discord.js").ChatInputApplicationCommandData)[];
8
- get size(): number;
9
- constructor(client: RecipleClient);
10
- /**
11
- * Sets application commands globally or in guilds
12
- * @param commands Application commands
13
- * @param guilds set only to guilds
14
- */
15
- set(commands: (ApplicationCommandBuilder | ApplicationCommandData)[], ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
16
- /**
17
- * Add command globally or in guilds
18
- * @param command Application command
19
- * @param guilds add only in guilds
20
- */
21
- add(command: ApplicationCommandBuilder | ApplicationCommandData, ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
22
- /**
23
- * Remove application command globally or in guilds
24
- * @param command id of application commmand or ApplicationCommand class
25
- * @param guilds Remove from guilds
26
- */
27
- remove(command: string | ApplicationCommand, ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
28
- /**
29
- * Edit application command globally or in guilds
30
- * @param command id of application command or ApplicationCommand class
31
- * @param newCommand new application command data
32
- * @param guilds Edit only from guilds
33
- */
34
- edit(command: string | ApplicationCommand, newCommand: ApplicationCommandBuilder | ApplicationCommandData, ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
35
- /**
36
- * Get application command from cache by application command data, builder, id, or name globally or from guid
37
- * @param command application command data, builder, id, or name
38
- * @param guild get command from guild
39
- */
40
- get(command: ApplicationCommandData | ApplicationCommandBuilder | string, guild?: GuildResolvable): ApplicationCommand | undefined;
41
- /**
42
- * Fetch application command by id globally or from guild
43
- * @param commandId command id
44
- * @param guild fetch from guild
45
- */
46
- fetch(commandId: string, guild?: GuildResolvable): Promise<ApplicationCommand>;
47
- /**
48
- * Parse application command builders to command data
49
- * @param commands Application command builders
50
- * @param setPermissions set slash commands permissions
51
- */
52
- protected parseCommands(commands: (ApplicationCommandData | ApplicationCommandBuilder | RESTPostAPIApplicationCommandsJSONBody)[], setPermissions?: boolean): (ApplicationCommandData | RESTPostAPIApplicationCommandsJSONBody)[];
53
- }
1
+ import { ApplicationCommand, ApplicationCommandData, ContextMenuCommandBuilder, GuildResolvable, RestOrArray, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder as DiscordJsSlashCommandBuilder } from 'discord.js';
2
+ import { AnySlashCommandBuilder } from '../../types/builders';
3
+ import { RecipleClient } from '../RecipleClient';
4
+ export declare type ApplicationCommandBuilder = AnySlashCommandBuilder | ContextMenuCommandBuilder | DiscordJsSlashCommandBuilder;
5
+ export declare class ApplicationCommandManager {
6
+ readonly client: RecipleClient;
7
+ get commands(): (DiscordJsSlashCommandBuilder | import("../builders/SlashCommandBuilder").SlashCommandOptionsOnlyBuilder<unknown> | import("../builders/SlashCommandBuilder").SlashCommandSubcommandsOnlyBuilder<unknown> | ContextMenuCommandBuilder | import("discord.js").UserApplicationCommandData | import("discord.js").MessageApplicationCommandData | import("discord.js").ChatInputApplicationCommandData)[];
8
+ get size(): number;
9
+ constructor(client: RecipleClient);
10
+ /**
11
+ * Sets application commands globally or in guilds
12
+ * @param commands Application commands
13
+ * @param guilds set only to guilds
14
+ */
15
+ set(commands: (ApplicationCommandBuilder | ApplicationCommandData)[], ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
16
+ /**
17
+ * Add command globally or in guilds
18
+ * @param command Application command
19
+ * @param guilds add only in guilds
20
+ */
21
+ add(command: ApplicationCommandBuilder | ApplicationCommandData, ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
22
+ /**
23
+ * Remove application command globally or in guilds
24
+ * @param command id of application commmand or ApplicationCommand class
25
+ * @param guilds Remove from guilds
26
+ */
27
+ remove(command: string | ApplicationCommand, ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
28
+ /**
29
+ * Edit application command globally or in guilds
30
+ * @param command id of application command or ApplicationCommand class
31
+ * @param newCommand new application command data
32
+ * @param guilds Edit only from guilds
33
+ */
34
+ edit(command: string | ApplicationCommand, newCommand: ApplicationCommandBuilder | ApplicationCommandData, ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
35
+ /**
36
+ * Get application command from cache by application command data, builder, id, or name globally or from guid
37
+ * @param command application command data, builder, id, or name
38
+ * @param guild get command from guild
39
+ */
40
+ get(command: ApplicationCommandData | ApplicationCommandBuilder | string, guild?: GuildResolvable): ApplicationCommand | undefined;
41
+ /**
42
+ * Fetch application command by id globally or from guild
43
+ * @param commandId command id
44
+ * @param guild fetch from guild
45
+ */
46
+ fetch(commandId: string, guild?: GuildResolvable): Promise<ApplicationCommand>;
47
+ /**
48
+ * Parse application command builders to command data
49
+ * @param commands Application command builders
50
+ * @param setPermissions set slash commands permissions
51
+ */
52
+ protected parseCommands(commands: (ApplicationCommandData | ApplicationCommandBuilder | RESTPostAPIApplicationCommandsJSONBody)[], setPermissions?: boolean): (ApplicationCommandData | RESTPostAPIApplicationCommandsJSONBody)[];
53
+ }
@@ -1,70 +1,70 @@
1
- import { Guild, RestOrArray, TextBasedChannel, User } from 'discord.js';
2
- import { CommandType } from '../../types/builders';
3
- /**
4
- * cooled-down user object interface
5
- */
6
- export interface CooledDownUser {
7
- /**
8
- * Cooled-down user
9
- */
10
- user: User;
11
- /**
12
- * Cooled-down command name
13
- */
14
- command: string;
15
- /**
16
- * Command type
17
- */
18
- type: CommandType;
19
- /**
20
- * In guild
21
- */
22
- guild?: Guild | null;
23
- /**
24
- * Cooled-down channel
25
- */
26
- channel?: TextBasedChannel;
27
- /**
28
- * Cooldown expiration
29
- */
30
- expireTime: number;
31
- }
32
- /**
33
- * cooled-down users manager
34
- */
35
- export declare class CommandCooldownManager extends Array<CooledDownUser> {
36
- constructor(...data: RestOrArray<CooledDownUser>);
37
- /**
38
- * Alias for `CommandCooldownManager#push()`
39
- * @param options Cooled-down user data
40
- */
41
- add(...options: CooledDownUser[]): number;
42
- /**
43
- * Remove cooldown from specific user, channel or guild
44
- * @param options Remove cooldown data options
45
- * @param limit Remove cooldown data limit
46
- * @returns Returns the removed values
47
- */
48
- remove(options: Partial<CooledDownUser>, limit?: number): CooledDownUser[];
49
- /**
50
- * Check if the given user is cooled-down
51
- * @param options Options to identify if user is on cooldown
52
- */
53
- isCooledDown(options: Partial<Omit<CooledDownUser, 'expireTime'>>): boolean;
54
- /**
55
- * Purge non cooled-down users from this array
56
- * @param options Clean cooldown options
57
- */
58
- clean(options?: Partial<Omit<CooledDownUser, 'expireTime'>>): void;
59
- /**
60
- * Get someone's cooldown data
61
- * @param options Get cooldown data options
62
- */
63
- get(options: Partial<Omit<CooledDownUser, 'expireTime'>>): CooledDownUser | undefined;
64
- /**
65
- * Check if the options are valid
66
- * @param options Options to validated
67
- * @param data Cooled-down user data
68
- */
69
- static checkOptions(options: Partial<Omit<CooledDownUser, 'expireTime'>>, data: CooledDownUser): boolean;
70
- }
1
+ import { Guild, RestOrArray, TextBasedChannel, User } from 'discord.js';
2
+ import { CommandType } from '../../types/builders';
3
+ /**
4
+ * cooled-down user object interface
5
+ */
6
+ export interface CooledDownUser {
7
+ /**
8
+ * Cooled-down user
9
+ */
10
+ user: User;
11
+ /**
12
+ * Cooled-down command name
13
+ */
14
+ command: string;
15
+ /**
16
+ * Command type
17
+ */
18
+ type: CommandType;
19
+ /**
20
+ * In guild
21
+ */
22
+ guild?: Guild | null;
23
+ /**
24
+ * Cooled-down channel
25
+ */
26
+ channel?: TextBasedChannel;
27
+ /**
28
+ * Cooldown expiration
29
+ */
30
+ expireTime: number;
31
+ }
32
+ /**
33
+ * cooled-down users manager
34
+ */
35
+ export declare class CommandCooldownManager extends Array<CooledDownUser> {
36
+ constructor(...data: RestOrArray<CooledDownUser>);
37
+ /**
38
+ * Alias for `CommandCooldownManager#push()`
39
+ * @param options Cooled-down user data
40
+ */
41
+ add(...options: CooledDownUser[]): number;
42
+ /**
43
+ * Remove cooldown from specific user, channel or guild
44
+ * @param options Remove cooldown data options
45
+ * @param limit Remove cooldown data limit
46
+ * @returns Returns the removed values
47
+ */
48
+ remove(options: Partial<CooledDownUser>, limit?: number): CooledDownUser[];
49
+ /**
50
+ * Check if the given user is cooled-down
51
+ * @param options Options to identify if user is on cooldown
52
+ */
53
+ isCooledDown(options: Partial<Omit<CooledDownUser, 'expireTime'>>): boolean;
54
+ /**
55
+ * Purge non cooled-down users from this array
56
+ * @param options Clean cooldown options
57
+ */
58
+ clean(options?: Partial<Omit<CooledDownUser, 'expireTime'>>): void;
59
+ /**
60
+ * Get someone's cooldown data
61
+ * @param options Get cooldown data options
62
+ */
63
+ get(options: Partial<Omit<CooledDownUser, 'expireTime'>>): CooledDownUser | undefined;
64
+ /**
65
+ * Check if the options are valid
66
+ * @param options Options to validated
67
+ * @param data Cooled-down user data
68
+ */
69
+ static checkOptions(options: Partial<Omit<CooledDownUser, 'expireTime'>>, data: CooledDownUser): boolean;
70
+ }
@@ -1,34 +1,34 @@
1
- import { AnyCommandBuilder, AnyCommandData, AnySlashCommandBuilder, CommandType, MessageCommandResolvable, SlashCommandResolvable } from '../../types/builders';
2
- import { ApplicationCommandData, Collection, GuildResolvable, RestOrArray } from 'discord.js';
3
- import { MessageCommandBuilder } from '../builders/MessageCommandBuilder';
4
- import { ApplicationCommandBuilder } from './ApplicationCommandManager';
5
- import { RecipleClient } from '../RecipleClient';
6
- export interface CommandManagerOptions {
7
- client: RecipleClient;
8
- messageCommands?: MessageCommandResolvable[];
9
- slashCommands?: SlashCommandResolvable[];
10
- }
11
- export declare class CommandManager {
12
- readonly client: RecipleClient;
13
- readonly slashCommands: Collection<string, AnySlashCommandBuilder>;
14
- readonly messageCommands: Collection<string, MessageCommandBuilder>;
15
- readonly additionalApplicationCommands: (ApplicationCommandBuilder | ApplicationCommandData)[];
16
- constructor(options: CommandManagerOptions);
17
- /**
18
- * Add command to command manager
19
- * @param commands Any command data or builder
20
- */
21
- add(...commands: RestOrArray<AnyCommandBuilder | AnyCommandData>): this;
22
- /**
23
- * Get command builder by name or alias if it's a message command
24
- * @param command Command name
25
- * @param type Command type
26
- */
27
- get<T = unknown>(command: string, type: CommandType.SlashCommand): AnySlashCommandBuilder<T> | undefined;
28
- get<T = unknown>(command: string, type: CommandType.MessageCommand): MessageCommandBuilder<T> | undefined;
29
- /**
30
- * Register application commands
31
- * @param guilds Register application commands to guilds
32
- */
33
- registerApplicationCommands(...guilds: RestOrArray<GuildResolvable>): Promise<this>;
34
- }
1
+ import { AnyCommandBuilder, AnyCommandData, AnySlashCommandBuilder, CommandType, MessageCommandResolvable, SlashCommandResolvable } from '../../types/builders';
2
+ import { ApplicationCommandData, Collection, GuildResolvable, RestOrArray } from 'discord.js';
3
+ import { MessageCommandBuilder } from '../builders/MessageCommandBuilder';
4
+ import { ApplicationCommandBuilder } from './ApplicationCommandManager';
5
+ import { RecipleClient } from '../RecipleClient';
6
+ export interface CommandManagerOptions {
7
+ client: RecipleClient;
8
+ messageCommands?: MessageCommandResolvable[];
9
+ slashCommands?: SlashCommandResolvable[];
10
+ }
11
+ export declare class CommandManager {
12
+ readonly client: RecipleClient;
13
+ readonly slashCommands: Collection<string, AnySlashCommandBuilder>;
14
+ readonly messageCommands: Collection<string, MessageCommandBuilder>;
15
+ readonly additionalApplicationCommands: (ApplicationCommandBuilder | ApplicationCommandData)[];
16
+ constructor(options: CommandManagerOptions);
17
+ /**
18
+ * Add command to command manager
19
+ * @param commands Any command data or builder
20
+ */
21
+ add(...commands: RestOrArray<AnyCommandBuilder | AnyCommandData>): this;
22
+ /**
23
+ * Get command builder by name or alias if it's a message command
24
+ * @param command Command name
25
+ * @param type Command type
26
+ */
27
+ get<T = unknown>(command: string, type: CommandType.SlashCommand): AnySlashCommandBuilder<T> | undefined;
28
+ get<T = unknown>(command: string, type: CommandType.MessageCommand): MessageCommandBuilder<T> | undefined;
29
+ /**
30
+ * Register application commands
31
+ * @param guilds Register application commands to guilds
32
+ */
33
+ registerApplicationCommands(...guilds: RestOrArray<GuildResolvable>): Promise<this>;
34
+ }
@@ -1,22 +1,22 @@
1
- import { MessageCommandValidatedOption } from '../builders/MessageCommandBuilder';
2
- import { RestOrArray } from 'discord.js';
3
- /**
4
- * Validated message options manager
5
- */
6
- export declare class MessageCommandOptionManager extends Array<MessageCommandValidatedOption> {
7
- constructor(...data: RestOrArray<MessageCommandValidatedOption>);
8
- /**
9
- * Get the option info
10
- * @param name Option name
11
- * @param requied Is the option required
12
- */
13
- get(name: string, requied?: boolean): MessageCommandValidatedOption | null;
14
- get(name: string, requied: true): MessageCommandValidatedOption;
15
- /**
16
- * Get the option value
17
- * @param name Option name
18
- * @param requied Is the option required
19
- */
20
- getValue(name: string, requied: true): string;
21
- getValue(name: string, requied?: boolean): string | null;
22
- }
1
+ import { MessageCommandValidatedOption } from '../builders/MessageCommandBuilder';
2
+ import { RestOrArray } from 'discord.js';
3
+ /**
4
+ * Validated message options manager
5
+ */
6
+ export declare class MessageCommandOptionManager extends Array<MessageCommandValidatedOption> {
7
+ constructor(...data: RestOrArray<MessageCommandValidatedOption>);
8
+ /**
9
+ * Get the option info
10
+ * @param name Option name
11
+ * @param requied Is the option required
12
+ */
13
+ get(name: string, requied?: boolean): MessageCommandValidatedOption | null;
14
+ get(name: string, requied: true): MessageCommandValidatedOption;
15
+ /**
16
+ * Get the option value
17
+ * @param name Option name
18
+ * @param requied Is the option required
19
+ */
20
+ getValue(name: string, requied: true): string;
21
+ getValue(name: string, requied?: boolean): string | null;
22
+ }