Please allow updating interaction message flags #4348
-
I ran into a problem, I want to edit the message flags of an interaction message. This would simply my bot's code and makes a better user experience. Here's the current solution: Here's what I want Here's the code in case you want that. https://github.com/yourWaifu/is-your-waifu-legal/blob/master/discord-bot/bot.cpp Solutions I tried: Keep the ephemeral Added Complexity with current solution: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Autocomplete interactions were implemented for this purpose |
Beta Was this translation helpful? Give feedback.
-
Ephemeral messages are not ordinary messages, they are not stored on the Discord servers. Only in the cache of the client who received the message. By removing the flag of such a message, it will not become ordinary. In your case, it would look good to respond to the slash command with an ephemeral message with text, and respond to button with an ordinary message with a picture. Also, by clicking on the button, you can delete an ephemeral message with text. |
Beta Was this translation helpful? Give feedback.
-
OK, I was able to come up with my own solution. Before sending out the did you mean message, send a message response with a message like "Waiting on user". This message should also not have the ephemeral flag. You'll see why later. Then send the did you mean message as a follow up with the ephemeral flag. Here's the source code to this yourWaifu/is-your-waifu-legal@7569cf2 |
Beta Was this translation helpful? Give feedback.
OK, I was able to come up with my own solution. Before sending out the did you mean message, send a message response with a message like "Waiting on user". This message should also not have the ephemeral flag. You'll see why later. Then send the did you mean message as a follow up with the ephemeral flag.
You'll want to store the interaction ID and token from the slash command, as we'll be using it later. Don't forget to erase them after 15 mins.
After the user presses the button, we edit the did you mean message to something like "The answer is above". Then edit the original interaction using the ID and token you stored earlier.
Here's the source code to this yourWaifu/is-your-waifu-le…