#Option Select menu

1 messages · Page 1 of 1 (latest)

fair condor
#

can you elaborate? not quite sure what you mean

#

perhaps you mean remove the role from the user?

#

then just check if they have the role already

#

like role in interaction.user.roles

#

(also you don't need get_guild, you can just use interaction.guild directly)

#

not ==, just if role in interaction.user.roles

#

because you already got the role from get_role

#

uhhhhhhh

#

that would just add it then immediately remove it, no?

#

you should check before adding py if role in roles: remove_role(...) else: add_role(...)

#

yes

#

?

#

i think you're still misunderstanding

#

why are you always adding the role first?

#

that's a separate interaction then

#

your goal is to toggle the role when a user selects the option - every time they click the option, a new callback is fired:

  • if they don't have the role, give it to them and tell them they got it
  • otherwise, remove the role and tell them it was removed
#

with your current code, it will always give the role and instantly remove it