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 toolkit3mo ago
0xNived
0xNivedOP3mo 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
0xNivedOP3mo ago
This gif might help in elaborate with what i am trying to achieve , it reset after the modal is open.
No description
0xNived
0xNivedOP3mo 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
Amgelo3mo 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
0xNivedOP3mo ago
alright i try once again 👍
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
레노
레노3mo ago
@0xNived
레노
레노3mo ago
this?
0xNived
0xNivedOP3mo ago
Hi, Yes exactly like that
레노
레노3mo ago
No description
레노
레노3mo 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
0xNivedOP3mo ago
thank you much ❤️ bless you man! it worked.
레노
레노3mo ago
Happy to help, bye!
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
gost
gost3mo ago
Okay, but what if my message is ephemeral?
레노
레노3mo ago
I don't know. Maybe an error occurs.
gost
gost3mo 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?
레노
레노3mo 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
duck3mo 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
레노
레노3mo ago
No description
레노
레노3mo ago
🍉 👍
duck
duck3mo 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
gost3mo ago
Thank you very much!
레노
레노3mo 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 toolkit3mo ago
The thread owner has marked this issue as solved.

Did you find this page helpful?