From 4dbbba6c0ba80d47f50cca66d1e46057c3f58c20 Mon Sep 17 00:00:00 2001 From: Isaac Date: Tue, 3 Jan 2023 16:51:11 +0000 Subject: [PATCH] feat: include category name in transcripts --- src/autocomplete/ticket.js | 2 +- user/templates/transcript.md.mustache | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/autocomplete/ticket.js b/src/autocomplete/ticket.js index df38807..489a807 100644 --- a/src/autocomplete/ticket.js +++ b/src/autocomplete/ticket.js @@ -49,7 +49,7 @@ module.exports = class TicketCompleter extends Autocompleter { }); tickets = tickets.map(ticket => { const date = new Date(ticket.createdAt).toLocaleString([locale, 'en-GB'], { dateStyle: 'short' }); - const topic = ticket.topic ? '- ' + decrypt(ticket.topic).substring(0, 50) : ''; + const topic = ticket.topic ? '- ' + decrypt(ticket.topic).replace(/\n/, ' ').substring(0, 50) : ''; const category = emoji.hasEmoji(ticket.category.emoji) ? emoji.get(ticket.category.emoji) + ' ' + ticket.category.name : ticket.category.name; ticket._name = `${category} #${ticket.number} (${date}) ${topic}`; return ticket; diff --git a/user/templates/transcript.md.mustache b/user/templates/transcript.md.mustache index db2b80d..cb69b1d 100644 --- a/user/templates/transcript.md.mustache +++ b/user/templates/transcript.md.mustache @@ -2,8 +2,8 @@ --- -* ID: {{ ticket.id }} -* Number: {{ guildName }} #{{ ticket.number }} +* ID: {{ ticket.id }} ({{ guildName }}) +* Number: {{ ticket.category.name }} #{{ ticket.number }} * Topic: {{ #ticket.topic }}{{ . }}{{ /ticket.topic }}{{ ^ticket.topic }}(no topic){{ /ticket.topic }} * Created on: {{ #ticket }}{{ createdAtFull }}{{ /ticket }} * Created by: {{ #ticket.createdBy }}"{{ displayName }}" @{{ username }}#{{ discriminator }}{{ /ticket.createdBy }}