Skip to content

Commit 6ab3ba5

Browse files
committed
fix: min/max_value -> min/max_values
1 parent b7fbbca commit 6ab3ba5

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

interactions/models/discord/modal.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,18 @@ class FileUploadComponent(BaseComponent):
144144
145145
Attributes:
146146
custom_id: A unique identifier for the component.
147-
min_value: The minimum number of files that can be uploaded.
148-
max_value: The maximum number of files that can be uploaded.
147+
min_values: The minimum number of files that can be uploaded.
148+
max_values: The maximum number of files that can be uploaded.
149149
required: Whether the file upload is required.
150150
151151
"""
152152

153-
def __init__(self, custom_id: Optional[str] = None, min_value: int = 1, max_value: int = 1, required: bool = True):
153+
def __init__(
154+
self, custom_id: Optional[str] = None, min_values: int = 1, max_values: int = 1, required: bool = True
155+
):
154156
self.custom_id = custom_id or str(uuid.uuid4())
155-
self.min_value = min_value
156-
self.max_value = max_value
157+
self.min_values = min_values
158+
self.max_values = max_values
157159
self.required = required
158160
self.type = ComponentType.FILE_UPLOAD
159161

@@ -162,8 +164,8 @@ def to_dict(self) -> dict:
162164
{
163165
"type": self.type,
164166
"custom_id": self.custom_id,
165-
"min_value": self.min_value,
166-
"max_value": self.max_value,
167+
"min_values": self.min_value,
168+
"max_values": self.max_value,
167169
"required": self.required,
168170
}
169171
)
@@ -172,8 +174,8 @@ def to_dict(self) -> dict:
172174
def from_dict(cls, data: dict) -> Self:
173175
return cls(
174176
custom_id=data.get("custom_id"),
175-
min_value=data.get("min_value"),
176-
max_value=data.get("max_value"),
177+
min_values=data.get("min_values"),
178+
max_values=data.get("max_values"),
177179
required=data.get("required", True),
178180
)
179181

0 commit comments

Comments
 (0)