108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
/// # Arguments
/// * `to` - Target chat ID.
/// * `media` - List of attachments, non-empty.
/// * `msg` - Message text (supports HTML formatting).
///
/// # Returns
/// * `Result<()>` - fails if `media` is empty, problems forming media
/// group, request fails.
pub async fn sendgroup (&self, to: &ChatPeerId, media: Vec<Attachment>, msg: &str) -> Result<()> {
if media.len() > 1 {
let mut attach = vec![];
let mut pos = media.len();
for file in media {
let mut doc = InputMediaDocument::from(
InputFile::from(
|
|
|
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
/// # Arguments
/// * `to` - Target chat ID.
/// * `media` - List of attachments, non-empty.
/// * `msg` - Message text (supports HTML formatting).
///
/// # Returns
/// * `Result<()>` - fails if `media` is empty, problems forming media
/// group, request fails.
pub async fn sendgroup (&self, to: &ChatPeerId, media: Vec<Attachment>, msg: &str) -> Result<()> {
if media.len() > 1 {
let mut attach = vec![];
let mut pos = media.len();
for file in media {
let mut doc = InputMediaDocument::from(
InputFile::from(
|