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//! | [`background`] | [`background::BackgroundFill`], [`background::BackgroundType`], [`background::ChatBackground`] |
16//! | [`business`] | Business profile types, [`business::Birthdate`], [`business::UserRating`] |
17//! | [`chat`] | [`chat::Chat`], [`chat::ChatFullInfo`], [`chat::ChatPermissions`], locations, venues |
18//! | [`chat_member`] | All six [`chat_member::ChatMember`] variants |
19//! | [`checklist`] | [`checklist::Checklist`], [`checklist::ChecklistTask`], [`checklist::InputChecklist`], service messages |
20//! | [`direct_messages`] | [`direct_messages::DirectMessagesTopic`], price-changed service messages |
21//! | [`mod@file`] | [`file::File`], [`file::PhotoSize`], [`file::InputFile`], [`file::VideoQuality`], media types |
22//! | [`managed_bot`] | [`managed_bot::ManagedBotCreated`] |
23//! | [`message`] | [`message::Message`], [`message::MessageEntity`], [`message::ParseMode`], reply types |
24//! | [`update`] | [`update::Update`], [`update::UpdateKind`], [`update::CallbackQuery`], [`update::BusinessBotRights`] |
25//! | [`user`] | [`user::User`], [`user::ChatId`], [`user::BotCommand`] |
26//! | [`keyboard`] | Inline and reply keyboards, [`keyboard::ReplyMarkup`] |
27//! | [`payments`] | [`payments::LabeledPrice`], invoices, Star transactions, [`payments::TransactionPartner`], [`payments::OwnedGift`] |
28//! | [`poll`] | [`poll::Poll`], [`poll::PollAnswer`], [`poll::InputPollOption`] |
29//! | [`rich_message`] | [`rich_message::RichMessage`], [`rich_message::RichBlock`], [`rich_message::RichText`], [`rich_message::InputRichMessage`] |
30//! | [`sticker`] | [`sticker::Sticker`], [`sticker::StickerSet`], [`sticker::InputSticker`] |
31//! | [`suggested_post`] | [`suggested_post::SuggestedPostInfo`], [`suggested_post::SuggestedPostParameters`], service messages |
32//! | [`inline`] | [`inline::InlineQuery`], all `InlineQueryResult` variants |
33//! | [`story`] | Story types and area definitions |
34//! | [`forum`] | [`forum::ForumTopic`] and the six forum service messages |
35//! | [`shared`] | [`shared::UsersShared`], [`shared::ChatShared`], [`shared::SharedUser`] |
36//! | [`video_chat`] | The four video chat service messages |
37//! | [`passport`] | Telegram Passport types and error variants |
38//! | [`games`] | [`games::GameHighScore`] |
39//! | [`gifts`] | [`gifts::Gift`], [`gifts::Gifts`] |
40//! | [`giveaway`] | [`giveaway::Giveaway`] and the three giveaway service messages |
41//! | [`reaction`] | Re-exports [`message::ReactionType`] |
42//! | [`webhook`] | [`webhook::WebhookInfo`] |
43#![warn(missing_docs)]
44
45/// Chat background types.
46pub mod background;
47/// Business account profile types.
48pub mod business;
49/// Chat and location types.
50pub mod chat;
51/// Chat member status types.
52pub mod chat_member;
53/// Checklist content type and related service messages.
54pub mod checklist;
55/// Community (linked chats) types.
56pub mod community;
57/// Direct messages topic and channel pricing service messages.
58pub mod direct_messages;
59/// File and media types.
60pub mod file;
61/// Forum topic types.
62pub mod forum;
63/// Game types.
64pub mod games;
65/// Gift types.
66pub mod gifts;
67/// Giveaway types and service messages.
68pub mod giveaway;
69/// Inline query and result types.
70pub mod inline;
71/// Keyboard and markup types.
72pub mod keyboard;
73/// Managed bot service message types.
74pub mod managed_bot;
75/// Message and entity types.
76pub mod message;
77/// Telegram Passport types.
78pub mod passport;
79/// Payment and invoice types.
80pub mod payments;
81/// Poll types.
82pub mod poll;
83/// Reaction types.
84pub mod reaction;
85/// Rich message types (Bot API 10.1).
86pub mod rich_message;
87/// Users and chats shared with the bot via keyboard request buttons.
88pub mod shared;
89/// Sticker types.
90pub mod sticker;
91/// Story types.
92pub mod story;
93/// Suggested post types and service messages.
94pub mod suggested_post;
95/// Update and event types.
96pub mod update;
97/// User and bot command types.
98pub mod user;
99/// Video chat service message types.
100pub mod video_chat;
101/// Webhook info types.
102pub mod webhook;
103
104pub use background::{
105    BackgroundFill, BackgroundFillFreeformGradient, BackgroundFillGradient, BackgroundFillSolid,
106    BackgroundType, BackgroundTypeChatTheme, BackgroundTypeFill, BackgroundTypePattern,
107    BackgroundTypeWallpaper, ChatBackground,
108};
109pub use business::{
110    Birthdate, BusinessIntro, BusinessLocation, BusinessOpeningHours, BusinessOpeningHoursInterval,
111    UserRating,
112};
113pub use chat::{
114    Chat, ChatFullInfo, ChatInviteLink, ChatJoinRequest, ChatLocation, ChatPermissions, ChatPhoto,
115    ChatType, InputMediaLink, Link, Location, Venue,
116};
117pub use chat_member::{
118    ChatMember, ChatMemberAdministrator, ChatMemberBanned, ChatMemberLeft, ChatMemberMember,
119    ChatMemberOwner, ChatMemberRestricted,
120};
121pub use checklist::{
122    Checklist, ChecklistTask, ChecklistTasksAdded, ChecklistTasksDone, InputChecklist,
123    InputChecklistTask,
124};
125pub use community::{Community, CommunityChatAdded, CommunityChatRemoved};
126pub use direct_messages::{
127    DirectMessagePriceChanged, DirectMessagesTopic, PaidMessagePriceChanged,
128};
129pub use file::{
130    Animation, Audio, Document, File, InputFile, InputMedia, InputMediaAnimation, InputMediaAudio,
131    InputMediaDocument, InputMediaLivePhoto, InputMediaLocation, InputMediaPhoto,
132    InputMediaSticker, InputMediaVenue, InputMediaVideo, InputMediaVoiceNote, InputPaidMedia,
133    InputPaidMediaLivePhoto, InputPaidMediaPhoto, InputPaidMediaVideo, InputProfilePhoto,
134    InputProfilePhotoAnimated, InputProfilePhotoStatic, LivePhoto, PassportFile, PhotoSize, Video,
135    VideoNote, VideoQuality, Voice,
136};
137pub use forum::{
138    ForumTopic, ForumTopicClosed, ForumTopicCreated, ForumTopicEdited, ForumTopicReopened,
139    GeneralForumTopicHidden, GeneralForumTopicUnhidden,
140};
141pub use games::{CallbackGame, Game, GameHighScore};
142pub use gifts::{
143    Gift, GiftBackground, GiftInfo, Gifts, UniqueGift, UniqueGiftBackdrop,
144    UniqueGiftBackdropColors, UniqueGiftColors, UniqueGiftInfo, UniqueGiftModel, UniqueGiftSymbol,
145};
146pub use giveaway::{Giveaway, GiveawayCompleted, GiveawayCreated, GiveawayWinners};
147pub use inline::{
148    ChosenInlineResult, InlineQuery, InlineQueryResult, InlineQueryResultArticle,
149    InlineQueryResultAudio, InlineQueryResultCachedAudio, InlineQueryResultCachedDocument,
150    InlineQueryResultCachedGif, InlineQueryResultCachedMpeg4Gif, InlineQueryResultCachedPhoto,
151    InlineQueryResultCachedSticker, InlineQueryResultCachedVideo, InlineQueryResultCachedVoice,
152    InlineQueryResultContact, InlineQueryResultDocument, InlineQueryResultGame,
153    InlineQueryResultGif, InlineQueryResultLocation, InlineQueryResultMpeg4Gif,
154    InlineQueryResultPhoto, InlineQueryResultVenue, InlineQueryResultVideo, InlineQueryResultVoice,
155    InlineQueryResultsButton, InputContactMessageContent, InputInvoiceMessageContent,
156    InputLocationMessageContent, InputMessageContent, InputTextMessageContent,
157    InputVenueMessageContent, PreparedInlineMessage, SentGuestMessage, SentWebAppMessage,
158};
159pub use keyboard::{
160    ButtonStyle, CopyTextButton, ForceReply, InlineKeyboardButton, InlineKeyboardMarkup,
161    KeyboardButton, KeyboardButtonPollType, KeyboardButtonRequestChat,
162    KeyboardButtonRequestManagedBot, KeyboardButtonRequestUsers, LoginUrl, MenuButton,
163    PreparedKeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyMarkup,
164    SwitchInlineQueryChosenChat,
165};
166pub use managed_bot::ManagedBotCreated;
167pub use message::{
168    ChatOwnerChanged, ChatOwnerLeft, Contact, Dice, ExternalReplyInfo, InaccessibleMessage,
169    LinkPreviewOptions, MaybeInaccessibleMessage, Message, MessageAutoDeleteTimerChanged,
170    MessageEntity, MessageEntityKind, MessageId, MessageOrigin, ParseMode, ProximityAlertTriggered,
171    ReactionType, ReplyParameters, TextQuote, WebAppData, WebAppInfo, WriteAccessAllowed,
172};
173pub use passport::{
174    EncryptedCredentials, EncryptedPassportElement, PassportData, PassportElementError,
175};
176pub use payments::{
177    AcceptedGiftTypes, AffiliateInfo, BotSubscriptionUpdated, Invoice, LabeledPrice, OrderInfo,
178    OwnedGift, OwnedGiftRegular, OwnedGiftUnique, OwnedGifts, PaidMedia, PaidMediaInfo,
179    PaidMediaLivePhoto, PaidMediaPhoto, PaidMediaPreview, PaidMediaVideo, PreCheckoutQuery,
180    RefundedPayment, RevenueWithdrawalState, ShippingAddress, ShippingOption, ShippingQuery,
181    StarAmount, StarTransaction, StarTransactions, SuccessfulPayment, TransactionPartner,
182    TransactionPartnerAffiliateProgram, TransactionPartnerChat, TransactionPartnerFragment,
183    TransactionPartnerTelegramApi, TransactionPartnerUser,
184};
185pub use poll::{
186    InputPollMedia, InputPollOption, InputPollOptionMedia, Poll, PollAnswer, PollMedia, PollOption,
187    PollOptionAdded, PollOptionDeleted, PollType,
188};
189pub use rich_message::{
190    InputRichBlock, InputRichBlockAnchor, InputRichBlockAnimation, InputRichBlockAudio,
191    InputRichBlockBlockQuotation, InputRichBlockCollage, InputRichBlockDetails,
192    InputRichBlockDivider, InputRichBlockFooter, InputRichBlockList, InputRichBlockListItem,
193    InputRichBlockMap, InputRichBlockMathematicalExpression, InputRichBlockParagraph,
194    InputRichBlockPhoto, InputRichBlockPreformatted, InputRichBlockPullQuotation,
195    InputRichBlockSectionHeading, InputRichBlockSlideshow, InputRichBlockTable,
196    InputRichBlockThinking, InputRichBlockVideo, InputRichBlockVoiceNote, InputRichMessage,
197    InputRichMessageContent, InputRichMessageMedia, InputRichMessageMediaKind, RichBlock,
198    RichBlockAnchor, RichBlockAnimation, RichBlockAudio, RichBlockBlockQuotation, RichBlockCaption,
199    RichBlockCollage, RichBlockDetails, RichBlockDivider, RichBlockFooter, RichBlockList,
200    RichBlockListItem, RichBlockMap, RichBlockMathematicalExpression, RichBlockParagraph,
201    RichBlockPhoto, RichBlockPreformatted, RichBlockPullQuotation, RichBlockSectionHeading,
202    RichBlockSlideshow, RichBlockTable, RichBlockTableCell, RichBlockThinking, RichBlockVideo,
203    RichBlockVoiceNote, RichMessage, RichText, RichTextAnchor, RichTextAnchorLink,
204    RichTextBankCardNumber, RichTextBold, RichTextBotCommand, RichTextCashtag, RichTextCode,
205    RichTextCustomEmoji, RichTextDateTime, RichTextEmailAddress, RichTextHashtag, RichTextItalic,
206    RichTextMarked, RichTextMathematicalExpression, RichTextMention, RichTextNode,
207    RichTextPhoneNumber, RichTextReference, RichTextReferenceLink, RichTextSpoiler,
208    RichTextStrikethrough, RichTextSubscript, RichTextSuperscript, RichTextTextMention,
209    RichTextUnderline, RichTextUrl,
210};
211pub use shared::{ChatShared, SharedUser, UsersShared};
212pub use sticker::{
213    InputSticker, MaskPoint, MaskPosition, Sticker, StickerFormat, StickerSet, StickerType,
214};
215pub use story::{
216    InputStoryContent, InputStoryContentPhoto, InputStoryContentVideo, LocationAddress, Story,
217    StoryArea, StoryAreaPosition, StoryAreaType,
218};
219pub use suggested_post::{
220    SuggestedPostApprovalFailed, SuggestedPostApproved, SuggestedPostDeclined, SuggestedPostInfo,
221    SuggestedPostPaid, SuggestedPostParameters, SuggestedPostPrice, SuggestedPostRefunded,
222};
223pub use update::{
224    BusinessBotRights, BusinessConnection, BusinessMessagesDeleted, CallbackQuery, ChatBoost,
225    ChatBoostAdded, ChatBoostRemoved, ChatBoostSource, ChatBoostSourceGiftCode,
226    ChatBoostSourceGiveaway, ChatBoostSourcePremium, ChatBoostUpdated, ChatMemberUpdated,
227    ManagedBotUpdated, MessageReactionCountUpdated, MessageReactionUpdated, PaidMediaPurchased,
228    ReactionCount, Update, UpdateKind, UserChatBoosts,
229};
230pub use user::{
231    BotAccessSettings, BotCommand, BotCommandScope, BotDescription, BotName, BotShortDescription,
232    ChatAdministratorRights, ChatId, User, UserProfileAudios, UserProfilePhotos,
233};
234pub use video_chat::{
235    VideoChatEnded, VideoChatParticipantsInvited, VideoChatScheduled, VideoChatStarted,
236};
237pub use webhook::WebhookInfo;