Skip to content

Commit

Permalink
add proper validation for duration
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanUC committed Nov 7, 2024
1 parent 5160236 commit 92229c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yepcord/rest_api/models/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 92229c3

Please sign in to comment.