mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-05 12:23:09 +02:00
fix: /topic
command when there was previously no topic
This commit is contained in:
parent
c5f092ce2f
commit
34c3ed1b6a
@ -57,6 +57,17 @@ module.exports = class TopicSlashCommand extends SlashCommand {
|
||||
|
||||
const getMessage = client.i18n.getLocale(ticket.guild.locale);
|
||||
|
||||
const field = new TextInputBuilder()
|
||||
.setCustomId('topic')
|
||||
.setLabel(getMessage('modals.topic.label'))
|
||||
.setStyle(TextInputStyle.Paragraph)
|
||||
.setMaxLength(1000)
|
||||
.setMinLength(5)
|
||||
.setPlaceholder(getMessage('modals.topic.placeholder'))
|
||||
.setRequired(true);
|
||||
|
||||
if (ticket.topic) field.setValue(decrypt(ticket.topic)); // why can't discord.js accept null or undefined :(
|
||||
|
||||
await interaction.showModal(
|
||||
new ModalBuilder()
|
||||
.setCustomId(JSON.stringify({
|
||||
@ -66,17 +77,7 @@ module.exports = class TopicSlashCommand extends SlashCommand {
|
||||
.setTitle(ticket.category.name)
|
||||
.setComponents(
|
||||
new ActionRowBuilder()
|
||||
.setComponents(
|
||||
new TextInputBuilder()
|
||||
.setCustomId('topic')
|
||||
.setLabel(getMessage('modals.topic.label'))
|
||||
.setStyle(TextInputStyle.Paragraph)
|
||||
.setMaxLength(1000)
|
||||
.setMinLength(5)
|
||||
.setPlaceholder(getMessage('modals.topic.placeholder'))
|
||||
.setRequired(true)
|
||||
.setValue(ticket.topic ? decrypt(ticket.topic) : ''),
|
||||
),
|
||||
.setComponents(field),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user