#Broken modals

1 messages · Page 1 of 1 (latest)

inner kiln
#

sometimes my modals are broken idk why
sometimes some text inputs doesn't show up

#
  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);
rustic gorge
#

Code looks... Fine.. I think.

inner kiln
#

i deleted app command from gui

#

then recreated

#

btw is this good code

#

for writing modals

rustic gorge
#

At a glance, yes

inner kiln
#

@rustic gorge for example

#

sometimes it becomes like this

#

but there is nothing in my code like this

#

sometimes this

#

as you can see there is no point

#

should i defer or something else when i reply interaction

#

because when i submit

#

im not replying command

#

im sending global text

rustic gorge
#

No ides

#

Try asking in the djs server I guess

#

They might know better