all repos — stealth-developers @ a19b9c8aa54b7c47b8677c31a7d567bd24c632ee

bot: fix thank you button x2
vi did:web:vt3e.cat
Wed, 08 Jul 2026 03:15:59 +0100
commit

a19b9c8aa54b7c47b8677c31a7d567bd24c632ee

parent

32e571c080df75ef430ed79c120546abdf71328e

1 files changed, 9 insertions(+), 4 deletions(-)

jump to
M apps/bot/src/feats/tickets/buttons.tsapps/bot/src/feats/tickets/buttons.ts

@@ -10,7 +10,7 @@ TextDisplayBuilder,

} from "discord.js"; import { kitten } from "@/client"; -import { PublicError, errorMessage, getTextChannel, handleError } from "@/lib"; +import { PublicError, errorMessage, getTextChannel, handleError, logger } from "@/lib"; import { useGetTicketData } from "@/middleware"; import * as actions from "./actions";

@@ -239,13 +239,18 @@ const { ticket } = ctx;

if (!ticket) return errorMessage(interaction, "Failed to find ticket"); const { guild } = ticket; + if (!guild) return errorMessage(interaction, "Failed to find guild"); const thankedAt = ticket.thankedAt; if (thankedAt) return errorMessage(interaction, "You already thanked for this ticket"); - const channelRes = await Result.fromAsync(getTextChannel(guild.ticketLogChannel!)); - if (!channelRes.unwrapErr()) + if (!guild.ticketLogChannel) return errorMessage(interaction, "Ticket log channel is not set"); + + const channelRes = await Result.fromAsync(getTextChannel(guild.ticketLogChannel)); + if (channelRes.isErr()) { + logger.error(channelRes.unwrapErr(), "failed to find ticket log channel"); return errorMessage(interaction, "Failed to find ticket log channel"); + } const channel = channelRes.unwrap(); await editTicket(ticket.id, {

@@ -258,7 +263,7 @@ content: `The reporter said thank you for handling ticket #${ticket.localId}! 💖`,

}), interaction.reply({ content: "A thank you has been sent! 💖", - ephemeral: true, + flags: ["Ephemeral"], }), ]).catch(() => {}); },