feat(bugs): make a report button
vi v@vt3e.cat
Thu, 26 Feb 2026 22:03:07 +0000
1 files changed,
32 insertions(+),
3 deletions(-)
M
src/interactions/commands/bug/index.ts
→
src/interactions/commands/bug/index.ts
@@ -1,5 +1,8 @@
import { + ActionRowBuilder, + ButtonBuilder, type ButtonInteraction, + ButtonStyle, type ChatInputCommandInteraction, type Client, type ModalSubmitInteraction,@@ -29,7 +32,7 @@ .addUserOption((option) =>
option .setName("user") .setDescription("The user to send the button to") - .setRequired(true), + .setRequired(false), ), );@@ -40,14 +43,37 @@ ) {
if (!interaction.isChatInputCommand()) return; const subcommand = interaction.options.getSubcommand(); + const commandId = interaction.commandId; switch (subcommand) { case "report": await interaction.showModal(buildReportModal()); break; - case "help": - // await helpCommand.execute(client, interaction); + case "help": { + const user = interaction.options.getUser("user", false); + const command = `</bug report:${commandId}>`; + + const message = [ + "📝 ", + user ? `<@${user.id}>, ` : "", + "You can click the button below to report a bug, you will be shown a popup where you can enter the bug details & attach a relevant piece of media. ", + `Alternatively, you can use the ${command} command, which does the same thing.`, + ].join(""); + + const actionRow = new ActionRowBuilder<ButtonBuilder>().addComponents( + new ButtonBuilder() + .setCustomId("bug:new") + .setLabel("Make a report") + .setStyle(ButtonStyle.Primary), + ); + + await interaction.reply({ + content: message, + components: [actionRow], + }); + break; + } default: await interaction.reply({ content: "❌ Unknown subcommand.",@@ -74,6 +100,9 @@ await handleDeleteButton(client, interaction);
break; case "trello": await handleTrelloButton(client, interaction); + break; + case "new": + await interaction.showModal(buildReportModal()); break; default: await interaction.reply({