#Unselecting Selected Option From SelectMenu In Discord.Js V14.over
1 messages · Page 1 of 1 (latest)
You know/can find out what’s the default value. If you get an empty array you know what‘s selected
//interaction.member.roles.cache.has(interaction.values) ? interaction.member.roles.remove(interaction.values) : interaction.member.roles.add(interaction.values)```
If i got empty array for default : true option, I can't do this process.
Then maybe you need an intermediate value…
const roleId = interaction.values[0] ?? theRoleIdYouSetAsDefault;
And use that in your ternary
How about solution for multi Default?
I mean
Imagine there is 4 options
Option1 default
Option2 default
Option3
Option4 default
If user unselecting option2
But not option 1 and option 4
That logic gonna break?
Is your SelectMenu a multiselect? Then it shouldn’t act like it does…
How to do for multi select unselectable?
It really shouldn’t… sounds like a case for ddevs server #useful-servers