mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-08 19:33:53 +01:00
Add setters to Chat
This commit is contained in:
parent
8f1cb11b4d
commit
ad6e19201a
1 changed files with 21 additions and 0 deletions
|
@ -25,6 +25,27 @@ pub struct Chat {
|
|||
pub photo: Option<ChatPhoto>,
|
||||
}
|
||||
|
||||
impl Chat {
|
||||
pub fn new(id: i64, kind: ChatKind) -> Self {
|
||||
Self { id, kind, photo: None }
|
||||
}
|
||||
|
||||
pub fn id(mut self, val: i64) -> Self {
|
||||
self.id = val;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn kind(mut self, val: ChatKind) -> Self {
|
||||
self.kind = val;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn photo(mut self, val: ChatPhoto) -> Self {
|
||||
self.photo = Some(val);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[serde_with_macros::skip_serializing_none]
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
|
|
Loading…
Reference in a new issue