commandkit 0.1.3-dev.20231002185336 → 0.1.3-dev.20231002193305
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +29 -27
- package/dist/index.mjs +29 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -239,22 +239,20 @@ async function registerGlobalCommands(client, commands) {
|
|
|
239
239
|
)
|
|
240
240
|
);
|
|
241
241
|
} else {
|
|
242
|
-
targetCommand.delete().
|
|
242
|
+
await targetCommand.delete().catch((error) => {
|
|
243
243
|
console.log(
|
|
244
|
-
colors_default.
|
|
244
|
+
colors_default.red(`\u274C Failed to delete command "${command.data.name}" globally.`)
|
|
245
245
|
);
|
|
246
|
+
console.error(error);
|
|
246
247
|
});
|
|
248
|
+
console.log(colors_default.green(`\u{1F6AE} Deleted command "${command.data.name}" globally.`));
|
|
247
249
|
}
|
|
248
250
|
continue;
|
|
249
251
|
}
|
|
250
252
|
if (targetCommand) {
|
|
251
253
|
const commandsAreDifferent = areSlashCommandsDifferent(targetCommand, command.data);
|
|
252
254
|
if (commandsAreDifferent) {
|
|
253
|
-
targetCommand.edit(command.data).
|
|
254
|
-
console.log(
|
|
255
|
-
colors_default.green(`\u2705 Edited command "${command.data.name}" globally.`)
|
|
256
|
-
);
|
|
257
|
-
}).catch((error) => {
|
|
255
|
+
await targetCommand.edit(command.data).catch((error) => {
|
|
258
256
|
console.log(
|
|
259
257
|
colors_default.red(
|
|
260
258
|
`\u274C Failed to edit command "${command.data.name}" globally.`
|
|
@@ -262,19 +260,19 @@ async function registerGlobalCommands(client, commands) {
|
|
|
262
260
|
);
|
|
263
261
|
console.error(error);
|
|
264
262
|
});
|
|
263
|
+
console.log(colors_default.green(`\u2705 Edited command "${command.data.name}" globally.`));
|
|
265
264
|
continue;
|
|
266
265
|
}
|
|
267
266
|
}
|
|
268
267
|
if (targetCommand)
|
|
269
268
|
continue;
|
|
270
|
-
appCommandsManager.create(command.data).
|
|
271
|
-
console.log(colors_default.green(`\u2705 Registered command "${command.data.name}" globally.`));
|
|
272
|
-
}).catch((error) => {
|
|
269
|
+
await appCommandsManager.create(command.data).catch((error) => {
|
|
273
270
|
console.log(
|
|
274
271
|
colors_default.red(`\u274C Failed to register command "${command.data.name}" globally.`)
|
|
275
272
|
);
|
|
276
273
|
console.error(error);
|
|
277
274
|
});
|
|
275
|
+
console.log(colors_default.green(`\u2705 Registered command "${command.data.name}" globally.`));
|
|
278
276
|
}
|
|
279
277
|
}
|
|
280
278
|
async function registerDevCommands(client, commands, guildIds) {
|
|
@@ -308,26 +306,26 @@ async function registerDevCommands(client, commands, guildIds) {
|
|
|
308
306
|
)
|
|
309
307
|
);
|
|
310
308
|
} else {
|
|
311
|
-
targetCommand.delete().
|
|
309
|
+
await targetCommand.delete().catch((error) => {
|
|
312
310
|
console.log(
|
|
313
|
-
colors_default.
|
|
314
|
-
`\
|
|
311
|
+
colors_default.red(
|
|
312
|
+
`\u274C Failed to delete command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
315
313
|
)
|
|
316
314
|
);
|
|
315
|
+
console.error(error);
|
|
317
316
|
});
|
|
317
|
+
console.log(
|
|
318
|
+
colors_default.green(
|
|
319
|
+
`\u{1F6AE} Deleted command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
320
|
+
)
|
|
321
|
+
);
|
|
318
322
|
}
|
|
319
323
|
continue;
|
|
320
324
|
}
|
|
321
325
|
if (targetCommand) {
|
|
322
326
|
const commandsAreDifferent = areSlashCommandsDifferent(targetCommand, command.data);
|
|
323
327
|
if (commandsAreDifferent) {
|
|
324
|
-
targetCommand.edit(command.data).
|
|
325
|
-
console.log(
|
|
326
|
-
colors_default.green(
|
|
327
|
-
`\u2705 Edited command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
328
|
-
)
|
|
329
|
-
);
|
|
330
|
-
}).catch((error) => {
|
|
328
|
+
await targetCommand.edit(command.data).catch((error) => {
|
|
331
329
|
console.log(
|
|
332
330
|
colors_default.red(
|
|
333
331
|
`\u274C Failed to edit command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
@@ -335,18 +333,17 @@ async function registerDevCommands(client, commands, guildIds) {
|
|
|
335
333
|
);
|
|
336
334
|
console.error(error);
|
|
337
335
|
});
|
|
336
|
+
console.log(
|
|
337
|
+
colors_default.green(
|
|
338
|
+
`\u2705 Edited command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
339
|
+
)
|
|
340
|
+
);
|
|
338
341
|
continue;
|
|
339
342
|
}
|
|
340
343
|
}
|
|
341
344
|
if (targetCommand)
|
|
342
345
|
continue;
|
|
343
|
-
guildCommands.create(command.data).
|
|
344
|
-
console.log(
|
|
345
|
-
colors_default.green(
|
|
346
|
-
`\u2705 Registered command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
347
|
-
)
|
|
348
|
-
);
|
|
349
|
-
}).catch((error) => {
|
|
346
|
+
await guildCommands.create(command.data).catch((error) => {
|
|
350
347
|
console.log(
|
|
351
348
|
colors_default.red(
|
|
352
349
|
`\u274C Failed to register command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
@@ -354,6 +351,11 @@ async function registerDevCommands(client, commands, guildIds) {
|
|
|
354
351
|
);
|
|
355
352
|
console.error(error);
|
|
356
353
|
});
|
|
354
|
+
console.log(
|
|
355
|
+
colors_default.green(
|
|
356
|
+
`\u2705 Registered command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
357
|
+
)
|
|
358
|
+
);
|
|
357
359
|
}
|
|
358
360
|
}
|
|
359
361
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -209,22 +209,20 @@ async function registerGlobalCommands(client, commands) {
|
|
|
209
209
|
)
|
|
210
210
|
);
|
|
211
211
|
} else {
|
|
212
|
-
targetCommand.delete().
|
|
212
|
+
await targetCommand.delete().catch((error) => {
|
|
213
213
|
console.log(
|
|
214
|
-
colors_default.
|
|
214
|
+
colors_default.red(`\u274C Failed to delete command "${command.data.name}" globally.`)
|
|
215
215
|
);
|
|
216
|
+
console.error(error);
|
|
216
217
|
});
|
|
218
|
+
console.log(colors_default.green(`\u{1F6AE} Deleted command "${command.data.name}" globally.`));
|
|
217
219
|
}
|
|
218
220
|
continue;
|
|
219
221
|
}
|
|
220
222
|
if (targetCommand) {
|
|
221
223
|
const commandsAreDifferent = areSlashCommandsDifferent(targetCommand, command.data);
|
|
222
224
|
if (commandsAreDifferent) {
|
|
223
|
-
targetCommand.edit(command.data).
|
|
224
|
-
console.log(
|
|
225
|
-
colors_default.green(`\u2705 Edited command "${command.data.name}" globally.`)
|
|
226
|
-
);
|
|
227
|
-
}).catch((error) => {
|
|
225
|
+
await targetCommand.edit(command.data).catch((error) => {
|
|
228
226
|
console.log(
|
|
229
227
|
colors_default.red(
|
|
230
228
|
`\u274C Failed to edit command "${command.data.name}" globally.`
|
|
@@ -232,19 +230,19 @@ async function registerGlobalCommands(client, commands) {
|
|
|
232
230
|
);
|
|
233
231
|
console.error(error);
|
|
234
232
|
});
|
|
233
|
+
console.log(colors_default.green(`\u2705 Edited command "${command.data.name}" globally.`));
|
|
235
234
|
continue;
|
|
236
235
|
}
|
|
237
236
|
}
|
|
238
237
|
if (targetCommand)
|
|
239
238
|
continue;
|
|
240
|
-
appCommandsManager.create(command.data).
|
|
241
|
-
console.log(colors_default.green(`\u2705 Registered command "${command.data.name}" globally.`));
|
|
242
|
-
}).catch((error) => {
|
|
239
|
+
await appCommandsManager.create(command.data).catch((error) => {
|
|
243
240
|
console.log(
|
|
244
241
|
colors_default.red(`\u274C Failed to register command "${command.data.name}" globally.`)
|
|
245
242
|
);
|
|
246
243
|
console.error(error);
|
|
247
244
|
});
|
|
245
|
+
console.log(colors_default.green(`\u2705 Registered command "${command.data.name}" globally.`));
|
|
248
246
|
}
|
|
249
247
|
}
|
|
250
248
|
async function registerDevCommands(client, commands, guildIds) {
|
|
@@ -278,26 +276,26 @@ async function registerDevCommands(client, commands, guildIds) {
|
|
|
278
276
|
)
|
|
279
277
|
);
|
|
280
278
|
} else {
|
|
281
|
-
targetCommand.delete().
|
|
279
|
+
await targetCommand.delete().catch((error) => {
|
|
282
280
|
console.log(
|
|
283
|
-
colors_default.
|
|
284
|
-
`\
|
|
281
|
+
colors_default.red(
|
|
282
|
+
`\u274C Failed to delete command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
285
283
|
)
|
|
286
284
|
);
|
|
285
|
+
console.error(error);
|
|
287
286
|
});
|
|
287
|
+
console.log(
|
|
288
|
+
colors_default.green(
|
|
289
|
+
`\u{1F6AE} Deleted command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
290
|
+
)
|
|
291
|
+
);
|
|
288
292
|
}
|
|
289
293
|
continue;
|
|
290
294
|
}
|
|
291
295
|
if (targetCommand) {
|
|
292
296
|
const commandsAreDifferent = areSlashCommandsDifferent(targetCommand, command.data);
|
|
293
297
|
if (commandsAreDifferent) {
|
|
294
|
-
targetCommand.edit(command.data).
|
|
295
|
-
console.log(
|
|
296
|
-
colors_default.green(
|
|
297
|
-
`\u2705 Edited command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
298
|
-
)
|
|
299
|
-
);
|
|
300
|
-
}).catch((error) => {
|
|
298
|
+
await targetCommand.edit(command.data).catch((error) => {
|
|
301
299
|
console.log(
|
|
302
300
|
colors_default.red(
|
|
303
301
|
`\u274C Failed to edit command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
@@ -305,18 +303,17 @@ async function registerDevCommands(client, commands, guildIds) {
|
|
|
305
303
|
);
|
|
306
304
|
console.error(error);
|
|
307
305
|
});
|
|
306
|
+
console.log(
|
|
307
|
+
colors_default.green(
|
|
308
|
+
`\u2705 Edited command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
309
|
+
)
|
|
310
|
+
);
|
|
308
311
|
continue;
|
|
309
312
|
}
|
|
310
313
|
}
|
|
311
314
|
if (targetCommand)
|
|
312
315
|
continue;
|
|
313
|
-
guildCommands.create(command.data).
|
|
314
|
-
console.log(
|
|
315
|
-
colors_default.green(
|
|
316
|
-
`\u2705 Registered command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
317
|
-
)
|
|
318
|
-
);
|
|
319
|
-
}).catch((error) => {
|
|
316
|
+
await guildCommands.create(command.data).catch((error) => {
|
|
320
317
|
console.log(
|
|
321
318
|
colors_default.red(
|
|
322
319
|
`\u274C Failed to register command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
@@ -324,6 +321,11 @@ async function registerDevCommands(client, commands, guildIds) {
|
|
|
324
321
|
);
|
|
325
322
|
console.error(error);
|
|
326
323
|
});
|
|
324
|
+
console.log(
|
|
325
|
+
colors_default.green(
|
|
326
|
+
`\u2705 Registered command "${command.data.name}" in ${guildCommands.guild.name}.`
|
|
327
|
+
)
|
|
328
|
+
);
|
|
327
329
|
}
|
|
328
330
|
}
|
|
329
331
|
}
|
package/package.json
CHANGED