Edit a Select() prior to sending a Modal #9289
-
Is it possible to disable a Select() that is in a view, prior to sending a modal? That is, the View which contains the Select() UI has a call back that sends the Modal. In the code below, the user will select an option, and then this callback function is called. Is it possible to disable this selector? prior to sending this modal? Now, if I update the view, and pass it into the modal, I can disable that selector that way, but this only get's disabled after the Modal has been sent and submitted. async def callback(interaction):
weather_select.disabled = True
weather_select.placeholder = "thinking . . ."
typE = weather_select.values[0]
modal = WeatherModal(
typE=typE,
prompt="City: ",
title="Enter a City"
)
await interaction.response.send_modal(modal) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
sorry for the late response ! Interaction.edit_original_response can be called to edit the message, since await interaction.response.send_modal(modal)
weather_select.disabled = True
await interaction.edit_original_response(view=weather_select.view) |
Beta Was this translation helpful? Give feedback.
sorry for the late response !
Interaction.edit_original_response can be called to edit the message, since
response.send_modal()
causes the original message to point to the message with the component, for example: