Select Menu Reset

how can I reset a select menu after someone picks an option and I show them a modal? Since I already replied with the modal, I can’t use interaction.update(). I just want the menu to go back to default (no option selected) without having edited tag to the original message.
27 Replies
d.js toolkit
d.js toolkit3w ago
0xNived
0xNivedOP3w ago
I’ve seen ticket bots do this when I click an option, the modal pops up, and at the same time the select menu resets back to default, even without submitting the modal, and without the (edited) tag Thank you for your response but do you think it’s possible to reset the select menu back to default even if I don’t submit the modal? I’ve seen a ticket bot do this, and that’s the functionality I’m talking about
0xNived
0xNivedOP3w ago
This gif might help in elaborate with what i am trying to achieve , it reset after the modal is open.
No description
0xNived
0xNivedOP3w ago
Sorry, yes i have this application in the guild and i tried with editreply but it has no effect on it and with interaction.message.edit it leaves edited tag on the original message in that gif i selected "one" option from drop down after clicking on within next few seconds and model appear it removes user selection i am trying to replicate it but i am not sure how to do so? i find that interaction.update does it but i am confused how are they using it after showing the modal then clearing the user selection
Amgelo
Amgelo3w ago
it does reset, but after a while I think an empty editReply can work at least an empty update does but given you're showing a modal you can't use that
0xNived
0xNivedOP3w ago
alright i try once again 👍
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
renoisme
renoisme3w ago
@0xNived
renoisme
renoisme3w ago
this?
0xNived
0xNivedOP3w ago
Hi, Yes exactly like that
renoisme
renoisme3w ago
No description
renoisme
renoisme3w ago
At first, I was using .unpin(), but I ran into issues with it when dealing with audit logs or pinned messages. It took me quite a while before I finally discovered .suppressEmbeds(false) 😢
0xNived
0xNivedOP3w ago
thank you much ❤️ bless you man! it worked.
renoisme
renoisme3w ago
Happy to help, bye!
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
gost
gost3w ago
Okay, but what if my message is ephemeral?
renoisme
renoisme3w ago
I don't know. Maybe an error occurs.
gost
gost3w ago
Yes, an error occurred because it did not find interaction.message..., do you know of any optimized way like the previous one that I can use in ephemeral messages?
renoisme
renoisme3w ago
Sorry, I don’t know. If it’s an ephemeral message, then it shouldn’t be a problem even if a “edited” tag is attached :)
duck
duck3w ago
<Message>.suppressEmbeds() attempts to use <Message>.edit() which would error since you can only edit ephemeral messages through the interaction webhook you'd need to use <Interaction>.editReply(), which since you're using showModal, I believe you'd need to specify the message option as mentioned above, I believe even an empty edit should work, but if for whatever reason you believe editing with the exact same flags is what works, by all means go ahead
renoisme
renoisme3w ago
No description
renoisme
renoisme3w ago
🍉 👍
duck
duck3w ago
your IDE underlining flags makes me wonder if it's telling you that flags isn't an option which would suggest you need to update discord.js (but also if it works anyways, then really you could do an empty edit)
gost
gost3w ago
Thank you very much!
renoisme
renoisme3w ago
The underline is there because it’s a flag that can’t be applied to editReply. It’s impossible to edit a non-ephemeral message into an ephemeral one. I can’t add emojis to messages though!! LOL
d.js toolkit
d.js toolkit2w ago
The thread owner has marked this issue as solved.

Did you find this page helpful?