mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-17 17:23:08 +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 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(
|
await interaction.showModal(
|
||||||
new ModalBuilder()
|
new ModalBuilder()
|
||||||
.setCustomId(JSON.stringify({
|
.setCustomId(JSON.stringify({
|
||||||
@ -66,17 +77,7 @@ module.exports = class TopicSlashCommand extends SlashCommand {
|
|||||||
.setTitle(ticket.category.name)
|
.setTitle(ticket.category.name)
|
||||||
.setComponents(
|
.setComponents(
|
||||||
new ActionRowBuilder()
|
new ActionRowBuilder()
|
||||||
.setComponents(
|
.setComponents(field),
|
||||||
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) : ''),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user