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