all repos — stealth-developers @ 71c8aa9aceea9650a5e4904940b0848c1516ece0

feat: replace bug button command with generic help command
willow hai@wlo.moe
Sun, 16 Nov 2025 01:08:06 +0000
commit

71c8aa9aceea9650a5e4904940b0848c1516ece0

parent

5f38f0a6c2070246630bcf57bd21feee4b7b92ad

3 files changed, 21 insertions(+), 49 deletions(-)

jump to
D src/interactions/commands/bug/button.ts

@@ -1,44 +0,0 @@

-import config from "@/config.ts"; -import { - ActionRowBuilder, - type ChatInputCommandInteraction, - type Client, - StringSelectMenuBuilder, - StringSelectMenuOptionBuilder, -} from "discord.js"; -import { PROJECT_MAP } from "./shared.ts"; - -export async function execute( - _client: Client, - interaction: ChatInputCommandInteraction, -) { - const tgtUser = interaction.options.getUser("user", true); - - const options = Object.entries(PROJECT_MAP).map(([key, project]) => - new StringSelectMenuOptionBuilder() - .setLabel(project.displayName) - .setValue(key), - ); - - const selectMenu = new StringSelectMenuBuilder() - .setCustomId("bug:project-select") - .setPlaceholder(`select a ${config.data.terminology} to report a bug`) - .addOptions(...options); - - const selectRow = - new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(selectMenu); - - await interaction.reply({ - content: - `📝 <@${tgtUser.id}>, use the dropdown below to select the ${config.data.terminology} - you want to report a bug for. in the future, you can also use the - </bug report:${interaction.commandId}> command to report bugs.` - .replace(/\s+/g, " ") - .trim(), - components: [selectRow], - }); -} - -export const buttonCommand = { - execute, -};
A src/interactions/commands/bug/help.ts

@@ -0,0 +1,17 @@

+import type { ChatInputCommandInteraction, Client } from "discord.js"; + +export async function execute( + _client: Client, + interaction: ChatInputCommandInteraction, +) { + const tgtUser = interaction.options.getUser("user", true); + + const command = `</bug report:${interaction.commandId}>`; + await interaction.reply({ + content: `📝 <@${tgtUser.id}>, you can use the ${command} command to report bugs, it will show a popup where you can enter the bug details and attach a relevant piece of media.`, + }); +} + +export const helpCommand = { + execute, +};
M src/interactions/commands/bug/index.tssrc/interactions/commands/bug/index.ts

@@ -1,4 +1,3 @@

-import config from "@/config.ts"; import type { ICommand } from "@/types.ts"; import { type ApplicationCommandData,

@@ -6,13 +5,13 @@ type ButtonInteraction,

type Client, SlashCommandBuilder, } from "discord.js"; -import { buttonCommand } from "./button.ts"; import { handleCloseButton, handleDeleteButton, handleEditButton, handleOpenButton, } from "./buttons.ts"; +import { helpCommand } from "./help.ts"; import { reportCommand } from "./report.ts"; const commandData = new SlashCommandBuilder()

@@ -23,8 +22,8 @@ subcommand.setName("report").setDescription("report a new bug"),

) .addSubcommand((subcommand) => subcommand - .setName("button") - .setDescription("create a button to report bugs") + .setName("help") + .setDescription("help a user report a bug") .addUserOption((option) => option .setName("user")

@@ -69,7 +68,7 @@ case "report":

await reportCommand.execute(client, interaction); break; case "button": - await buttonCommand.execute(client, interaction); + await helpCommand.execute(client, interaction); break; default: await interaction.reply({