M
src/interactions/commands/tickets/_shared.ts
→
src/interactions/commands/tickets/_shared.ts
@@ -32,9 +32,7 @@ } as const;
// -- modals ---------------------------------------------------------------------------------------
export function getTicketReasonModal(staff = false) {
- const modal = new ModalBuilder()
- .setCustomId(MODAL_IDS.reason)
- .setTitle("Close Ticket");
+ const modal = new ModalBuilder().setCustomId(MODAL_IDS.reason).setTitle("Close Ticket");
const pubReason = new LabelBuilder()
.setLabel("Public Reason")
@@ -54,9 +52,7 @@ );
const privateReason = new LabelBuilder()
.setLabel("Private Reason")
- .setDescription(
- "Provide a reason for closing the ticket - this will only be visible to staff",
- )
+ .setDescription("Provide a reason for closing the ticket - this will only be visible to staff")
.setTextInputComponent(
new TextInputBuilder()
.setCustomId(INPUT_IDS.PRIVATE_REASON)
@@ -69,9 +65,7 @@
const deleteGroup = new LabelBuilder()
.setLabel("Immediately delete channel")
.setCheckboxComponent(
- new CheckboxBuilder()
- .setCustomId("ticket:delete_checkbox")
- .setDefault(false),
+ new CheckboxBuilder().setCustomId("ticket:delete_checkbox").setDefault(false),
);
modal.addLabelComponents(pubReason);
@@ -106,9 +100,9 @@ : `### ${title} Reason\n-# No ${title.toLowerCase()} reason provided.`;
const buttons = new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
- .setCustomId(`transcript-btn:${ticket.id}`)
.setLabel("View Transcript")
- .setStyle(ButtonStyle.Primary),
+ .setStyle(ButtonStyle.Link)
+ .setURL(`https://tickets.vt3e.cat/tickets/${ticket.id}`),
);
if (isPublic) {
@@ -122,12 +116,8 @@ );
}
const wasBehalfTicket = ticket.openedBy !== ticket.authorId;
- const reasonText = ticket.topic
- ? `for reason: ${ticket.topic}`
- : "without a provided reason";
- const behalfText = wasBehalfTicket
- ? `**Opened By**: <@${ticket.openedBy}> ${reasonText}`
- : null;
+ const reasonText = ticket.topic ? `for reason: ${ticket.topic}` : "without a provided reason";
+ const behalfText = wasBehalfTicket ? `**Opened By**: <@${ticket.openedBy}> ${reasonText}` : null;
const container = new ContainerBuilder()
.addTextDisplayComponents(
@@ -150,9 +140,7 @@ .filter(Boolean)
.join("\n"),
),
)
- .addSeparatorComponents(
- new SeparatorBuilder().setDivider(false).setSpacing(2),
- )
+ .addSeparatorComponents(new SeparatorBuilder().setDivider(false).setSpacing(2))
.addTextDisplayComponents(
text(
[
@@ -187,12 +175,7 @@ )
.join(", ");
return {
- container: constructTicketContainer(
- ticket,
- attachmentsString,
- context,
- isPublic,
- ),
+ container: constructTicketContainer(ticket, attachmentsString, context, isPublic),
transcriptText,
attachments,
files: [file],