fix(tickets): allow running /ticket view outside of a ticket channel
vi v@vt3e.cat
Wed, 04 Mar 2026 17:28:50 +0000
2 files changed,
9 insertions(+),
11 deletions(-)
M
src/interactions/commands/tickets/gdpr.ts
→
src/interactions/commands/tickets/gdpr.ts
@@ -168,6 +168,7 @@ export async function handleViewTicket(
_client: Client, interaction: ChatInputCommandInteraction, ) { + await interaction.deferReply(); if (!interaction.guild) { await interaction.editReply({ content: "❌ This command can only be used in a server.",
M
src/interactions/commands/tickets/index.ts
→
src/interactions/commands/tickets/index.ts
@@ -108,16 +108,14 @@ });
return; } - if (action === "create") { - await handleCreate(client, interaction); - return; - } - if (action === "list") { - await handleList(client, interaction); - return; - } - if (action === "export") { - await handleExport(client, interaction); + const actions = { + create: handleCreate, + list: handleList, + export: handleExport, + view: handleViewTicket, + }; + if (action in actions) { + await actions[action as keyof typeof actions](client, interaction); return; }@@ -157,7 +155,6 @@ if (action === "reopen") await handleReopen(client, interaction, ticket);
else if (action === "delete") await handleDelete(client, interaction, ticket); else if (action === "transcript") await handleTranscript(client, interaction, ticket); - else if (action === "view") await handleViewTicket(client, interaction); else await interaction.editReply("❌ Invalid or unhandled action."); }