From 92229c36cf8d5be48a6579475c42062dbc99c6b9 Mon Sep 17 00:00:00 2001 From: RuslanUC Date: Thu, 7 Nov 2024 14:33:22 +0200 Subject: [PATCH] add proper validation for duration --- yepcord/rest_api/models/channels.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yepcord/rest_api/models/channels.py b/yepcord/rest_api/models/channels.py index 7f39a87..08ae286 100644 --- a/yepcord/rest_api/models/channels.py +++ b/yepcord/rest_api/models/channels.py @@ -344,9 +344,9 @@ class MessagePollAnswerModel(BaseModel): class MessagePollModel(BaseModel): question: MessagePollQuestionContentModel - answers: list[MessagePollAnswerModel] = Field(max_length=10) # TODO: is it 10? + answers: list[MessagePollAnswerModel] = Field(max_length=10) allow_multiselect: bool = False - duration: int = 24 # In hours, TODO: add validation for max and min + duration: int = Field(default=24, ge=1, le=24 * 7) layout_type: int = 1