Closed anokhovd closed 4 years ago
This feature exists already, albeit with a different interface, called skip_if
. This was deliberate because it freed the implementation of complications from checks, asynchronicity, etc when most of the time it's unnecessary (and indeed, I have yet to see anyone ask for it).
This PR adds support for buttons checks. Usage of checks is same as in discord.ext.commands except that predicate take in 2 parameters: menu and payload. Now everyone can use menu session by default. If you need old functionality, you need to add check
menus.check_any(menus.is_owner(), menus.is_author())
to all menu buttons.Some examples: