#same Modals in same interaction

1 messages · Page 1 of 1 (latest)

thorny basin
#

I want send two modals in one interaction. Second will popup after that one is completed.

if choices.value == 'representative':
    data = getModalData("representativeApplyOne.json")
    modal = TestModal(data["ModalName"], data["ModalResponse"])
    for field in data['fields']:
      text_input = ui.TextInput(label=field['label'], style= discord.TextStyle[field['style']], placeholder = field['placeholder'], required = field['required'])
      modal.add_item(text_input)

    await interaction.response.send_modal(modal)
    await modal.wait()

    data = getModalData("representativeApplyTwo.json")
    modal = TestModal(data["ModalName"], data["ModalResponse"])
    for field in data['fields']:
      text_input = ui.TextInput(label=field['label'], style= discord.TextStyle[field['style']], placeholder = field['placeholder'], required = field['required'])
      modal.add_item(text_input)

    await interaction.response.send_modal(modal)

It will said the interaction is alerdy awnsered. Is there any way how to bypass it?

lyric wadi