Replying to interactions that wait for modal submission

I may be approaching this wrong, but I haven't found a successful combination of deferring/replying/updating for when an interaction is submitted that displays a modal and awaits the modal submission. My issue is when the user submits the interaction, I can't defer or reply to the interaction before calling .showModal(...) on it, otherwise I get an error stating that the interaction has already been replied to. Once the modal is displayed, I'm calling .awaitModalSubmit(...) on the interaction, which returns a ModalSubmitInteraction. It seems as though the modal submit interaction returned isn't tied to the original interaction, so if replied to, it generates a new message in Discord, leaving the original interaction in the Sending command... state. If I instead follow up or edit the original interaction, the modal submit interaction gets stuck in a an un-replied state. Is there a way to a) have the modal submission not generate a second message, but instead update the original one? or b) satisfy both interactions so neither of them get stuck in a weird state? I do also want to point out, that for uninteresting reasons, when replying to these messages, I'm calling through the webhook client to send responses, and not directly through the interaction itself.
3 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MrMythical
MrMythical2y ago
The "Sending command..." message is a discord bug
_Rob
_Rob2y ago
Ah, ok Is there an open issue somewhere for it? Never mind, I can Google It seems like that state happens when an error occurs on the original interaction if you're trying to use embeds. I'm not sure if that applies to my state because I'm not attempting to send embeds. Ok, thanks. It's not a major issue because things work, so I'll just ignore it for now and hope someone on the Discord side fixes it.