Telegram Bot Document Object (types/document.rs)

teloxide · crates/teloxide-core/src/types/document.rs · rust · MIT
integration, chat

Represents a generic file entity within a Telegram bot conversation. Use this for handling file uploads, downloads, and metadata in bot integrations.

// Source: https://github.com/teloxide/teloxide | License: MIT | Copyright 2019-2025 teloxide
// Provided via justclaw.it.com; keep this notice with the code.
use mime::Mime;
use serde::{Deserialize, Serialize};

use crate::types::{FileMeta, PhotoSize};

/// This object represents a general file (as opposed to [photos], [voice
/// messages] and [audio files]).
///
/// [The official docs](https://core.telegram.org/bots/api#document).
///
/// [photos]: https://core.telegram.org/bots/api#photosize
/// [voice messages]: https://core.telegram.org/bots/api#voice
/// [audio files]: https://core.telegram.org/bots/api#audio
#[serde_with::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[cfg_attr(test, derive(schemars::JsonSchema))]
pub struct Document {
 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key