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
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -158,8 +158,8 @@ def create_option(name: str,
158
158
:return: dict
159
159
160
160
.. note::
161
-
a field with the value of ``False`` for ``required`` will return NOTHING if it is not filled. if you wish to have it default to something if not filled,_
162
-
append ``argname = None`` to the ``async def`` portion of the command.
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
163
164
164
.. note::
165
165
``choices`` must either be a list of `option type dicts <https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptionchoice>`_
0 commit comments