Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit 5b214ea

Browse files
committed
fixed slash options
1 parent ce19a35 commit 5b214ea

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ You can find more (and better) examples [here](https://github.com/discord-py-ui/
175175

176176

177177
# Changelog
178+
- <details>
179+
<summary>4.3.7</summary>
180+
181+
## **Fixed**
182+
- Issue with SLashOptions
183+
> required is now false by default again
184+
185+
</details>
178186

179187
- <details>
180188
<summary>4.3.7</summary>

discord_ui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@
4646

4747

4848
__title__ = "discord-ui"
49-
__version__ = "4.3.7"
49+
__version__ = "4.3.8"

discord_ui/slash/types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SlashOption():
2424
description: :class:`str`, optional
2525
1-100 character description of the command; default name
2626
required: :class:`bool`, optional
27-
If the parameter is required or optional; default True
27+
If the parameter is required or optional; default False
2828
choices: List[:class:`dict`], optional
2929
Choices for string and int types for the user to pick from; default None
3030
Choices should be formated like this: ``[{"name": "name of the choice", "value": "the real value"}, ...]``
@@ -36,7 +36,7 @@ class SlashOption():
3636
options: List[:class:`~SlashOption`]
3737
This parameter is only for subcommands to work, you shouldn't need to use that, unless you know what you're doing
3838
"""
39-
def __init__(self, argument_type, name, description=None, required=True, choices=None, options=None) -> None:
39+
def __init__(self, argument_type, name, description=None, required=False, choices=None, options=None) -> None:
4040
"""
4141
Creates a new option for a slash command
4242
@@ -627,7 +627,7 @@ def __init__(self, callback, base_names, name, description=None, options=[], gui
627627
self.base_names = [format_name(x) for x in base_names]
628628

629629
def to_option(self) -> SlashOption:
630-
return SlashOption(OptionType.SUB_COMMAND, self.name, self.description, options=self.options or None)
630+
return SlashOption(OptionType.SUB_COMMAND, self.name, self.description, options=self.options or None, required=False)
631631
def to_dict(self):
632632
return self.to_option().to_dict()
633633
def copy(self):

0 commit comments

Comments
 (0)