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//! | [`checklist`] | [`checklist::Checklist`], [`checklist::ChecklistTask`], [`checklist::InputChecklist`], service messages |
18//! | [`direct_messages`] | [`direct_messages::DirectMessagesTopic`], price-changed service messages |
19//! | [`mod@file`] | [`file::File`], [`file::PhotoSize`], [`file::InputFile`], [`file::VideoQuality`], media types |
20//! | [`managed_bot`] | [`managed_bot::ManagedBotCreated`] |
21//! | [`message`] | [`message::Message`], [`message::MessageEntity`], [`message::ParseMode`], reply types |
22//! | [`update`] | [`update::Update`], [`update::UpdateKind`], [`update::CallbackQuery`], [`update::BusinessBotRights`] |
23//! | [`user`] | [`user::User`], [`user::ChatId`], [`user::BotCommand`] |
24//! | [`keyboard`] | Inline and reply keyboards, [`keyboard::ReplyMarkup`] |
25//! | [`payments`] | [`payments::LabeledPrice`], invoices, Star transactions, [`payments::TransactionPartner`], [`payments::OwnedGift`] |
26//! | [`poll`] | [`poll::Poll`], [`poll::PollAnswer`], [`poll::InputPollOption`] |
27//! | [`sticker`] | [`sticker::Sticker`], [`sticker::StickerSet`], [`sticker::InputSticker`] |
28//! | [`suggested_post`] | [`suggested_post::SuggestedPostInfo`], [`suggested_post::SuggestedPostParameters`], service messages |
29//! | [`inline`] | [`inline::InlineQuery`], all `InlineQueryResult` variants |
30//! | [`story`] | Story types and area definitions |
31//! | [`forum`] | [`forum::ForumTopic`] |
32//! | [`passport`] | Telegram Passport types and error variants |
33//! | [`games`] | [`games::GameHighScore`] |
34//! | [`gifts`] | [`gifts::Gift`], [`gifts::Gifts`] |
35//! | [`reaction`] | Re-exports [`message::ReactionType`] |
36//! | [`webhook`] | [`webhook::WebhookInfo`] |
37#![warn(missing_docs)]
38
39/// Chat and location types.
40pub mod chat;
41/// Chat member status types.
42pub mod chat_member;
43/// Checklist content type and related service messages.
44pub mod checklist;
45/// Direct messages topic and channel pricing service messages.
46pub mod direct_messages;
47/// File and media types.
48pub mod file;
49/// Forum topic types.
50pub mod forum;
51/// Game types.
52pub mod games;
53/// Gift types.
54pub mod gifts;
55/// Inline query and result types.
56pub mod inline;
57/// Keyboard and markup types.
58pub mod keyboard;
59/// Managed bot service message types.
60pub mod managed_bot;
61/// Message and entity types.
62pub mod message;
63/// Telegram Passport types.
64pub mod passport;
65/// Payment and invoice types.
66pub mod payments;
67/// Poll types.
68pub mod poll;
69/// Reaction types.
70pub mod reaction;
71/// Sticker types.
72pub mod sticker;
73/// Story types.
74pub mod story;
75/// Suggested post types and service messages.
76pub mod suggested_post;
77/// Update and event types.
78pub mod update;
79/// User and bot command types.
80pub mod user;
81/// Webhook info types.
82pub mod webhook;
83
84pub use chat::{Chat, ChatFullInfo, ChatPermissions, ChatType};
85pub use chat_member::{
86    ChatMember, ChatMemberAdministrator, ChatMemberBanned, ChatMemberLeft, ChatMemberMember,
87    ChatMemberOwner, ChatMemberRestricted,
88};
89pub use checklist::{
90    Checklist, ChecklistTask, ChecklistTasksAdded, ChecklistTasksDone, InputChecklist,
91    InputChecklistTask,
92};
93pub use direct_messages::{
94    DirectMessagePriceChanged, DirectMessagesTopic, PaidMessagePriceChanged,
95};
96pub use file::{
97    File, InputMedia, InputMediaAnimation, InputMediaAudio, InputMediaDocument, InputMediaPhoto,
98    InputMediaVideo, InputPaidMedia, InputPaidMediaPhoto, InputPaidMediaVideo, InputProfilePhoto,
99    InputProfilePhotoAnimated, InputProfilePhotoStatic, PhotoSize, VideoQuality,
100};
101pub use inline::{ChosenInlineResult, InlineQuery, InlineQueryResult};
102pub use keyboard::{
103    ForceReply, InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup,
104    ReplyKeyboardRemove,
105};
106pub use managed_bot::ManagedBotCreated;
107pub use message::{
108    ChatOwnerChanged, ChatOwnerLeft, Message, MessageEntity, MessageEntityKind, MessageOrigin,
109    ReactionType, ReplyParameters,
110};
111pub use payments::{
112    AcceptedGiftTypes, AffiliateInfo, LabeledPrice, OrderInfo, OwnedGift, OwnedGiftRegular,
113    OwnedGiftUnique, OwnedGifts, PreCheckoutQuery, ShippingAddress, ShippingOption, ShippingQuery,
114    StarTransaction, StarTransactions, TransactionPartner,
115};
116pub use poll::{InputPollOption, Poll, PollAnswer, PollOption, PollOptionAdded, PollOptionDeleted};
117pub use sticker::{MaskPosition, Sticker, StickerSet, StickerType};
118pub use story::{
119    InputStoryContent, InputStoryContentPhoto, InputStoryContentVideo, LocationAddress, Story,
120    StoryArea, StoryAreaPosition, StoryAreaType,
121};
122pub use suggested_post::{
123    SuggestedPostApprovalFailed, SuggestedPostApproved, SuggestedPostDeclined, SuggestedPostInfo,
124    SuggestedPostPaid, SuggestedPostParameters, SuggestedPostPrice, SuggestedPostRefunded,
125};
126pub use update::{BusinessBotRights, CallbackQuery, Update, UpdateKind, UserChatBoosts};
127pub use user::{
128    BotCommand, BotDescription, BotName, BotShortDescription, ChatAdministratorRights, ChatId,
129    User, UserProfileAudios, UserProfilePhotos,
130};
131pub use webhook::WebhookInfo;