Broken modals

sometimes my modals are broken idk why sometimes some text inputs doesn't show up
11 Replies
fenish
fenishOP2y ago
public async createTask(interaction: Subcommand.ChatInputCommandInteraction) {
const modal = new ModalBuilder()
.setCustomId("CreateTaskModal")
.setTitle("Create Task");

const embedColorInput = new TextInputBuilder()
.setCustomId("embedColor")
.setLabel("Set the color of the embed")
.setPlaceholder("#C4F94B")
.setStyle(TextInputStyle.Short)
.setValue("#C4F94B")
.setRequired(true);

const embedThumbnailInput = new TextInputBuilder()
.setCustomId("embedThumbnail")
.setLabel("Thumbnail of the embed")
.setPlaceholder("https://i.imgur.com/IlweEFM.gif")
.setStyle(TextInputStyle.Short)
.setRequired(false);

const pointInput = new TextInputBuilder()
.setCustomId("taskPoint")
.setLabel("Set the point value of the task")
.setPlaceholder("10")
.setValue("10")
.setStyle(TextInputStyle.Short)
.setRequired(true);

const taskDescriptionInput = new TextInputBuilder()
.setCustomId("taskDescription")
.setLabel("Set the description of the task")
.setPlaceholder("Here is your description")
.setStyle(TextInputStyle.Paragraph)
.setRequired(true);

const rows = [
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
taskDescriptionInput
),
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
embedThumbnailInput
),
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
pointInput
),
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
embedColorInput
),
];

modal.addComponents(rows);
await interaction.showModal(modal);
public async createTask(interaction: Subcommand.ChatInputCommandInteraction) {
const modal = new ModalBuilder()
.setCustomId("CreateTaskModal")
.setTitle("Create Task");

const embedColorInput = new TextInputBuilder()
.setCustomId("embedColor")
.setLabel("Set the color of the embed")
.setPlaceholder("#C4F94B")
.setStyle(TextInputStyle.Short)
.setValue("#C4F94B")
.setRequired(true);

const embedThumbnailInput = new TextInputBuilder()
.setCustomId("embedThumbnail")
.setLabel("Thumbnail of the embed")
.setPlaceholder("https://i.imgur.com/IlweEFM.gif")
.setStyle(TextInputStyle.Short)
.setRequired(false);

const pointInput = new TextInputBuilder()
.setCustomId("taskPoint")
.setLabel("Set the point value of the task")
.setPlaceholder("10")
.setValue("10")
.setStyle(TextInputStyle.Short)
.setRequired(true);

const taskDescriptionInput = new TextInputBuilder()
.setCustomId("taskDescription")
.setLabel("Set the description of the task")
.setPlaceholder("Here is your description")
.setStyle(TextInputStyle.Paragraph)
.setRequired(true);

const rows = [
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
taskDescriptionInput
),
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
embedThumbnailInput
),
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
pointInput
),
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
embedColorInput
),
];

modal.addComponents(rows);
await interaction.showModal(modal);
Favna
Favna2y ago
Code looks... Fine.. I think.
fenish
fenishOP2y ago
i deleted app command from gui then recreated btw is this good code for writing modals
Favna
Favna2y ago
At a glance, yes For @Dragonite 's eval (me only, don't bother trying to use it) I have this: https://github.com/favware/dragonite/blob/main/src/commands/Admin/eval.ts
fenish
fenishOP2y ago
@Favna for example
fenish
fenishOP2y ago
sometimes it becomes like this but there is nothing in my code like this
fenish
fenishOP2y ago
sometimes this
fenish
fenishOP2y ago
as you can see there is no point
fenish
fenishOP2y ago
fenish
fenishOP2y ago
should i defer or something else when i reply interaction because when i submit im not replying command im sending global text
Favna
Favna2y ago
No ides Try asking in the djs server I guess They might know better This is after all not strictly sapphire related
Want results from more Discord servers?
Add your server