reciple 6.0.0-dev.19 → 6.0.0-dev.20

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 +65 -65
  4. package/dist/lib/esm.mjs +1 -1
  5. package/dist/lib/index.js +35 -35
  6. package/dist/lib/reciple/classes/RecipleClient.js +296 -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 +242 -242
  10. package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +85 -85
  11. package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js +216 -216
  12. package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js +178 -172
  13. package/dist/lib/reciple/classes/managers/CommandCooldownManager.js +100 -100
  14. package/dist/lib/reciple/classes/managers/{ClientCommandManager.js → CommandManager.js} +59 -62
  15. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +25 -25
  16. package/dist/lib/reciple/classes/managers/{ClientModuleManager.js → ModuleManager.js} +179 -183
  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 +68 -68
  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 +19 -19
  27. package/dist/types/reciple/classes/RecipleClient.d.ts +103 -103
  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 +150 -150
  31. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +43 -43
  32. package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +88 -88
  33. package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +53 -51
  34. package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +70 -70
  35. package/dist/types/reciple/classes/managers/{ClientCommandManager.d.ts → CommandManager.d.ts} +36 -37
  36. package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +22 -22
  37. package/dist/types/reciple/classes/managers/{ClientModuleManager.d.ts → ModuleManager.d.ts} +49 -49
  38. package/dist/types/reciple/flags.d.ts +17 -17
  39. package/dist/types/reciple/permissions.d.ts +19 -19
  40. package/dist/types/reciple/types/builders.d.ts +197 -197
  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 +23 -23
  44. package/dist/types/reciple/version.d.ts +25 -25
  45. package/package.json +1 -1
  46. package/resource/reciple.yml +120 -120
@@ -1,43 +1,43 @@
1
- import { MessageCommandOptionData } from '../../types/builders';
2
- import { Awaitable } from 'discord.js';
3
- /**
4
- * Option builder for MessageCommandBuilder
5
- */
6
- export declare class MessageCommandOptionBuilder {
7
- name: string;
8
- description: string;
9
- required: boolean;
10
- validator: (value: string) => Awaitable<boolean>;
11
- constructor(data?: Partial<MessageCommandOptionData>);
12
- /**
13
- * Set command option name
14
- * @param name Option name
15
- */
16
- setName(name: string): this;
17
- /**
18
- * Set command option description
19
- * @param description Option description
20
- */
21
- setDescription(description: string): this;
22
- /**
23
- * Set if this option is required
24
- * @param required `true` if this option is required
25
- */
26
- setRequired(required: boolean): this;
27
- /**
28
- * Set your custom function to validate given value for this option
29
- * @param validator Custom function to validate value given for this option
30
- */
31
- setValidator(validator: (value: string) => Awaitable<boolean>): this;
32
- toJSON(): MessageCommandOptionData;
33
- /**
34
- * Resolves message command option data/builder
35
- * @param option Option data to resolve
36
- */
37
- static resolveMessageCommandOption(option: MessageCommandOptionBuilder | MessageCommandOptionBuilder): MessageCommandOptionBuilder;
38
- /**
39
- * Is a Message command option builder
40
- * @param builder data to check
41
- */
42
- static isMessageCommandOption(builder: unknown): builder is MessageCommandOptionBuilder;
43
- }
1
+ import { MessageCommandOptionData } from '../../types/builders';
2
+ import { Awaitable } from 'discord.js';
3
+ /**
4
+ * Option builder for MessageCommandBuilder
5
+ */
6
+ export declare class MessageCommandOptionBuilder {
7
+ name: string;
8
+ description: string;
9
+ required: boolean;
10
+ validator: (value: string) => Awaitable<boolean>;
11
+ constructor(data?: Partial<MessageCommandOptionData>);
12
+ /**
13
+ * Set command option name
14
+ * @param name Option name
15
+ */
16
+ setName(name: string): this;
17
+ /**
18
+ * Set command option description
19
+ * @param description Option description
20
+ */
21
+ setDescription(description: string): this;
22
+ /**
23
+ * Set if this option is required
24
+ * @param required `true` if this option is required
25
+ */
26
+ setRequired(required: boolean): this;
27
+ /**
28
+ * Set your custom function to validate given value for this option
29
+ * @param validator Custom function to validate value given for this option
30
+ */
31
+ setValidator(validator: (value: string) => Awaitable<boolean>): this;
32
+ toJSON(): MessageCommandOptionData;
33
+ /**
34
+ * Resolves message command option data/builder
35
+ * @param option Option data to resolve
36
+ */
37
+ static resolveMessageCommandOption(option: MessageCommandOptionBuilder | MessageCommandOptionBuilder): MessageCommandOptionBuilder;
38
+ /**
39
+ * Is a Message command option builder
40
+ * @param builder data to check
41
+ */
42
+ static isMessageCommandOption(builder: unknown): builder is MessageCommandOptionBuilder;
43
+ }
@@ -1,88 +1,88 @@
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
- cooldown: number;
50
- requiredBotPermissions: PermissionResolvable[];
51
- requiredMemberPermissions: PermissionResolvable[];
52
- halt?: SlashCommandHaltFunction<T>;
53
- execute: SlashCommandExecuteFunction<T>;
54
- metadata?: T;
55
- constructor(data?: Partial<Omit<SlashCommandData<T>, 'type'>>);
56
- setCooldown(cooldown: number): this;
57
- setRequiredBotPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
58
- setRequiredMemberPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
59
- setHalt(halt?: SlashCommandHaltFunction<T> | null): this;
60
- setExecute(execute: SlashCommandExecuteFunction<T>): this;
61
- setMetadata(metadata?: T): this;
62
- /**
63
- * Add option builder to command builder
64
- * @param builder Command/Subcommand builder
65
- * @param option Option builder
66
- */
67
- static addOption(builder: SharedSlashCommandOptions | SlashCommandBuilder, option: AnySlashCommandOptionBuilder): SharedSlashCommandOptions;
68
- /**
69
- * Resolve option data
70
- * @param option Option dara to resolve
71
- */
72
- static resolveOption<T extends AnySlashCommandOptionBuilder>(option: AnySlashCommandOptionData): T;
73
- /**
74
- * Resolve slash command data/builder
75
- * @param commandData Command data to resolve
76
- */
77
- static resolveSlashCommand<T = unknown>(commandData: SlashCommandData<T> | AnySlashCommandBuilder<T>): AnySlashCommandBuilder<T>;
78
- /**
79
- * Is a slash command builder
80
- * @param builder data to check
81
- */
82
- static isSlashCommandBuilder<T = unknown>(builder: unknown): builder is AnySlashCommandBuilder<T>;
83
- /**
84
- * Is a slash command execute data
85
- * @param executeData data to check
86
- */
87
- static isSlashCommandExecuteData(executeData: unknown): executeData is SlashCommandExecuteData;
88
- }
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
+ cooldown: number;
50
+ requiredBotPermissions: PermissionResolvable[];
51
+ requiredMemberPermissions: PermissionResolvable[];
52
+ halt?: SlashCommandHaltFunction<T>;
53
+ execute: SlashCommandExecuteFunction<T>;
54
+ metadata?: T;
55
+ constructor(data?: Partial<Omit<SlashCommandData<T>, 'type'>>);
56
+ setCooldown(cooldown: number): this;
57
+ setRequiredBotPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
58
+ setRequiredMemberPermissions(...permissions: RestOrArray<PermissionResolvable>): this;
59
+ setHalt(halt?: SlashCommandHaltFunction<T> | null): this;
60
+ setExecute(execute: SlashCommandExecuteFunction<T>): this;
61
+ setMetadata(metadata?: T): this;
62
+ /**
63
+ * Add option builder to command builder
64
+ * @param builder Command/Subcommand builder
65
+ * @param option Option builder
66
+ */
67
+ static addOption(builder: SharedSlashCommandOptions | SlashCommandBuilder, option: AnySlashCommandOptionBuilder): SharedSlashCommandOptions;
68
+ /**
69
+ * Resolve option data
70
+ * @param option Option dara to resolve
71
+ */
72
+ static resolveOption<T extends AnySlashCommandOptionBuilder>(option: AnySlashCommandOptionData): T;
73
+ /**
74
+ * Resolve slash command data/builder
75
+ * @param commandData Command data to resolve
76
+ */
77
+ static resolveSlashCommand<T = unknown>(commandData: SlashCommandData<T> | AnySlashCommandBuilder<T>): AnySlashCommandBuilder<T>;
78
+ /**
79
+ * Is a slash command builder
80
+ * @param builder data to check
81
+ */
82
+ static isSlashCommandBuilder<T = unknown>(builder: unknown): builder is AnySlashCommandBuilder<T>;
83
+ /**
84
+ * Is a slash command execute data
85
+ * @param executeData data to check
86
+ */
87
+ static isSlashCommandExecuteData(executeData: unknown): executeData is SlashCommandExecuteData;
88
+ }
@@ -1,51 +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
- constructor(client: RecipleClient);
8
- /**
9
- * Sets application commands globally or in guilds
10
- * @param commands Application commands
11
- * @param guilds set only to guilds
12
- */
13
- set(commands: (ApplicationCommandBuilder | ApplicationCommandData)[], ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
14
- /**
15
- * Add command globally or in guilds
16
- * @param command Application command
17
- * @param guilds add only in guilds
18
- */
19
- add(command: ApplicationCommandBuilder | ApplicationCommandData, ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
20
- /**
21
- * Remove application command globally or in guilds
22
- * @param command id of application commmand or ApplicationCommand class
23
- * @param guilds Remove from guilds
24
- */
25
- remove(command: string | ApplicationCommand, ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
26
- /**
27
- * Edit application command globally or in guilds
28
- * @param command id of application command or ApplicationCommand class
29
- * @param newCommand new application command data
30
- * @param guilds Edit only from guilds
31
- */
32
- edit(command: string | ApplicationCommand, newCommand: ApplicationCommandBuilder | ApplicationCommandData, ...guilds: RestOrArray<GuildResolvable>): Promise<void>;
33
- /**
34
- * Get application command from cache by application command data, builder, id, or name globally or from guid
35
- * @param command application command data, builder, id, or name
36
- * @param guild get command from guild
37
- */
38
- get(command: ApplicationCommandData | ApplicationCommandBuilder | string, guild?: GuildResolvable): ApplicationCommand | undefined;
39
- /**
40
- * Fetch application command by id globally or from guild
41
- * @param commandId command id
42
- * @param guild fetch from guild
43
- */
44
- fetch(commandId: string, guild?: GuildResolvable): Promise<ApplicationCommand>;
45
- /**
46
- * Parse application command builders to command data
47
- * @param commands Application command builders
48
- * @param setPermissions set slash commands permissions
49
- */
50
- protected parseCommands(commands: (ApplicationCommandData | ApplicationCommandBuilder | RESTPostAPIApplicationCommandsJSONBody)[], setPermissions?: boolean): (ApplicationCommandData | RESTPostAPIApplicationCommandsJSONBody)[];
51
- }
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,37 +1,36 @@
1
- import { ApplicationCommandData, Collection, GuildResolvable, RestOrArray } from 'discord.js';
2
- import { AnyCommandBuilder, AnyCommandData, AnySlashCommandBuilder, CommandType, MessageCommandData, SlashCommandData } from '../../types/builders';
3
- import { MessageCommandBuilder } from '../builders/MessageCommandBuilder';
4
- import { SlashCommandBuilder } from '../builders/SlashCommandBuilder';
5
- import { RecipleClient } from '../RecipleClient';
6
- import { ApplicationCommandBuilder } from './ApplicationCommandManager';
7
- export interface ClientCommandManagerOptions {
8
- client: RecipleClient;
9
- messageCommands?: (MessageCommandBuilder | MessageCommandData)[];
10
- slashCommands?: (AnySlashCommandBuilder | SlashCommandData)[];
11
- }
12
- export declare class ClientCommandManager {
13
- readonly client: RecipleClient;
14
- readonly slashCommands: Collection<string, AnySlashCommandBuilder>;
15
- readonly messageCommands: Collection<string, MessageCommandBuilder>;
16
- readonly additionalApplicationCommands: (ApplicationCommandBuilder | ApplicationCommandData)[];
17
- get applicationCommandsSize(): number;
18
- constructor(options: ClientCommandManagerOptions);
19
- /**
20
- * Add command to command manager
21
- * @param commands Any command data or builder
22
- */
23
- add(...commands: RestOrArray<AnyCommandBuilder | AnyCommandData>): this;
24
- /**
25
- * Get command builder by name or alias if it's a message command
26
- * @param command Command name
27
- * @param type Command type
28
- */
29
- get(command: string, type?: undefined): AnyCommandBuilder | undefined;
30
- get(command: string, type?: CommandType.MessageCommand): MessageCommandBuilder | undefined;
31
- get(command: string, type?: CommandType.SlashCommand): SlashCommandBuilder | undefined;
32
- /**
33
- * Register application commands
34
- * @param guilds Register application commands to guilds
35
- */
36
- registerApplicationCommands(...guilds: RestOrArray<GuildResolvable>): Promise<this>;
37
- }
1
+ import { ApplicationCommandData, Collection, GuildResolvable, RestOrArray } from 'discord.js';
2
+ import { AnyCommandBuilder, AnyCommandData, AnySlashCommandBuilder, CommandType, MessageCommandData, SlashCommandData } from '../../types/builders';
3
+ import { MessageCommandBuilder } from '../builders/MessageCommandBuilder';
4
+ import { SlashCommandBuilder } from '../builders/SlashCommandBuilder';
5
+ import { RecipleClient } from '../RecipleClient';
6
+ import { ApplicationCommandBuilder } from './ApplicationCommandManager';
7
+ export interface CommandManagerOptions {
8
+ client: RecipleClient;
9
+ messageCommands?: (MessageCommandBuilder | MessageCommandData)[];
10
+ slashCommands?: (AnySlashCommandBuilder | SlashCommandData)[];
11
+ }
12
+ export declare class CommandManager {
13
+ readonly client: RecipleClient;
14
+ readonly slashCommands: Collection<string, AnySlashCommandBuilder>;
15
+ readonly messageCommands: Collection<string, MessageCommandBuilder>;
16
+ readonly additionalApplicationCommands: (ApplicationCommandBuilder | ApplicationCommandData)[];
17
+ constructor(options: CommandManagerOptions);
18
+ /**
19
+ * Add command to command manager
20
+ * @param commands Any command data or builder
21
+ */
22
+ add(...commands: RestOrArray<AnyCommandBuilder | AnyCommandData>): this;
23
+ /**
24
+ * Get command builder by name or alias if it's a message command
25
+ * @param command Command name
26
+ * @param type Command type
27
+ */
28
+ get(command: string, type?: undefined): AnyCommandBuilder | undefined;
29
+ get(command: string, type?: CommandType.MessageCommand): MessageCommandBuilder | undefined;
30
+ get(command: string, type?: CommandType.SlashCommand): SlashCommandBuilder | undefined;
31
+ /**
32
+ * Register application commands
33
+ * @param guilds Register application commands to guilds
34
+ */
35
+ registerApplicationCommands(...guilds: RestOrArray<GuildResolvable>): Promise<this>;
36
+ }