mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Ad open_period & close_date to Poll
This commit is contained in:
parent
9686193970
commit
710675fdf6
1 changed files with 19 additions and 0 deletions
|
@ -45,6 +45,13 @@ pub struct Poll {
|
|||
/// Special entities like usernames, URLs, bot commands, etc. that appear in
|
||||
/// the explanation.
|
||||
pub explanation_entities: Option<Vec<MessageEntity>>,
|
||||
|
||||
/// Amount of time in seconds the poll will be active after creation.
|
||||
open_period: Option<i32>,
|
||||
|
||||
/// Point in time (Unix timestamp) when the poll will be automatically
|
||||
/// closed.
|
||||
close_date: Option<i32>,
|
||||
}
|
||||
|
||||
impl Poll {
|
||||
|
@ -76,6 +83,8 @@ impl Poll {
|
|||
correct_option_id: None,
|
||||
explanation: None,
|
||||
explanation_entities: None,
|
||||
open_period: None,
|
||||
close_date: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,6 +159,16 @@ impl Poll {
|
|||
self.explanation_entities = Some(val.into());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn open_period(mut self, val: i32) -> Self {
|
||||
self.open_period = Some(val);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn close_date(mut self, val: i32) -> Self {
|
||||
self.close_date = Some(val);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// This object contains information about one answer option in a poll.
|
||||
|
|
Loading…
Reference in a new issue