Skip to main content

rustigram_types/
lib.rs

1//! Type definitions for the Telegram Bot API.
2//!
3//! This crate contains every struct, enum, and type alias described in the
4//! [official Bot API documentation](https://core.telegram.org/bots/api).
5//! All types implement [`serde::Serialize`] and [`serde::Deserialize`] and
6//! map directly to the JSON objects Telegram sends and receives.
7//!
8//! You rarely need to depend on this crate directly — the `rustigram` facade
9//! re-exports everything you need for day-to-day bot development.
10//!
11//! # Organisation
12//!
13//! | Module | Contents |
14//! |---|---|
15//! | [`chat`] | [`chat::Chat`], [`chat::ChatFullInfo`], [`chat::ChatPermissions`], locations, venues |
16//! | [`chat_member`] | All six [`chat_member::ChatMember`] variants |
17//! | [`mod@file`] | [`file::File`], [`file::PhotoSize`], [`file::InputFile`], media types |
18//! | [`message`] | [`message::Message`], [`message::MessageEntity`], [`message::ParseMode`], reply types |
19//! | [`update`] | [`update::Update`], [`update::UpdateKind`], [`update::CallbackQuery`] |
20//! | [`user`] | [`user::User`], [`user::ChatId`], [`user::BotCommand`] |
21//! | [`keyboard`] | Inline and reply keyboards, [`keyboard::ReplyMarkup`] |
22//! | [`payments`] | [`payments::LabeledPrice`], invoices, Star transactions |
23//! | [`poll`] | [`poll::Poll`], [`poll::PollAnswer`], [`poll::InputPollOption`] |
24//! | [`sticker`] | [`sticker::Sticker`], [`sticker::StickerSet`], [`sticker::InputSticker`] |
25//! | [`inline`] | [`inline::InlineQuery`], all `InlineQueryResult` variants |
26//! | [`story`] | Story types and area definitions |
27//! | [`forum`] | [`forum::ForumTopic`] |
28//! | [`passport`] | Telegram Passport types and error variants |
29//! | [`games`] | [`games::GameHighScore`] |
30//! | [`gifts`] | [`gifts::Gift`], [`gifts::Gifts`] |
31//! | [`reaction`] | Re-exports [`message::ReactionType`] |
32//! | [`webhook`] | [`webhook::WebhookInfo`] |
33
34#![warn(missing_docs)]
35/// Chat and location types.
36pub mod chat;
37/// Chat member status types.
38pub mod chat_member;
39/// File and media types.
40pub mod file;
41/// Forum topic types.
42pub mod forum;
43/// Game types.
44pub mod games;
45/// Gift types.
46pub mod gifts;
47/// Inline query and result types.
48pub mod inline;
49/// Keyboard and markup types.
50pub mod keyboard;
51/// Message and entity types.
52pub mod message;
53/// Telegram Passport types.
54pub mod passport;
55/// Payment and invoice types.
56pub mod payments;
57/// Poll types.
58pub mod poll;
59/// Reaction types.
60pub mod reaction;
61/// Sticker types.
62pub mod sticker;
63/// Story types.
64pub mod story;
65/// Update and event types.
66pub mod update;
67/// User and bot command types.
68pub mod user;
69/// Webhook info types.
70pub mod webhook;
71
72pub use chat::{Chat, ChatFullInfo, ChatPermissions, ChatType};
73pub use chat_member::{
74    ChatMember, ChatMemberAdministrator, ChatMemberBanned, ChatMemberLeft, ChatMemberMember,
75    ChatMemberOwner, ChatMemberRestricted,
76};
77pub use file::{File, PhotoSize};
78pub use inline::{ChosenInlineResult, InlineQuery, InlineQueryResult};
79pub use keyboard::{
80    ForceReply, InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup,
81    ReplyKeyboardRemove,
82};
83pub use message::{
84    Message, MessageEntity, MessageEntityKind, MessageOrigin, ReactionType, ReplyParameters,
85};
86pub use payments::{
87    LabeledPrice, OrderInfo, PreCheckoutQuery, ShippingAddress, ShippingOption, ShippingQuery,
88};
89pub use poll::{InputPollOption, Poll, PollAnswer, PollOption};
90pub use sticker::{MaskPosition, Sticker, StickerSet, StickerType};
91pub use update::{CallbackQuery, Update, UpdateKind};
92pub use user::{User, UserProfilePhotos};
93pub use webhook::WebhookInfo;