Select Menus should save user's selection
When a user interacts with a Select Menu, their selection is remembered. However, it isn't saved to discord, only temporarily to their client. It would improve user's experience with Select Menus if it was saved permanently, specifically with multiple selections (max_values > 1), as they could quickly change, add to, or remove their selection without needing to reselect their previous values. It would also serve to remind them of what they previously selected.
It's a cool idea but it would not improve user experience for my usecases. It would make sense if this was to come to life to either:
- Provide an boolean option to specify that you want that component to remember it's state permanently or not.
- Add the option to provide default selected values from the bot so that you can save the state yourself and populate it when the user next uses it.
A selection dropdown can allow a user to search through a large list of choices. A dropdown menu or sub-menu can specify the direction it should open.
ACE Flare Account1
In the meantime, not a permanent but a temporary solution:
Let your bot create a JSON object like this:
}This way you can compare the User ID of the user trying to request the menu (it would have to be in a temp message) against your JSON keys, if there is a match, take the number from the array (I chose arrays, as it would be compatible with potential multiple choice default selections) and let your bot send the specific user a select menu with the specified selection set as default. If it does not match, set no default but a placeholder if you want.You can alternatively use strings instead of integers, and if you are trying to change roles you can check the User's roles to see which ones should be selected.For the time being however, I would recommend you add a section to your message that states which roles are currently selected, and that the user will have to reselect and deselect them to remove them.You could also ignore selections in the select menu, and instead add a submit button that will send all the selections at once, that way you can also remove user roles that have not been reselected from the menu.Hope this helps in any way0
Log ind for at efterlade en kommentar.