fix(tickets): await manager perm check
vi v@vt3e.cat
Tue, 07 Apr 2026 00:11:51 +0100
1 files changed,
12 insertions(+),
6 deletions(-)
M
src/interactions/commands/tickets/actions.ts
→
src/interactions/commands/tickets/actions.ts
@@ -21,6 +21,7 @@ type Client,
ContainerBuilder, DiscordAPIError, type GuildMember, + type Interaction, type ModalSubmitInteraction, PermissionFlagsBits, TextDisplayBuilder,@@ -171,6 +172,11 @@ content: `:white_check_mark: Ticket created ${channel.toString()}`,
}); } +async function sendMessage(interaction: Interaction, content: string) { + if (!interaction.channel?.isSendable()) return + await interaction.channel.send(content) +} + export async function handleClose( client: Client, interaction: ChatInputCommandInteraction | ModalSubmitInteraction,@@ -190,7 +196,7 @@ await interaction.editReply("❌ This ticket is already closed.");
return; } const closedByReporter = interaction.user.id === _ticket.authorId; - const isManager = hasManagerPermissions(interaction.member as GuildMember); + const isManager = await hasManagerPermissions(interaction.member as GuildMember); const channel = interaction.channel; if (!channel || !("permissionOverwrites" in channel)) return;@@ -234,8 +240,9 @@ ViewChannel: false,
}); } } catch (error) { - logger.error(error, `could not remove permissions for ${ticket.authorId}`); - } + logger.error(error, `could not remove permissions for ${ticket.authorId}`); + channel.send(`Failed to update channel permissions for the ticket author.`) + } const controls = new ActionRowBuilder<ButtonBuilder>().addComponents( new ButtonBuilder()@@ -362,10 +369,9 @@ `send transcript to channel ${transcriptChannelId} for ticket ${ticket.id}`,
); } catch (error) { logger.error(error, `Failed after all retries for ticket ${ticket.id}`); - await interaction.followUp({ - content: + channel.send( "⚠️ Ticket closed but failed to send transcript/notification after multiple attempts.", - }); + ) } }