reciple 6.0.4 → 7.0.0-dev.10

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 (109) hide show
  1. package/LICENSE +674 -674
  2. package/README.md +193 -182
  3. package/bin/bin.d.mts +2 -0
  4. package/bin/bin.mjs +73 -0
  5. package/bin/bin.mjs.map +1 -0
  6. package/bin/classes/Config.d.ts +32 -0
  7. package/bin/classes/Config.js +72 -0
  8. package/bin/classes/Config.js.map +1 -0
  9. package/bin/esm.d.mts +1 -0
  10. package/{dist/lib → bin}/esm.mjs +0 -0
  11. package/bin/esm.mjs.map +1 -0
  12. package/bin/index.d.ts +5 -0
  13. package/bin/index.js +22 -0
  14. package/bin/index.js.map +1 -0
  15. package/bin/utils/cli.d.ts +4 -0
  16. package/bin/utils/cli.js +20 -0
  17. package/bin/utils/cli.js.map +1 -0
  18. package/bin/utils/logger.d.ts +6 -0
  19. package/bin/utils/logger.js +61 -0
  20. package/bin/utils/logger.js.map +1 -0
  21. package/bin/utils/modules.d.ts +3 -0
  22. package/bin/utils/modules.js +35 -0
  23. package/bin/utils/modules.js.map +1 -0
  24. package/package.json +26 -66
  25. package/static/config.yml +97 -0
  26. package/dist/lib/bin.mjs +0 -77
  27. package/dist/lib/bin.mjs.map +0 -1
  28. package/dist/lib/esm.mjs.map +0 -1
  29. package/dist/lib/index.js +0 -34
  30. package/dist/lib/index.js.map +0 -1
  31. package/dist/lib/reciple/classes/RecipleClient.js +0 -293
  32. package/dist/lib/reciple/classes/RecipleClient.js.map +0 -1
  33. package/dist/lib/reciple/classes/RecipleConfig.js +0 -107
  34. package/dist/lib/reciple/classes/RecipleConfig.js.map +0 -1
  35. package/dist/lib/reciple/classes/RecipleModule.js +0 -137
  36. package/dist/lib/reciple/classes/RecipleModule.js.map +0 -1
  37. package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js +0 -316
  38. package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js.map +0 -1
  39. package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +0 -127
  40. package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js.map +0 -1
  41. package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js +0 -253
  42. package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js.map +0 -1
  43. package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js +0 -179
  44. package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js.map +0 -1
  45. package/dist/lib/reciple/classes/managers/CommandCooldownManager.js +0 -100
  46. package/dist/lib/reciple/classes/managers/CommandCooldownManager.js.map +0 -1
  47. package/dist/lib/reciple/classes/managers/CommandManager.js +0 -65
  48. package/dist/lib/reciple/classes/managers/CommandManager.js.map +0 -1
  49. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +0 -26
  50. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js.map +0 -1
  51. package/dist/lib/reciple/classes/managers/ModuleManager.js +0 -181
  52. package/dist/lib/reciple/classes/managers/ModuleManager.js.map +0 -1
  53. package/dist/lib/reciple/flags.js +0 -32
  54. package/dist/lib/reciple/flags.js.map +0 -1
  55. package/dist/lib/reciple/permissions.js +0 -31
  56. package/dist/lib/reciple/permissions.js.map +0 -1
  57. package/dist/lib/reciple/types/builders.js +0 -12
  58. package/dist/lib/reciple/types/builders.js.map +0 -1
  59. package/dist/lib/reciple/types/commands.js +0 -16
  60. package/dist/lib/reciple/types/commands.js.map +0 -1
  61. package/dist/lib/reciple/types/paramOptions.js +0 -3
  62. package/dist/lib/reciple/types/paramOptions.js.map +0 -1
  63. package/dist/lib/reciple/util.js +0 -72
  64. package/dist/lib/reciple/util.js.map +0 -1
  65. package/dist/lib/reciple/version.js +0 -48
  66. package/dist/lib/reciple/version.js.map +0 -1
  67. package/dist/types/bin.d.mts +0 -3
  68. package/dist/types/bin.d.mts.map +0 -1
  69. package/dist/types/esm.d.mts +0 -2
  70. package/dist/types/esm.d.mts.map +0 -1
  71. package/dist/types/index.d.ts +0 -18
  72. package/dist/types/index.d.ts.map +0 -1
  73. package/dist/types/reciple/classes/RecipleClient.d.ts +0 -116
  74. package/dist/types/reciple/classes/RecipleClient.d.ts.map +0 -1
  75. package/dist/types/reciple/classes/RecipleConfig.d.ts +0 -102
  76. package/dist/types/reciple/classes/RecipleConfig.d.ts.map +0 -1
  77. package/dist/types/reciple/classes/RecipleModule.d.ts +0 -88
  78. package/dist/types/reciple/classes/RecipleModule.d.ts.map +0 -1
  79. package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts +0 -198
  80. package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts.map +0 -1
  81. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +0 -54
  82. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts.map +0 -1
  83. package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +0 -107
  84. package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts.map +0 -1
  85. package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +0 -54
  86. package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts.map +0 -1
  87. package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +0 -71
  88. package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts.map +0 -1
  89. package/dist/types/reciple/classes/managers/CommandManager.d.ts +0 -35
  90. package/dist/types/reciple/classes/managers/CommandManager.d.ts.map +0 -1
  91. package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +0 -23
  92. package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts.map +0 -1
  93. package/dist/types/reciple/classes/managers/ModuleManager.d.ts +0 -50
  94. package/dist/types/reciple/classes/managers/ModuleManager.d.ts.map +0 -1
  95. package/dist/types/reciple/flags.d.ts +0 -18
  96. package/dist/types/reciple/flags.d.ts.map +0 -1
  97. package/dist/types/reciple/permissions.d.ts +0 -16
  98. package/dist/types/reciple/permissions.d.ts.map +0 -1
  99. package/dist/types/reciple/types/builders.d.ts +0 -206
  100. package/dist/types/reciple/types/builders.d.ts.map +0 -1
  101. package/dist/types/reciple/types/commands.d.ts +0 -86
  102. package/dist/types/reciple/types/commands.d.ts.map +0 -1
  103. package/dist/types/reciple/types/paramOptions.d.ts +0 -102
  104. package/dist/types/reciple/types/paramOptions.d.ts.map +0 -1
  105. package/dist/types/reciple/util.d.ts +0 -27
  106. package/dist/types/reciple/util.d.ts.map +0 -1
  107. package/dist/types/reciple/version.d.ts +0 -26
  108. package/dist/types/reciple/version.d.ts.map +0 -1
  109. package/resource/reciple.yml +0 -122
@@ -1,253 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlashCommandBuilder = void 0;
4
- const builders_1 = require("../../types/builders");
5
- const util_1 = require("../../util");
6
- const discord_js_1 = require("discord.js");
7
- /**
8
- * Reciple builder for slash command
9
- */
10
- class SlashCommandBuilder extends discord_js_1.SlashCommandBuilder {
11
- get cooldown() {
12
- return this._cooldown;
13
- }
14
- get requiredBotPermissions() {
15
- return this._requiredBotPermissions;
16
- }
17
- get requiredMemberPermissions() {
18
- return this._requiredMemberPermissions;
19
- }
20
- get halt() {
21
- return this._halt;
22
- }
23
- get execute() {
24
- return this._execute;
25
- }
26
- set cooldown(cooldown) {
27
- this.setCooldown(cooldown);
28
- }
29
- set requiredBotPermissions(permissions) {
30
- this.setRequiredBotPermissions(permissions);
31
- }
32
- set requiredMemberPermissions(permissions) {
33
- this.setRequiredMemberPermissions(permissions);
34
- }
35
- set halt(halt) {
36
- this.setHalt(halt);
37
- }
38
- set execute(execute) {
39
- this.setExecute(execute);
40
- }
41
- constructor(data) {
42
- super();
43
- this.type = builders_1.CommandType.SlashCommand;
44
- this._cooldown = 0;
45
- this._requiredBotPermissions = [];
46
- this._requiredMemberPermissions = [];
47
- this._execute = () => {
48
- /* Execute */
49
- };
50
- // TODO: WTH
51
- if (data?.name !== undefined)
52
- this.setName(data.name);
53
- if (data?.description !== undefined)
54
- this.setDescription(data.description);
55
- if (data?.cooldown !== undefined)
56
- this.setCooldown(Number(data?.cooldown));
57
- if (data?.requiredBotPermissions !== undefined)
58
- this.setRequiredBotPermissions(data.requiredBotPermissions);
59
- if (data?.requiredMemberPermissions !== undefined)
60
- this.setRequiredMemberPermissions(data.requiredMemberPermissions);
61
- if (data?.halt !== undefined)
62
- this.setHalt(data.halt);
63
- if (data?.execute !== undefined)
64
- this.setExecute(data.execute);
65
- if (data?.metadata !== undefined)
66
- this.setMetadata(data.metadata);
67
- if (data?.nameLocalizations !== undefined)
68
- this.setNameLocalizations(data.nameLocalizations);
69
- if (data?.descriptionLocalizations !== undefined)
70
- this.setDescriptionLocalizations(data.descriptionLocalizations);
71
- if (data?.defaultMemberPermissions !== undefined)
72
- this.setDefaultMemberPermissions(data.defaultMemberPermissions);
73
- if (data?.dmPermission !== undefined)
74
- this.setDMPermission(true);
75
- if (data?.defaultPermission !== undefined)
76
- this.setDefaultPermission(true);
77
- if (data?.options) {
78
- for (const option of data.options) {
79
- SlashCommandBuilder.addOption(this, (0, util_1.isClass)(option) ? option : SlashCommandBuilder.resolveOption(option));
80
- }
81
- }
82
- }
83
- setCooldown(cooldown) {
84
- this._cooldown = cooldown;
85
- return this;
86
- }
87
- setRequiredBotPermissions(...permissions) {
88
- this._requiredBotPermissions = (0, discord_js_1.normalizeArray)(permissions);
89
- return this;
90
- }
91
- setRequiredMemberPermissions(...permissions) {
92
- this._requiredMemberPermissions = (0, discord_js_1.normalizeArray)(permissions);
93
- this.setDefaultMemberPermissions(this.requiredMemberPermissions.length ? new discord_js_1.PermissionsBitField(this.requiredMemberPermissions).bitfield : undefined);
94
- return this;
95
- }
96
- setHalt(halt) {
97
- this._halt = halt || undefined;
98
- return this;
99
- }
100
- setExecute(execute) {
101
- if ((0, discord_js_1.isValidationEnabled)() && (!execute || typeof execute !== 'function'))
102
- throw new Error('execute must be a function.');
103
- this._execute = execute;
104
- return this;
105
- }
106
- setMetadata(metadata) {
107
- this.metadata = metadata;
108
- return this;
109
- }
110
- /**
111
- * Add option builder to command builder
112
- * @param builder Command/Subcommand builder
113
- * @param option Option builder
114
- */
115
- static addOption(builder, option) {
116
- if (option instanceof discord_js_1.SlashCommandAttachmentOption) {
117
- builder.addAttachmentOption(option);
118
- }
119
- else if (option instanceof discord_js_1.SlashCommandBooleanOption) {
120
- builder.addBooleanOption(option);
121
- }
122
- else if (option instanceof discord_js_1.SlashCommandChannelOption) {
123
- builder.addChannelOption(option);
124
- }
125
- else if (option instanceof discord_js_1.SlashCommandIntegerOption) {
126
- builder.addIntegerOption(option);
127
- }
128
- else if (option instanceof discord_js_1.SlashCommandMentionableOption) {
129
- builder.addMentionableOption(option);
130
- }
131
- else if (option instanceof discord_js_1.SlashCommandNumberOption) {
132
- builder.addNumberOption(option);
133
- }
134
- else if (option instanceof discord_js_1.SlashCommandRoleOption) {
135
- builder.addRoleOption(option);
136
- }
137
- else if (option instanceof discord_js_1.SlashCommandStringOption) {
138
- builder.addStringOption(option);
139
- }
140
- else if (option instanceof discord_js_1.SlashCommandUserOption) {
141
- builder.addUserOption(option);
142
- }
143
- else if (builder instanceof SlashCommandBuilder) {
144
- if (option instanceof discord_js_1.SlashCommandSubcommandBuilder) {
145
- builder.addSubcommand(option);
146
- }
147
- else if (option instanceof discord_js_1.SlashCommandSubcommandGroupBuilder) {
148
- builder.addSubcommandGroup(option);
149
- }
150
- }
151
- return builder;
152
- }
153
- /**
154
- * Resolve option data
155
- * @param option Option dara to resolve
156
- */
157
- static resolveOption(option) {
158
- let builder;
159
- // TODO: I can do better than this
160
- switch (option.type) {
161
- case discord_js_1.ApplicationCommandOptionType.Attachment:
162
- builder = new discord_js_1.SlashCommandAttachmentOption();
163
- break;
164
- case discord_js_1.ApplicationCommandOptionType.Boolean:
165
- builder = new discord_js_1.SlashCommandBooleanOption();
166
- break;
167
- case discord_js_1.ApplicationCommandOptionType.Channel:
168
- builder = new discord_js_1.SlashCommandChannelOption().addChannelTypes(...(option.channelTypes ?? []));
169
- break;
170
- case discord_js_1.ApplicationCommandOptionType.Integer:
171
- builder = new discord_js_1.SlashCommandIntegerOption().addChoices(...(option.choices ?? [])).setAutocomplete(!!option.autocomplete);
172
- if (option.maxValue)
173
- builder.setMaxValue(option.maxValue);
174
- if (option.minValue)
175
- builder.setMinValue(option.minValue);
176
- break;
177
- case discord_js_1.ApplicationCommandOptionType.Mentionable:
178
- builder = new discord_js_1.SlashCommandMentionableOption();
179
- break;
180
- case discord_js_1.ApplicationCommandOptionType.Number:
181
- builder = new discord_js_1.SlashCommandNumberOption().addChoices(...(option.choices ?? [])).setAutocomplete(!!option.autocomplete);
182
- if (option.maxValue)
183
- builder.setMaxValue(option.maxValue);
184
- if (option.minValue)
185
- builder.setMinValue(option.minValue);
186
- break;
187
- case discord_js_1.ApplicationCommandOptionType.Role:
188
- builder = new discord_js_1.SlashCommandRoleOption();
189
- break;
190
- case discord_js_1.ApplicationCommandOptionType.String:
191
- builder = new discord_js_1.SlashCommandStringOption().addChoices(...(option.choices ?? [])).setAutocomplete(!!option.autocomplete);
192
- if (option.maxLength)
193
- builder.setMaxLength(option.maxLength);
194
- if (option.minLength)
195
- builder.setMinLength(option.minLength);
196
- break;
197
- case discord_js_1.ApplicationCommandOptionType.User:
198
- builder = new discord_js_1.SlashCommandUserOption();
199
- break;
200
- case discord_js_1.ApplicationCommandOptionType.Subcommand:
201
- builder = new discord_js_1.SlashCommandSubcommandBuilder();
202
- for (const optionData of option.options) {
203
- this.addOption(builder, this.resolveOption(optionData));
204
- }
205
- break;
206
- case discord_js_1.ApplicationCommandOptionType.SubcommandGroup:
207
- builder = new discord_js_1.SlashCommandSubcommandGroupBuilder();
208
- for (const subCommandData of option.options) {
209
- builder.addSubcommand(subCommandData instanceof discord_js_1.SlashCommandSubcommandBuilder ? subCommandData : this.resolveOption(subCommandData));
210
- }
211
- break;
212
- default:
213
- throw new TypeError('Unknown option data');
214
- }
215
- if (!(builder instanceof discord_js_1.SlashCommandSubcommandBuilder) && !(builder instanceof discord_js_1.SlashCommandSubcommandGroupBuilder) && option.type !== discord_js_1.ApplicationCommandOptionType.Subcommand && option.type !== discord_js_1.ApplicationCommandOptionType.SubcommandGroup) {
216
- builder.setRequired(option.required ?? false);
217
- }
218
- return builder
219
- .setName(option.name)
220
- .setDescription(option.description)
221
- .setNameLocalizations(option.nameLocalizations ?? null)
222
- .setDescriptionLocalizations(option.descriptionLocalizations ?? null);
223
- }
224
- /**
225
- * Resolve slash command data/builder
226
- * @param commandData Command data to resolve
227
- */
228
- static resolveSlashCommand(commandData) {
229
- return this.isSlashCommandBuilder(commandData) ? commandData : new SlashCommandBuilder(commandData);
230
- }
231
- /**
232
- * Is a slash command builder
233
- * @param builder data to check
234
- */
235
- static isSlashCommandBuilder(builder) {
236
- return builder instanceof SlashCommandBuilder;
237
- }
238
- /**
239
- * Is a slash command execute data
240
- * @param executeData data to check
241
- */
242
- static isSlashCommandExecuteData(executeData) {
243
- return executeData.type == builders_1.CommandType.SlashCommand && this.isSlashCommandBuilder(executeData.builder);
244
- }
245
- /**
246
- * Is a message command halt data
247
- */
248
- static isSlashCommandHaltData(haltData) {
249
- return this.isSlashCommandExecuteData(haltData.executeData);
250
- }
251
- }
252
- exports.SlashCommandBuilder = SlashCommandBuilder;
253
- //# sourceMappingURL=SlashCommandBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SlashCommandBuilder.js","sourceRoot":"","sources":["../../../../../src/reciple/classes/builders/SlashCommandBuilder.ts"],"names":[],"mappings":";;;AAAA,mDAA4Q;AAE5Q,qCAAqC;AAErC,2CAqBoB;AAuEpB;;GAEG;AACH,MAAa,mBAAiC,SAAQ,gCAA4B;IAW9E,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IACD,IAAI,sBAAsB;QACtB,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACxC,CAAC;IACD,IAAI,yBAAyB;QACzB,OAAO,IAAI,CAA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B,CAAC,IAAI,CAAC,CAAC,OAAO,YAAY,+CAAkC,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,yCAA4B,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,KAAK,yCAA4B,CAAC,eAAe,EAAE;YAC5O,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC;SACjD;QAED,OAAO,OAAO;aACT,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;aACpB,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC;aAClC,oBAAoB,CAAC,MAAM,CAAC,iBAAiB,IAAI,IAAI,CAAC;aACtD,2BAA2B,CAAC,MAAM,CAAC,wBAAwB,IAAI,IAAI,CAAM,CAAC;IACnF,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,mBAAmB,CAAc,WAA4D;QACvG,OAAO,IAAI,CAAC,qBAAqB,CAAI,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,mBAAmB,CAAI,WAAW,CAAC,CAAC;IAC9G,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,qBAAqB,CAAc,OAAgB;QAC7D,OAAO,OAAO,YAAY,mBAAmB,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,yBAAyB,CAAC,WAAoB;QACxD,OAAQ,WAAuC,CAAC,IAAI,IAAI,sBAAW,CAAC,YAAY,IAAI,IAAI,CAAC,qBAAqB,CAAE,WAAuC,CAAC,OAAO,CAAC,CAAC;IACrK,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,sBAAsB,CAAC,QAAiB;QAClD,OAAO,IAAI,CAAC,yBAAyB,CAAE,QAAiC,CAAC,WAAW,CAAC,CAAC;IAC1F,CAAC;CACJ;AArPD,kDAqPC"}
@@ -1,179 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApplicationCommandManager = void 0;
4
- const discord_js_1 = require("discord.js");
5
- const SlashCommandBuilder_1 = require("../builders/SlashCommandBuilder");
6
- class ApplicationCommandManager {
7
- get commands() {
8
- return [...this.client.commands.additionalApplicationCommands, ...this.client.commands.slashCommands.toJSON()];
9
- }
10
- get size() {
11
- return this.commands.length;
12
- }
13
- constructor(client) {
14
- this.client = client;
15
- }
16
- /**
17
- * Sets application commands globally or in guilds
18
- * @param commands Application commands
19
- * @param guilds set only to guilds
20
- */
21
- async set(commands, ...guilds) {
22
- guilds = (0, discord_js_1.normalizeArray)(guilds);
23
- if (!this.client.isReady())
24
- throw new Error('Client is not ready');
25
- if (guilds && guilds.length > 1) {
26
- for (const guild of guilds) {
27
- await this.set(commands, guild);
28
- }
29
- return;
30
- }
31
- let guild = guilds?.shift();
32
- guild = guild ? this.client.guilds.resolveId(guild) || undefined : undefined;
33
- if (!guild) {
34
- await this.client.application.commands.set(commands);
35
- if (!this.client.isClientLogsSilent)
36
- this.client.logger.log(`Registered ${this.client.applicationCommands.size} application command(s) globally...`);
37
- }
38
- else {
39
- await this.client.application.commands.set(commands, guild);
40
- if (!this.client.isClientLogsSilent)
41
- this.client.logger.log(`Registered ${this.client.applicationCommands.size} application command(s) to guild ${guild}`);
42
- }
43
- }
44
- /**
45
- * Add command globally or in guilds
46
- * @param command Application command
47
- * @param guilds add only in guilds
48
- */
49
- async add(command, ...guilds) {
50
- guilds = (0, discord_js_1.normalizeArray)(guilds);
51
- if (!this.client.isReady())
52
- throw new Error('Client is not ready');
53
- if (!command)
54
- throw new Error('Command is undefined');
55
- if (guilds && guilds.length > 1) {
56
- for (const guild of guilds) {
57
- await this.add(command, guild);
58
- }
59
- return;
60
- }
61
- let guild = guilds?.shift();
62
- guild = guild ? this.client.guilds.resolveId(guild) || undefined : undefined;
63
- if (!guild) {
64
- const newCommand = await this.client.application.commands.create(command);
65
- if (!this.client.isClientLogsSilent)
66
- this.client.logger.log(`Created application command '${newCommand.name}' globally`);
67
- }
68
- else {
69
- const newCommand = await this.client.application.commands.create(command, guild);
70
- if (!this.client.isClientLogsSilent)
71
- this.client.logger.log(`Created application command '${newCommand.name}' to guild ${guild}`);
72
- }
73
- }
74
- /**
75
- * Remove application command globally or in guilds
76
- * @param command id of application commmand or ApplicationCommand class
77
- * @param guilds Remove from guilds
78
- */
79
- async remove(command, ...guilds) {
80
- guilds = (0, discord_js_1.normalizeArray)(guilds);
81
- if (!this.client.isReady())
82
- throw new Error('Client is not ready');
83
- if (!command)
84
- throw new Error('Command is undefined');
85
- if (guilds && guilds.length > 1) {
86
- for (const guild of guilds) {
87
- await this.remove(command, guild);
88
- }
89
- return;
90
- }
91
- let guild = guilds?.shift();
92
- guild = guild ? this.client.guilds.resolveId(guild) || undefined : undefined;
93
- if (!guild) {
94
- await this.client.application.commands.delete(command);
95
- if (!this.client.isClientLogsSilent)
96
- this.client.logger.log(`Removed application command '${typeof command === 'string' ? command : command.name}' globally`);
97
- }
98
- else {
99
- await this.client.application.commands.delete(command, guild);
100
- if (!this.client.isClientLogsSilent)
101
- this.client.logger.log(`Removed application command '${typeof command === 'string' ? command : command.name}' from guild ${guild}`);
102
- }
103
- }
104
- /**
105
- * Edit application command globally or in guilds
106
- * @param command id of application command or ApplicationCommand class
107
- * @param newCommand new application command data
108
- * @param guilds Edit only from guilds
109
- */
110
- async edit(command, newCommand, ...guilds) {
111
- guilds = (0, discord_js_1.normalizeArray)(guilds);
112
- if (!this.client.isReady())
113
- throw new Error('Client is not ready');
114
- if (!command)
115
- throw new Error('Command is undefined');
116
- if (guilds && guilds.length > 1) {
117
- for (const guild of guilds) {
118
- await this.edit(command, newCommand, guild);
119
- }
120
- return;
121
- }
122
- let guild = guilds?.shift();
123
- guild = guild ? this.client.guilds.resolveId(guild) || undefined : undefined;
124
- if (!guild) {
125
- await this.client.application.commands.edit(command, newCommand);
126
- if (!this.client.isClientLogsSilent)
127
- this.client.logger.log(`Removed application command '${typeof command === 'string' ? command : command.name}' globally`);
128
- }
129
- else {
130
- await this.client.application.commands.edit(command, newCommand, guild);
131
- if (!this.client.isClientLogsSilent)
132
- this.client.logger.log(`Removed application command '${typeof command === 'string' ? command : command.name}' from guild ${guild}`);
133
- }
134
- }
135
- /**
136
- * Get application command from cache by application command data, builder, id, or name globally or from guid
137
- * @param command application command data, builder, id, or name
138
- * @param guild get command from guild
139
- */
140
- get(command, guild) {
141
- const commands = guild ? this.client.guilds.resolve(guild)?.commands.cache : this.client.application?.commands.cache;
142
- if (!commands)
143
- throw new Error('Guild not found in cache');
144
- return commands.find(cmd => (typeof command === 'string' ? cmd.id === command || cmd.name === command : cmd.name === command.name || (command instanceof discord_js_1.ApplicationCommand && cmd.id === command.id)));
145
- }
146
- /**
147
- * Fetch application command by id globally or from guild
148
- * @param commandId command id
149
- * @param guild fetch from guild
150
- */
151
- async fetch(commandId, guild) {
152
- const manager = guild ? this.client.guilds.resolve(guild)?.commands : this.client.application?.commands;
153
- if (!manager)
154
- throw new Error('Guild not found in cache');
155
- return manager.fetch(commandId);
156
- }
157
- /**
158
- * Parse application command builders to command data
159
- * @param commands Application command builders
160
- * @param setPermissions set slash commands permissions
161
- */
162
- parseCommands(commands, setPermissions = true) {
163
- return commands.map(cmd => {
164
- if (cmd?.toJSON === undefined)
165
- return cmd;
166
- if (SlashCommandBuilder_1.SlashCommandBuilder.isSlashCommandBuilder(cmd) && this.client.config.commands.slashCommand.setRequiredPermissions) {
167
- const permissions = setPermissions || this.client.config.commands.slashCommand.permissions.enabled ? this.client.config.commands.slashCommand.permissions.commands.find(cmd_ => cmd_.command.toLowerCase() === cmd.name.toLowerCase())?.permissions : undefined;
168
- if (permissions) {
169
- cmd.setRequiredMemberPermissions(...permissions);
170
- if (!this.client.isClientLogsSilent)
171
- this.client.logger.debug(`Set required permissions for ${cmd.name}`);
172
- }
173
- }
174
- return cmd.toJSON();
175
- });
176
- }
177
- }
178
- exports.ApplicationCommandManager = ApplicationCommandManager;
179
- //# sourceMappingURL=ApplicationCommandManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ApplicationCommandManager.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O,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;gBAEhQ,IAAI,WAAW,EAAE;oBACb,GAAG,CAAC,4BAA4B,CAAC,GAAG,WAAW,CAAC,CAAC;oBACjD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB;wBAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;iBAC7G;aACJ;YAED,OAAQ,GAAiC,CAAC,MAAM,EAAE,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AApLD,8DAoLC"}
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandCooldownManager = void 0;
4
- const discord_js_1 = require("discord.js");
5
- /**
6
- * cooled-down users manager
7
- */
8
- class CommandCooldownManager extends Array {
9
- constructor(...data) {
10
- super(...(0, discord_js_1.normalizeArray)(data));
11
- }
12
- /**
13
- * Alias for `CommandCooldownManager#push()`
14
- * @param options Cooled-down user data
15
- */
16
- add(...options) {
17
- return this.push(...options);
18
- }
19
- /**
20
- * Remove cooldown from specific user, channel or guild
21
- * @param options Remove cooldown data options
22
- * @param limit Remove cooldown data limit
23
- * @returns Returns the removed values
24
- */
25
- remove(options, limit = 0) {
26
- if (!Object.keys(options).length)
27
- throw new TypeError('Provide atleast one option to remove cooldown data.');
28
- const removed = [];
29
- for (let i = 0; i < this.length; i++) {
30
- if (!CommandCooldownManager.checkOptions(options, this[i]))
31
- continue;
32
- if (options.expireTime && this[i].expireTime > Date.now())
33
- continue;
34
- if (limit && i >= limit)
35
- continue;
36
- removed.push(this[i]);
37
- this.splice(Number(i));
38
- }
39
- return removed;
40
- }
41
- /**
42
- * Check if the given user is cooled-down
43
- * @param options Options to identify if user is on cooldown
44
- */
45
- isCooledDown(options) {
46
- const data = this.get(options);
47
- if (!data)
48
- return false;
49
- this.remove({
50
- ...data,
51
- channel: undefined,
52
- guild: undefined,
53
- type: undefined,
54
- command: undefined,
55
- });
56
- if (data.expireTime < Date.now())
57
- return false;
58
- return true;
59
- }
60
- /**
61
- * Purge non cooled-down users from this array
62
- * @param options Clean cooldown options
63
- */
64
- clean(options) {
65
- for (const index in this) {
66
- if (options && !CommandCooldownManager.checkOptions(options, this[index]))
67
- return;
68
- if (this[index].expireTime > Date.now())
69
- return;
70
- this.slice(Number(index));
71
- }
72
- }
73
- /**
74
- * Get someone's cooldown data
75
- * @param options Get cooldown data options
76
- */
77
- get(options) {
78
- return this.find(data => CommandCooldownManager.checkOptions(options, data));
79
- }
80
- /**
81
- * Check if the options are valid
82
- * @param options Options to validated
83
- * @param data Cooled-down user data
84
- */
85
- static checkOptions(options, data) {
86
- if (options?.user !== undefined && options.user.id !== data.user.id)
87
- return false;
88
- if (options?.guild !== undefined && options.guild?.id !== data.guild?.id)
89
- return false;
90
- if (options?.channel !== undefined && options.channel.id !== data.channel?.id)
91
- return false;
92
- if (options?.command !== undefined && options.command !== data.command)
93
- return false;
94
- if (options?.type !== undefined && options.type !== data.type)
95
- return false;
96
- return true;
97
- }
98
- }
99
- exports.CommandCooldownManager = CommandCooldownManager;
100
- //# sourceMappingURL=CommandCooldownManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandCooldownManager.js","sourceRoot":"","sources":["../../../../../src/reciple/classes/managers/CommandCooldownManager.ts"],"names":[],"mappings":";;;AAAA,2CAAwF;AAiCxF;;GAEG;AACH,MAAa,sBAAuB,SAAQ,KAAqB;IAC7D,YAAY,GAAG,IAAiC;QAC5C,KAAK,CAAC,GAAG,IAAA,2BA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AE,OAAO,KAAK,CAAC;QACrF,IAAI,OAAO,EAAE,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAC;QAE5E,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAzFD,wDAyFC"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandManager = void 0;
4
- const builders_1 = require("../../types/builders");
5
- const discord_js_1 = require("discord.js");
6
- const MessageCommandBuilder_1 = require("../builders/MessageCommandBuilder");
7
- const SlashCommandBuilder_1 = require("../builders/SlashCommandBuilder");
8
- const RecipleClient_1 = require("../RecipleClient");
9
- class CommandManager {
10
- constructor(options) {
11
- this.slashCommands = new discord_js_1.Collection();
12
- this.messageCommands = new discord_js_1.Collection();
13
- this.additionalApplicationCommands = [];
14
- this.client = options.client;
15
- options.slashCommands?.forEach(e => this.slashCommands.set(e.name, SlashCommandBuilder_1.SlashCommandBuilder.resolveSlashCommand(e)));
16
- options.messageCommands?.forEach(e => this.messageCommands.set(e.name, MessageCommandBuilder_1.MessageCommandBuilder.resolveMessageCommand(e)));
17
- }
18
- /**
19
- * Add command to command manager
20
- * @param commands Any command data or builder
21
- */
22
- add(...commands) {
23
- for (const command of (0, discord_js_1.normalizeArray)(commands)) {
24
- if (command instanceof SlashCommandBuilder_1.SlashCommandBuilder || command.type === builders_1.CommandType.SlashCommand) {
25
- this.slashCommands.set(command.name, SlashCommandBuilder_1.SlashCommandBuilder.resolveSlashCommand(command));
26
- }
27
- else if (command instanceof MessageCommandBuilder_1.MessageCommandBuilder || command.type === builders_1.CommandType.MessageCommand) {
28
- this.messageCommands.set(command.name, MessageCommandBuilder_1.MessageCommandBuilder.resolveMessageCommand(command));
29
- }
30
- else {
31
- throw new Error(`Unknown reciple command type`);
32
- }
33
- }
34
- return this;
35
- }
36
- addAddtionalApplicationCommand(...commands) {
37
- this.additionalApplicationCommands.push(...(0, discord_js_1.normalizeArray)(commands));
38
- return this;
39
- }
40
- get(command, type) {
41
- switch (type) {
42
- case builders_1.CommandType.SlashCommand:
43
- return this.slashCommands.get(command);
44
- case builders_1.CommandType.MessageCommand:
45
- return (this.messageCommands.get(command.toLowerCase()) ?? (this.client.config.commands.messageCommand.allowCommandAlias ? this.messageCommands.find(c => c.aliases.some(a => a == command?.toLowerCase())) : undefined));
46
- default:
47
- throw new TypeError('Unknown command type');
48
- }
49
- }
50
- /**
51
- * Register application commands
52
- * @param guilds Register application commands to guilds
53
- */
54
- async registerApplicationCommands(...guilds) {
55
- guilds = (0, discord_js_1.normalizeArray)(guilds);
56
- guilds = guilds.length ? guilds : (0, discord_js_1.normalizeArray)([this.client.config.commands.slashCommand.guilds]);
57
- if (!this.client.isClientLogsSilent)
58
- this.client.logger.log(`Regestering ${this.client.applicationCommands.size} application command(s) ${!guilds.length ? 'globaly' : 'to ' + guilds.length + ' guilds'}...`);
59
- await this.client.applicationCommands.set([...this.client.applicationCommands.commands], guilds);
60
- this.client.emit(RecipleClient_1.RecipleEvents.RegisterApplicationCommands);
61
- return this;
62
- }
63
- }
64
- exports.CommandManager = CommandManager;
65
- //# sourceMappingURL=CommandManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandManager.js","sourceRoot":"","sources":["../../../../../src/reciple/classes/managers/CommandManager.ts"],"names":[],"mappings":";;;AAAA,mDAAgK;AAChK,2CAAwH;AACxH,6EAA0E;AAC1E,yEAAsE;AACtE,oDAAgE;AAQhE,MAAa,cAAc;IAMvB,YAAY,OAA8B;QAJjC,kBAAa,GAA+C,IAAI,uBAAU,EAAE,CAAC;QAC7E,oBAAe,GAA8C,IAAI,uBAAU,EAAE,CAAC;QAC9E,kCAA6B,GAAuC,EAAE,CAAC;QAG5E,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,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