pub struct SendDocument { /* private fields */ }
Expand description
Sends a general file.
Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
Implementations§
Source§impl SendDocument
impl SendDocument
Sourcepub fn new<A, B>(chat_id: A, document: B) -> SendDocument
pub fn new<A, B>(chat_id: A, document: B) -> SendDocument
Creates a new SendDocument
.
§Arguments
chat_id
- Unique identifier for the target chat.document
- File to send.
Sourcepub fn with_allow_paid_broadcast(self, value: bool) -> SendDocument
pub fn with_allow_paid_broadcast(self, value: bool) -> SendDocument
Sets a new value for the allow_paid_broadcast
flag.
§Arguments
value
- Whether to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot’s balance.
Sourcepub fn with_business_connection_id<T>(self, value: T) -> SendDocument
pub fn with_business_connection_id<T>(self, value: T) -> SendDocument
Sourcepub fn with_caption<T>(self, value: T) -> SendDocument
pub fn with_caption<T>(self, value: T) -> SendDocument
Sets a new caption.
§Arguments
value
- Caption; 0-1024 characters.
May also be used when resending documents by file_id
.
Sourcepub fn with_caption_entities<T>(
self,
value: T,
) -> Result<SendDocument, TextEntityError>where
T: IntoIterator<Item = TextEntity>,
pub fn with_caption_entities<T>(
self,
value: T,
) -> Result<SendDocument, TextEntityError>where
T: IntoIterator<Item = TextEntity>,
Sourcepub fn with_caption_parse_mode(self, value: ParseMode) -> SendDocument
pub fn with_caption_parse_mode(self, value: ParseMode) -> SendDocument
Sourcepub fn with_disable_content_type_detection(self, value: bool) -> SendDocument
pub fn with_disable_content_type_detection(self, value: bool) -> SendDocument
Sets a new value for the disable_content_type_detection
flag.
§Arguments
value
- Indicates whether to disable automatic server-side content type detection for files uploaded usingmultipart/form-data
.
Sourcepub fn with_disable_notification(self, value: bool) -> SendDocument
pub fn with_disable_notification(self, value: bool) -> SendDocument
Sets a new value for the disable_notification
flag.
§Arguments
value
- Indicates whether to send the message silently or not; a user will receive a notification without sound.
Sourcepub fn with_message_effect_id<T>(self, value: T) -> SendDocument
pub fn with_message_effect_id<T>(self, value: T) -> SendDocument
Sets a new message effect ID.
§Arguments
value
- Unique identifier of the message effect to be added to the message; for private chats only.
Sourcepub fn with_message_thread_id(self, value: i64) -> SendDocument
pub fn with_message_thread_id(self, value: i64) -> SendDocument
Sets a new message thread ID.
§Arguments
value
- Unique identifier of the target message thread; supergroups only.
Sourcepub fn with_protect_content(self, value: bool) -> SendDocument
pub fn with_protect_content(self, value: bool) -> SendDocument
Sets a new value for the protect_content
flag.
§Arguments
value
- Indicates whether to protect the contents of the sent message from forwarding and saving.
Sourcepub fn with_thumbnail<T>(
self,
value: T,
) -> Result<SendDocument, SendDocumentError>
pub fn with_thumbnail<T>( self, value: T, ) -> Result<SendDocument, SendDocumentError>
Sets a new thumbnail.
§Arguments
value
- Thumbnail.
The thumbnail should be in JPEG format and less than 200 kB in size.
A thumbnail‘s width and height should not exceed 320.
Ignored if the file is not uploaded using multipart/form-data
.
Thumbnails can’t be reused and can be only uploaded as a new file.