Skip to content

Commit 45d968c

Browse files
committed
docs: Document the rest of the Component object.
1 parent 326853a commit 45d968c

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

interactions/api/models/flags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from enum import IntFlag, Enum
1+
from enum import Enum, IntFlag
22

33

44
class Intents(IntFlag):

interactions/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from enum import IntEnum, Enum
1+
from enum import Enum, IntEnum
22

33

44
class ApplicationCommandType(IntEnum):

interactions/models/component.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ class Component(DictSerializerMixin):
159159
:ivar Optional[int] min_values?: The minimum "options"/values to choose from the component.
160160
:ivar Optional[int] max_values?: The maximum "options"/values to choose from the component.
161161
:ivar Optional[List[Component]] components?: A list of components nested in the component.
162+
:ivar Optional[int] min_length?: The minimum input length to choose from the component.
163+
:ivar Optional[int] max_length?: The maximum input length to choose from the component.
164+
:ivar Optional[bool] required?: Whether this component is required to be filled.
165+
:ivar Optional[str] value?: The pre-filled value of the component.
162166
"""
163167

164168
__slots__ = (
@@ -175,7 +179,10 @@ class Component(DictSerializerMixin):
175179
"min_values",
176180
"max_values",
177181
"components",
178-
"value", # TODO: post-v4: document this
182+
"min_length",
183+
"max_length",
184+
"required",
185+
"value",
179186
)
180187
type: ComponentType
181188
custom_id: Optional[str]
@@ -189,6 +196,9 @@ class Component(DictSerializerMixin):
189196
min_values: Optional[int]
190197
max_values: Optional[int]
191198
components: Optional[List["Component"]]
199+
min_length: Optional[int]
200+
max_length: Optional[int]
201+
required: Optional[bool]
192202
value: Optional[str]
193203

194204
def __init__(self, **kwargs) -> None:

0 commit comments

Comments
 (0)