Ad open_period & close_date to Poll

This commit is contained in:
Temirkhan Myrzamadi 2020-07-30 11:11:29 +06:00
parent 9686193970
commit 710675fdf6

View file

@ -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.