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//! | [`rich_message`] | [`rich_message::RichMessage`], [`rich_message::RichBlock`], [`rich_message::RichText`], [`rich_message::InputRichMessage`] |
28//! | [`sticker`] | [`sticker::Sticker`], [`sticker::StickerSet`], [`sticker::InputSticker`] |
29//! | [`suggested_post`] | [`suggested_post::SuggestedPostInfo`], [`suggested_post::SuggestedPostParameters`], service messages |
30//! | [`inline`] | [`inline::InlineQuery`], all `InlineQueryResult` variants |
31//! | [`story`] | Story types and area definitions |
32//! | [`forum`] | [`forum::ForumTopic`] |
33//! | [`passport`] | Telegram Passport types and error variants |
34//! | [`games`] | [`games::GameHighScore`] |
35//! | [`gifts`] | [`gifts::Gift`], [`gifts::Gifts`] |
36//! | [`reaction`] | Re-exports [`message::ReactionType`] |
37//! | [`webhook`] | [`webhook::WebhookInfo`] |
38#![warn(missing_docs)]
39
40/// Chat and location types.
41pub mod chat;
42/// Chat member status types.
43pub mod chat_member;
44/// Checklist content type and related service messages.
45pub mod checklist;
46/// Community (linked chats) types.
47pub mod community;
48/// Direct messages topic and channel pricing service messages.
49pub mod direct_messages;
50/// File and media types.
51pub mod file;
52/// Forum topic types.
53pub mod forum;
54/// Game types.
55pub mod games;
56/// Gift types.
57pub mod gifts;
58/// Inline query and result types.
59pub mod inline;
60/// Keyboard and markup types.
61pub mod keyboard;
62/// Managed bot service message types.
63pub mod managed_bot;
64/// Message and entity types.
65pub mod message;
66/// Telegram Passport types.
67pub mod passport;
68/// Payment and invoice types.
69pub mod payments;
70/// Poll types.
71pub mod poll;
72/// Reaction types.
73pub mod reaction;
74/// Rich message types (Bot API 10.1).
75pub mod rich_message;
76/// Sticker types.
77pub mod sticker;
78/// Story types.
79pub mod story;
80/// Suggested post types and service messages.
81pub mod suggested_post;
82/// Update and event types.
83pub mod update;
84/// User and bot command types.
85pub mod user;
86/// Webhook info types.
87pub mod webhook;
88
89pub use chat::{
90    Chat, ChatFullInfo, ChatInviteLink, ChatJoinRequest, ChatPermissions, ChatType, InputMediaLink,
91    Link,
92};
93pub use chat_member::{
94    ChatMember, ChatMemberAdministrator, ChatMemberBanned, ChatMemberLeft, ChatMemberMember,
95    ChatMemberOwner, ChatMemberRestricted,
96};
97pub use checklist::{
98    Checklist, ChecklistTask, ChecklistTasksAdded, ChecklistTasksDone, InputChecklist,
99    InputChecklistTask,
100};
101pub use community::{Community, CommunityChatAdded, CommunityChatRemoved};
102pub use direct_messages::{
103    DirectMessagePriceChanged, DirectMessagesTopic, PaidMessagePriceChanged,
104};
105pub use file::{
106    File, InputMedia, InputMediaAnimation, InputMediaAudio, InputMediaDocument,
107    InputMediaLivePhoto, InputMediaLocation, InputMediaPhoto, InputMediaSticker, InputMediaVenue,
108    InputMediaVideo, InputMediaVoiceNote, InputPaidMedia, InputPaidMediaLivePhoto,
109    InputPaidMediaPhoto, InputPaidMediaVideo, InputProfilePhoto, InputProfilePhotoAnimated,
110    InputProfilePhotoStatic, LivePhoto, PhotoSize, VideoQuality,
111};
112pub use inline::{ChosenInlineResult, InlineQuery, InlineQueryResult, SentGuestMessage};
113pub use keyboard::{
114    ForceReply, InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup,
115    ReplyKeyboardRemove,
116};
117pub use managed_bot::ManagedBotCreated;
118pub use message::{
119    ChatOwnerChanged, ChatOwnerLeft, Message, MessageEntity, MessageEntityKind, MessageOrigin,
120    ReactionType, ReplyParameters,
121};
122pub use payments::{
123    AcceptedGiftTypes, AffiliateInfo, BotSubscriptionUpdated, LabeledPrice, OrderInfo, OwnedGift,
124    OwnedGiftRegular, OwnedGiftUnique, OwnedGifts, PaidMediaLivePhoto, PaidMediaPhoto,
125    PaidMediaPreview, PreCheckoutQuery, ShippingAddress, ShippingOption, ShippingQuery,
126    StarTransaction, StarTransactions, TransactionPartner,
127};
128pub use poll::{
129    InputPollMedia, InputPollOption, InputPollOptionMedia, Poll, PollAnswer, PollMedia, PollOption,
130    PollOptionAdded, PollOptionDeleted,
131};
132pub use rich_message::{
133    InputRichBlock, InputRichBlockAnchor, InputRichBlockAnimation, InputRichBlockAudio,
134    InputRichBlockBlockQuotation, InputRichBlockCollage, InputRichBlockDetails,
135    InputRichBlockDivider, InputRichBlockFooter, InputRichBlockList, InputRichBlockListItem,
136    InputRichBlockMap, InputRichBlockMathematicalExpression, InputRichBlockParagraph,
137    InputRichBlockPhoto, InputRichBlockPreformatted, InputRichBlockPullQuotation,
138    InputRichBlockSectionHeading, InputRichBlockSlideshow, InputRichBlockTable,
139    InputRichBlockThinking, InputRichBlockVideo, InputRichBlockVoiceNote, InputRichMessage,
140    InputRichMessageContent, InputRichMessageMedia, InputRichMessageMediaKind, RichBlock,
141    RichBlockAnchor, RichBlockAnimation, RichBlockAudio, RichBlockBlockQuotation, RichBlockCaption,
142    RichBlockCollage, RichBlockDetails, RichBlockDivider, RichBlockFooter, RichBlockList,
143    RichBlockListItem, RichBlockMap, RichBlockMathematicalExpression, RichBlockPhoto,
144    RichBlockPreformatted, RichBlockPullQuotation, RichBlockSectionHeading, RichBlockSlideshow,
145    RichBlockTable, RichBlockTableCell, RichBlockThinking, RichBlockVideo, RichBlockVoiceNote,
146    RichMessage, RichText, RichTextAnchor, RichTextAnchorLink, RichTextBankCardNumber,
147    RichTextBold, RichTextBotCommand, RichTextCashtag, RichTextCode, RichTextCustomEmoji,
148    RichTextDateTime, RichTextEmailAddress, RichTextFootnote, RichTextHashtag, RichTextItalic,
149    RichTextMarked, RichTextMathematicalExpression, RichTextMention, RichTextPhoneNumber,
150    RichTextReference, RichTextSpoiler, RichTextStrikethrough, RichTextSubscript,
151    RichTextSuperscript, RichTextTextMention, RichTextUnderline, RichTextUrl,
152};
153pub use sticker::{MaskPosition, Sticker, StickerSet, StickerType};
154pub use story::{
155    InputStoryContent, InputStoryContentPhoto, InputStoryContentVideo, LocationAddress, Story,
156    StoryArea, StoryAreaPosition, StoryAreaType,
157};
158pub use suggested_post::{
159    SuggestedPostApprovalFailed, SuggestedPostApproved, SuggestedPostDeclined, SuggestedPostInfo,
160    SuggestedPostPaid, SuggestedPostParameters, SuggestedPostPrice, SuggestedPostRefunded,
161};
162pub use update::{BusinessBotRights, CallbackQuery, Update, UpdateKind, UserChatBoosts};
163pub use user::{
164    BotAccessSettings, BotCommand, BotDescription, BotName, BotShortDescription,
165    ChatAdministratorRights, ChatId, User, UserProfileAudios, UserProfilePhotos,
166};
167pub use webhook::WebhookInfo;