mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 06:25:10 +01:00
Add title
, username
and photo
to ChatShared
This commit is contained in:
parent
cc8df7a32e
commit
d92ba9c12a
2 changed files with 19 additions and 3 deletions
|
@ -1,8 +1,8 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::types::{ChatId, RequestId};
|
||||
use crate::types::{ChatId, PhotoSize, RequestId};
|
||||
|
||||
/// Information about the chat whose identifier was shared with the bot using a
|
||||
/// Information about a chat that was shared with the bot using a
|
||||
/// [`KeyboardButtonRequestChat`] button.
|
||||
///
|
||||
/// [`KeyboardButtonRequestChat`]: crate::types::KeyboardButtonRequestChat
|
||||
|
@ -10,6 +10,19 @@ use crate::types::{ChatId, RequestId};
|
|||
pub struct ChatShared {
|
||||
/// Identifier of the request.
|
||||
pub request_id: RequestId,
|
||||
|
||||
/// Identifier of the shared chat.
|
||||
pub chat_id: ChatId,
|
||||
|
||||
/// Title of the chat, if it was requested.
|
||||
#[serde(default)]
|
||||
pub title: Option<String>,
|
||||
|
||||
/// Username of the chat, if it was requested.
|
||||
#[serde(default)]
|
||||
pub username: Option<String>,
|
||||
|
||||
/// Available sizes of the chat photo, if it was requested.
|
||||
#[serde(default)]
|
||||
pub photo: Option<Vec<PhotoSize>>,
|
||||
}
|
||||
|
|
|
@ -1905,7 +1905,10 @@ mod tests {
|
|||
kind: MessageKind::ChatShared(MessageChatShared {
|
||||
chat_shared: ChatShared {
|
||||
request_id: RequestId(348349),
|
||||
chat_id: ChatId(384939)
|
||||
chat_id: ChatId(384939),
|
||||
title: None,
|
||||
username: None,
|
||||
photo: None,
|
||||
}
|
||||
}),
|
||||
via_bot: None
|
||||
|
|
Loading…
Reference in a new issue