You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.debug('%s has successfully been registered as an event', coro.__name__)
1018
1024
returncoro
1025
+
1026
+
defon_click(self, custom_id=None):
1027
+
"""A decorator that registers a raw_button_click event that checks on execution if the ``custom_id's`` are the same; if so, the :func:`func` is called..
1028
+
1029
+
You can find more info about this in the `documentation <https://discordpy-message-components.readthedocs.io/en/latest/additions.html#on-click>`.
1030
+
1031
+
The func must be a :ref:`coroutine <coroutine>`, if not, :exc:`TypeError` is raised.
"""A decorator with which you can assign a function to a specific :class:`SelectMenu` (or its custom_id).
1075
+
1076
+
.. note::
1077
+
This will always give exactly one Parameter of type `discord.Interaction <./interaction.html#discord-interaction>`_ like an `raw_selection_select-Event <#on-raw-button-click>`_.
1078
+
1079
+
.. important::
1080
+
The Function this decorator attached to must be an corountine (means an awaitable)
1081
+
1082
+
Parameters
1083
+
----------
1084
+
1085
+
:attr:`custom_id`: Optional[str]
1086
+
1087
+
If the :attr:`custom_id` of the SelectMenu could not use as an function name or you want to give the function a diferent name then the custom_id use this one to set the custom_id.
For more information about the Button-Styles visit the `Discord-API Documentation <https://discord.com/developers/docs/interactions/message-components#buttons-button-styles>`_.
For more information about Select-Menus wisit the `Discord-API-Documentation <https://discord.com/developers/docs/interactions/message-components#select-menus>`_.
raiseInvalidData("SelectionMenu-Options have to bee an Dict like `{'label': 'that what should show up in Discord', 'value': 'that what the Discord-API sends to your Application if the option is chosen'}`, or usually an :function:`discord.components.create_option`.")
raiseInvalidArgument(f"The maximum number of ActionRow's per message is 5 and they can only contain 5 buttons each; you have {len(base)} ActionRow's passed with {objects} objects")
0 commit comments