all repos — stealth-developers @ 8b2d95c7047f985a88364cc9b518dd286a244fc9

fix(tickets): allow running /ticket view outside of a ticket channel
vi v@vt3e.cat
Wed, 04 Mar 2026 17:28:50 +0000
commit

8b2d95c7047f985a88364cc9b518dd286a244fc9

parent

62cdcaf94af05edcf272ed9387ddc3b37a8e0018

2 files changed, 9 insertions(+), 11 deletions(-)

jump to
M src/interactions/commands/tickets/gdpr.tssrc/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.tssrc/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."); }