#modal
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
there is no way
no possible to add timeout?
you can add a timeout to the wait_for function yes
and it’s possible to click on button 2 times ?
what button?
The button « mon montage » opens a modal but if the user leaves the modal without entering any information when they click on my montage again, there's an "interaction error".
can you show the entire error
just this
probably the way you structured your code
can you send the code where you use wait_for_modal
mon_montage = Modal(
ShortText(
label="Début du clip",
custom_id="clip_start",
value="00:00:00",
),
ShortText(
label="Fin du clip",
custom_id="clip_end",
value="00:02:00",
),
title="Mon Montage (Max 2min)",
)
await used_component.ctx.send_modal(modal=mon_montage)
montage_ctx = await ctx.bot.wait_for_modal(mon_montage)
statut = await montage_ctx.send("⌛️ En cours de traitement...")
start_time = convertir_en_secondes(
montage_ctx.responses["clip_start"])
duration = convertir_en_secondes(
montage_ctx.responses["clip_end"]) - start_time
if duration > 3 * 60:
await montage_ctx.send("Durée max : 3 min. ⏳⚠️ Respecte la limite !")
deleteCreditEnCours(str(ctx.user.id))
return
the problem here is that your modal callback is local
i.e. if you go out of this function you have no way to reference it
ok I think I know
I guess that your button you also use wait_for_component?
So the issue is that your code is never executed again if you don't run /generate