fix: fix using wrong emebd
vi did:web:vt3e.cat
Thu, 07 May 2026 23:07:48 +0100
1 files changed,
11 insertions(+),
6 deletions(-)
M
src/interactions/commands/tickets/index.ts
→
src/interactions/commands/tickets/index.ts
@@ -2,6 +2,7 @@ import {
type ButtonInteraction, type ChatInputCommandInteraction, type Client, + GuildMember, type ModalSubmitInteraction, SlashCommandBuilder, SlashCommandSubcommandBuilder,@@ -30,6 +31,7 @@ handleListPagination,
handleViewTicket, } from "./gdpr"; import { handleReasonModal } from "./modals"; +import { hasManagerPermissions } from "@/utils/discord/permissions"; const commandData = new SlashCommandBuilder() .setName("ticket")@@ -231,10 +233,11 @@ publicReason,
privateReason, }); return; - } + } + const isStaff = await hasManagerPermissions(interaction.member as GuildMember) return await interaction.showModal( - getTicketReasonModal(interaction.user.id !== ticket.authorId), + getTicketReasonModal(isStaff), ); }@@ -286,10 +289,12 @@ });
return; } - if (action === "close") - return await interaction.showModal( - getTicketReasonModal(interaction.user.id !== ticket.authorId), - ); + if (action === "close") { + const isStaff = await hasManagerPermissions(interaction.member as GuildMember) + return await interaction.showModal( + getTicketReasonModal(isStaff), + ); + } await interaction.deferReply({ flags: ["Ephemeral"] }); if (action === "reopen") await handleReopen(client, interaction, ticket);