Select menu
How to reply discord select menus
Creating a Responder for a Selection Menu
It is possible to create a Responder
that can accept several types of select menus, see an example:
Above is the code to send a common selection menu as a response to a command. Just below you can see a Responder
with ResponderType.StringSelect
in the types, so that the run
function of this Responder will be executed when someone selects from this selection menu:
You can combine several different types of select menus:
Below are all the types of select menus:
Select Menu | ResponderType |
---|---|
Strings | ResponderType.StringSelect |
Users | ResponderType.UserSelect |
Channels | ResponderType.ChannelSelect |
Roles | ResponderType.RoleSelect |
Mentions | ResponderType.MentionableSelect |
It is possible to combine with any type, this way you can have a button, a select menu and a modal with the same customId and they will all be answered in this function, just do the checks: