mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Add setters to ForwardChannel
This commit is contained in:
parent
e72f622ae5
commit
3e0f8ab686
1 changed files with 29 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue