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 @@ const callback = async (interaction: CommandInteraction): Promise => { ); } 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 @@ const callback = async (interaction: CommandInteraction): Promise => { if (!("awaitMessageComponent" in channel)) return; try { i1 = await channel!.awaitMessageComponent({ - 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 @@ const callback = async (interaction: CommandInteraction): Promise => { let i; try { i = await m.awaitMessageComponent({ - 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 @@ export const callback = async (interaction: CommandInteraction): Promise = }; do { const buttons = new ActionRowBuilder().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 @@ export const callback = async (interaction: CommandInteraction): Promise = 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 @@ export const callback = async (interaction: CommandInteraction): Promise = case "send": { await i.deferUpdate(); const channel = interaction.guild!.channels.cache.get(data.channel!) as Discord.TextChannel; - const components = new ActionRowBuilder(); + const messageData: MessageCreateOptions = { }; for (const button of data.buttons) { - components.addComponents( + messageData.components = [new ActionRowBuilder().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 @@ export const command = new SlashCommandSubcommandBuilder() .setDescription("Automatically publish messages posted in announcement channels"); export const callback = async (interaction: CommandInteraction): Promise => { - await interaction.reply({ + const m = await interaction.reply({ embeds: LoadingEmbed, ephemeral: true, fetchReply: true @@ -70,7 +70,7 @@ export const callback = async (interaction: CommandInteraction): Promise = 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 command = (builder: SlashCommandSubcommandBuilder) => const callback = async (interaction: CommandInteraction): Promise => { 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 @@ const callback = async (interaction: CommandInteraction): Promise => { 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 @@ const callback = async (interaction: CommandInteraction): Promise => { 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 command = (builder: SlashCommandSubcommandBuilder) => const callback = async (interaction: CommandInteraction): Promise => { if (!interaction.guild) return; - await interaction.reply({ + const m = await interaction.reply({ embeds: LoadingEmbed, ephemeral: true, fetchReply: true @@ -67,7 +67,7 @@ const callback = async (interaction: CommandInteraction): Promise => { 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 }); } catch (e) { diff --git a/src/config/format.ts b/src/config/format.ts index 0560796..b63debd 100644 --- a/src/config/format.ts +++ b/src/config/format.ts @@ -1,7 +1,7 @@ import fs from "fs"; import * as readLine from "node:readline/promises"; -const defaultDict: Record> = { +const defaultDict: Record> = { developmentToken: "Your development bot token (Used for testing in one server, rather than production)", developmentGuildID: "Your development guild ID", enableDevelopment: true, @@ -29,7 +29,12 @@ const defaultDict: Record