Add setters to ForwardChannel

This commit is contained in:
Temirkhan Myrzamadi 2020-07-28 02:14:58 +06:00
parent e72f622ae5
commit 3e0f8ab686

View file

@ -466,6 +466,35 @@ pub struct ForwardChannel {
pub signature: Option<String>,
}
impl ForwardChannel {
pub fn new(date: i32, chat: Chat, message_id: i32) -> Self {
Self { date, chat, message_id, signature: None }
}
pub fn date(mut self, val: i32) -> Self {
self.date = val;
self
}
pub fn chat(mut self, val: Chat) -> Self {
self.chat = val;
self
}
pub fn message_id(mut self, val: i32) -> Self {
self.message_id = val;
self
}
pub fn signature<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.signature = Some(val.into());
self
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ForwardNonChannel {