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
Copy file name to clipboardExpand all lines: discord_slash/utils/manage_commands.py
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,10 @@ def create_option(name: str,
157
157
:param choices: Choices of the option. Can be empty.
158
158
:return: dict
159
159
160
+
.. note::
161
+
An option with ``required=False`` will not pass anything to the command function if the user doesn't pass that option when invoking the command.
162
+
You must set the the relevant argument's function to a default argument, eg ``argname = None``.
163
+
160
164
.. note::
161
165
``choices`` must either be a list of `option type dicts <https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptionchoice>`_
0 commit comments