fixed format (needs json fix) & component bugs
diff --git a/src/commands/help.ts b/src/commands/help.ts
index 482bca2..96971e6 100644
--- a/src/commands/help.ts
+++ b/src/commands/help.ts
@@ -127,7 +127,7 @@
);
}
for (const option of options) {
- optionString += `> ${option.name} (${ApplicationCommandOptionType[option.type]})- ${
+ optionString += `> \`${option.name}\` (${ApplicationCommandOptionType[option.type]}) - ${
option.description
}\n`;
}
diff --git a/src/commands/nucleus/stats.ts b/src/commands/nucleus/stats.ts
index a7f9b3b..b2658bc 100644
--- a/src/commands/nucleus/stats.ts
+++ b/src/commands/nucleus/stats.ts
@@ -79,7 +79,7 @@
if (!("awaitMessageComponent" in channel)) return;
try {
i1 = await channel!.awaitMessageComponent<ComponentType.Button>({
- filter: (i) => i.customId === "admin" && i.user.id === interaction.user.id,
+ filter: (i) => i.customId === "admin" && i.user.id === interaction.user.id && i.message.id === m.id,
time: 300000
});
} catch (e) {
@@ -120,7 +120,7 @@
let i;
try {
i = await m.awaitMessageComponent<ComponentType.Button>({
- filter: (i) => i.user.id === interaction.user.id,
+ filter: (i) => i.user.id === interaction.user.id && i.message.id === m.id,
time: 300000
});
} catch {
diff --git a/src/commands/server/buttons.ts b/src/commands/server/buttons.ts
index 3ba9c25..3aa2214 100644
--- a/src/commands/server/buttons.ts
+++ b/src/commands/server/buttons.ts
@@ -67,7 +67,12 @@
};
do {
const buttons = new ActionRowBuilder<ButtonBuilder>().addComponents(
- new ButtonBuilder().setCustomId("edit").setLabel("Edit Embed").setStyle(ButtonStyle.Secondary),
+ new ButtonBuilder()
+ .setCustomId("edit")
+ .setLabel("Edit Embed")
+ .setStyle(ButtonStyle.Secondary)
+ .setEmoji(getEmojiByName("ICONS.EDIT") as APIMessageComponentEmoji)
+ ,
new ButtonBuilder()
.setCustomId("send")
.setLabel("Send")
@@ -143,7 +148,7 @@
let i: Discord.ButtonInteraction | Discord.ChannelSelectMenuInteraction | Discord.StringSelectMenuInteraction;
try {
i = (await interaction.channel!.awaitMessageComponent({
- filter: (i: Discord.Interaction) => i.user.id === interaction.user.id,
+ filter: (i: Discord.Interaction) => i.user.id === interaction.user.id && i.isMessageComponent() && i.message.id === m.id,
time: 300000
})) as
| Discord.ButtonInteraction
@@ -223,17 +228,16 @@
case "send": {
await i.deferUpdate();
const channel = interaction.guild!.channels.cache.get(data.channel!) as Discord.TextChannel;
- const components = new ActionRowBuilder<ButtonBuilder>();
+ const messageData: MessageCreateOptions = { };
for (const button of data.buttons) {
- components.addComponents(
+ messageData.components = [new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId(button)
.setLabel(buttonNames[button]!)
.setStyle(ButtonStyle.Primary)
- );
+ )];
}
- const messageData: MessageCreateOptions = { components: [components] };
- if (data.title || data.description) {
+ if (data.title || data.description || data.color) {
const e = new EmojiEmbed();
if (data.title) e.setTitle(data.title);
if (data.description) e.setDescription(data.description);
diff --git a/src/commands/settings/autopublish.ts b/src/commands/settings/autopublish.ts
index afc4e7d..d389e2d 100644
--- a/src/commands/settings/autopublish.ts
+++ b/src/commands/settings/autopublish.ts
@@ -20,7 +20,7 @@
.setDescription("Automatically publish messages posted in announcement channels");
export const callback = async (interaction: CommandInteraction): Promise<void> => {
- await interaction.reply({
+ const m = await interaction.reply({
embeds: LoadingEmbed,
ephemeral: true,
fetchReply: true
@@ -70,7 +70,7 @@
let i: Discord.ButtonInteraction | Discord.ChannelSelectMenuInteraction;
try {
i = (await interaction.channel!.awaitMessageComponent({
- filter: (i: Discord.Interaction) => i.user.id === interaction.user.id,
+ filter: (i: Discord.Interaction) => i.user.id === interaction.user.id && i.isMessageComponent() && i.message.id === m.id,
time: 300000
})) as Discord.ButtonInteraction | Discord.ChannelSelectMenuInteraction;
} catch (e) {
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index 3ee7675..62abd7e 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -18,7 +18,7 @@
const callback = async (interaction: CommandInteraction): Promise<unknown> => {
if (interaction.guild) client.database.premium.hasPremium(interaction.guild.id).finally(() => {});
- await interaction.reply({
+ const m = await interaction.reply({
embeds: LoadingEmbed,
ephemeral: true,
fetchReply: true
@@ -79,7 +79,7 @@
let i: Discord.ButtonInteraction | Discord.SelectMenuInteraction;
try {
- i = (await interaction.channel!.awaitMessageComponent({
+ i = (await m.awaitMessageComponent({
filter: (i: Discord.Interaction) => i.user.id === interaction.user.id,
time: 300000
})) as Discord.ButtonInteraction | Discord.SelectMenuInteraction;
diff --git a/src/commands/settings/logs/events.ts b/src/commands/settings/logs/events.ts
index 4cffab7..1041409 100644
--- a/src/commands/settings/logs/events.ts
+++ b/src/commands/settings/logs/events.ts
@@ -122,7 +122,7 @@
let i: ButtonInteraction | StringSelectMenuInteraction | ChannelSelectMenuInteraction;
try {
i = (await m.awaitMessageComponent({
- filter: (i) => i.user.id === interaction.user.id,
+ filter: (i) => i.user.id === interaction.user.id && i.isMessageComponent() && i.message.id === m.id,
time: 300000
})) as ButtonInteraction | StringSelectMenuInteraction | ChannelSelectMenuInteraction;
} catch (e) {
diff --git a/src/commands/settings/logs/warnings.ts b/src/commands/settings/logs/warnings.ts
index a810560..35be955 100644
--- a/src/commands/settings/logs/warnings.ts
+++ b/src/commands/settings/logs/warnings.ts
@@ -19,7 +19,7 @@
const callback = async (interaction: CommandInteraction): Promise<unknown> => {
if (!interaction.guild) return;
- await interaction.reply({
+ const m = await interaction.reply({
embeds: LoadingEmbed,
ephemeral: true,
fetchReply: true
@@ -67,7 +67,7 @@
let i: Discord.ButtonInteraction | Discord.ChannelSelectMenuInteraction;
try {
i = await interaction.channel!.awaitMessageComponent<ComponentType.Button | ComponentType.ChannelSelect>({
- filter: (i: Discord.Interaction) => i.user.id === interaction.user.id,
+ filter: (i: Discord.Interaction) => i.user.id === interaction.user.id && i.isMessageComponent() && i.message.id === m.id,
time: 300000
});
} catch (e) {