pub fn attribute(mut self, attr: Attribute) -> Self {
        match &mut self.media {
            Some(tl::enums::InputMedia::UploadedDocument(document)) => {
                document.attributes.push(attr.into());
            }
            _ => {}
        }
        self
    }
/// Add additional attributes to the message.
///
/// This must be called *after* setting a file.
///
/// # Examples
///
/// ```
/// # async fn f(client: &mut grammers_client::Client) -> Result<(), Box<dyn std::error::Error>> {
/// # let audio = client.upload_file("audio.flac").await?;
/// #
/// use std::time::Duration;
/// use grammers_client::{types::Attribute, InputMessage};
///
/// let message = InputMessage::text("").document(audio).attribute(
///    Attribute::Audio {
///        duration: Duration::new(123, 0),
///        title: Some("Hello".to_string()),
///        performer: Some("World".to_string()),
///    }
/// );
/// # Ok(())
/// # }
/// ```
Add additional attributes to the message.
This must be called *after* setting a file.
Add additional attributes to the message . This must be called * after * setting a file .
pub fn attribute(mut self, attr: Attribute) -> Self {
        match &mut self.media {
            Some(tl::enums::InputMedia::UploadedDocument(document)) => {
                document.attributes.push(attr.into());
            }
            _ => {}
        }
        self
    }
pub fn attribute ( mut self , attr : Attribute ) -> Self { match & mut self . media { Some ( tl :: enums :: InputMedia :: UploadedDocument ( document ) ) => { document . attributes . push ( attr . into ( ) ) ; } _ => { } } self }
Add additional attributes to the message.
Add additional attributes to the message .
mut self
attr
Attribute
mut self
attr
Attribute
examples
None
async fn f(client: &mut grammers_client::client) -> result<(), box<dyn std::error::error>> {
None
let audio = client.upload_file("audio.flac").await?;
use std::time::Duration;
use grammers_client::{types::Attribute, InputMessage}.

let message = InputMessage::text("").document(audio).attribute(
Attribute::Audio {
duration: Duration::new(123, 0),
title: Some("Hello".to_string()),
performer: Some("World".to_string()),
}
).
use std :: time :: Duration ; use grammers_client :: { types :: Attribute InputMessage } . let message = InputMessage :: text ( " " ) . document ( audio ) . attribute ( Attribute :: Audio { duration : Duration :: new ( 123 0 ) title : Some ( " Hello " . to_string () ) performer : Some ( " World " . to_string () ) } ) .
ok(())
None
}
None