feat: allow /transcript to accept numbers as well as IDs

This commit is contained in:
Isaac 2025-02-14 16:53:03 +00:00
parent 20a0b9378b
commit 5a66c31494
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -132,7 +132,14 @@ module.exports = class TranscriptSlashCommand extends SlashCommand {
guild: true,
questionAnswers: true,
},
where: { id: ticketId },
where: interaction.guildId && ticketId.length < 16
? {
guildId_number: {
guildId: interaction.guildId,
number: parseInt(ticketId),
},
}
: { id: ticketId },
});
if (!ticket) throw new Error(`Ticket ${ticketId} does not exist`);