xernerx 0.1.120-beta.26 → 0.1.120-beta.28
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/README.md +0 -1
- package/dist/main.cjs +16 -22
- package/dist/main.cjs.map +1 -1
- package/dist/main.d.cts +42 -25
- package/dist/main.d.ts +42 -25
- package/dist/main.js +16 -22
- package/dist/main.js.map +1 -1
- package/package.json +13 -15
- package/src/build/XernerxMessageCommandBuilder.ts +16 -4
- package/src/build/XernerxSlashCommandBuilder.ts +3 -3
- package/src/events/clientReady.ts +1 -1
- package/src/interfaces/{XernerxSlashCommand.ts → XernerxSlashCommandOptions.ts} +1 -1
- package/src/main.ts +1 -1
- package/src/util/XernerxInteractionUtil.ts +24 -25
- package/src/validators/XernerxSlashCommandValidator.ts +2 -2
package/README.md
CHANGED
package/dist/main.cjs
CHANGED
|
@@ -625,7 +625,13 @@ var XernerxInteractionUtil = class extends XernerxBaseUtil {
|
|
|
625
625
|
* @throws {XernerxError} Throws an error if the options parameter is not provided.
|
|
626
626
|
*/
|
|
627
627
|
async send(options) {
|
|
628
|
-
|
|
628
|
+
const flags = [];
|
|
629
|
+
if (!options) throw new XernerxError(`Can't send a message without options.`);
|
|
630
|
+
if (options.display) flags.push(discord_js.MessageFlags.IsComponentsV2);
|
|
631
|
+
if (typeof options !== "string") {
|
|
632
|
+
delete options.display;
|
|
633
|
+
options.flags = flags;
|
|
634
|
+
}
|
|
629
635
|
return await this.interaction.channel.send(options);
|
|
630
636
|
}
|
|
631
637
|
/**
|
|
@@ -636,29 +642,17 @@ var XernerxInteractionUtil = class extends XernerxBaseUtil {
|
|
|
636
642
|
* @throws {XernerxError} Throws an error if the options parameter is not provided.
|
|
637
643
|
*/
|
|
638
644
|
async reply(options) {
|
|
645
|
+
const flags = [];
|
|
639
646
|
if (!options) throw new XernerxError(`Can't send a message without options.`);
|
|
647
|
+
if (options.ephemeral) flags.push(discord_js.MessageFlags.Ephemeral);
|
|
648
|
+
if (options.display) flags.push(discord_js.MessageFlags.IsComponentsV2);
|
|
649
|
+
if (typeof options !== "string") {
|
|
650
|
+
delete options.ephemeral;
|
|
651
|
+
delete options.display;
|
|
652
|
+
options.flags = flags;
|
|
653
|
+
}
|
|
640
654
|
return await (this.interaction.replied || this.interaction.deferred ? this.interaction.editReply(options) : this.interaction.reply(options));
|
|
641
655
|
}
|
|
642
|
-
/**
|
|
643
|
-
* Sends a message to the channel associated with the interaction with componentsV2 flag.
|
|
644
|
-
*
|
|
645
|
-
* @param options - The options for the message to be sent, including content and other message properties.
|
|
646
|
-
* @returns A promise that resolves to the sent message.
|
|
647
|
-
*/
|
|
648
|
-
async send2(options) {
|
|
649
|
-
options.flags = discord_js.MessageFlags.IsComponentsV2;
|
|
650
|
-
return await this.send(options);
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Replies to the interaction with the provided options, using the componentsV2 flag.
|
|
654
|
-
*
|
|
655
|
-
* @param options - The options for the reply, including content and other message properties.
|
|
656
|
-
* @returns A promise that resolves to the sent message or the edited reply.
|
|
657
|
-
*/
|
|
658
|
-
async reply2(options) {
|
|
659
|
-
options.flags = discord_js.MessageFlags.IsComponentsV2;
|
|
660
|
-
return await this.reply(options);
|
|
661
|
-
}
|
|
662
656
|
};
|
|
663
657
|
|
|
664
658
|
// src/events/interactionCreate.ts
|
|
@@ -720,7 +714,7 @@ var XernerxClientReadyEvent = class extends XernerxEventBuilder {
|
|
|
720
714
|
this.commands.local = commands.filter((command) => !command.deploy?.global);
|
|
721
715
|
}
|
|
722
716
|
this.put(client);
|
|
723
|
-
new XernerxSuccess(`Successfully deployed slash commands ${client.settings.global ? "globally" : "locally"}`);
|
|
717
|
+
commands.length && new XernerxSuccess(`Successfully deployed slash commands ${client.settings.global ? "globally" : "locally"}`);
|
|
724
718
|
} catch (error) {
|
|
725
719
|
new XernerxError(error.message);
|
|
726
720
|
}
|