Skip to content

Commit

Permalink
feat: include category name in transcripts
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Jan 3, 2023
1 parent 0fa45e3 commit 4dbbba6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/autocomplete/ticket.js
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions user/templates/transcript.md.mustache
Expand Up @@ -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 }}
Expand Down

0 comments on commit 4dbbba6

Please sign in to comment.