mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Add setters to InputMessageContentLocation
This commit is contained in:
parent
546c90346c
commit
01f929dd4a
1 changed files with 21 additions and 0 deletions
|
@ -80,6 +80,27 @@ pub struct InputMessageContentLocation {
|
|||
pub live_period: Option<u32>,
|
||||
}
|
||||
|
||||
impl InputMessageContentLocation {
|
||||
pub fn new(latitude: f64, longitude: f64) -> Self {
|
||||
Self { latitude, longitude, live_period: None }
|
||||
}
|
||||
|
||||
pub fn latitude(mut self, val: f64) -> Self {
|
||||
self.latitude = val;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn longitude(mut self, val: f64) -> Self {
|
||||
self.longitude = val;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn live_period(mut self, val: u32) -> Self {
|
||||
self.live_period = Some(val);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents the content of a venue message to be sent as the result of
|
||||
/// an inline query.
|
||||
#[serde_with_macros::skip_serializing_none]
|
||||
|
|
Loading…
Reference in a new issue