Skip to content

Commit 4d974f5

Browse files
authored
Merge pull request #122 from boehs/patch-2
Update manage_commands.py
2 parents 9bc77cd + bac6150 commit 4d974f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

discord_slash/utils/manage_commands.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ def create_option(name: str,
157157
:param choices: Choices of the option. Can be empty.
158158
:return: dict
159159
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+
160164
.. note::
161165
``choices`` must either be a list of `option type dicts <https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptionchoice>`_
162166
or a list of single string values.

0 commit comments

Comments
 (0)