pub mod setters;
mod add_sticker_to_set;
mod answer_callback_query;
mod answer_chat_join_request_query;
mod answer_guest_query;
mod answer_inline_query;
mod answer_pre_checkout_query;
mod answer_shipping_query;
mod answer_web_app_query;
mod answer_widget_query;
mod approve_chat_join_request;
mod approve_suggested_post;
mod ban_chat_member;
mod ban_chat_sender_chat;
mod close;
mod close_forum_topic;
mod close_general_forum_topic;
mod convert_gift_to_stars;
mod copy_message;
mod copy_messages;
mod create_chat_invite_link;
mod create_chat_subscription_invite_link;
mod create_forum_topic;
mod create_invoice_link;
mod create_new_sticker_set;
mod decline_chat_join_request;
mod decline_suggested_post;
mod delete_all_message_reactions;
mod delete_business_account_gift;
mod delete_business_messages;
mod delete_chat_photo;
mod delete_chat_sticker_set;
mod delete_ephemeral_message;
mod delete_forum_topic;
mod delete_message;
mod delete_message_reaction;
mod delete_messages;
mod delete_my_commands;
mod delete_sticker_from_set;
mod delete_sticker_set;
mod delete_story;
mod delete_webhook;
mod edit_chat_invite_link;
mod edit_chat_subscription_invite_link;
mod edit_ephemeral_message_caption;
mod edit_ephemeral_message_media;
mod edit_ephemeral_message_reply_markup;
mod edit_ephemeral_message_text;
mod edit_forum_topic;
mod edit_general_forum_topic;
mod edit_message_caption;
mod edit_message_caption_inline;
mod edit_message_checklist;
mod edit_message_live_location;
mod edit_message_live_location_inline;
mod edit_message_media;
mod edit_message_media_inline;
mod edit_message_reply_markup;
mod edit_message_reply_markup_inline;
mod edit_message_text;
mod edit_message_text_inline;
mod edit_message_widget_data;
mod edit_message_widget_data_inline;
mod edit_shared_widget_data;
mod edit_story;
mod edit_user_star_subscription;
mod export_chat_invite_link;
mod forward_message;
mod forward_messages;
mod get_available_gifts;
mod get_business_account_gifts;
mod get_business_account_star_balance;
mod get_business_connection;
mod get_chat;
mod get_chat_administrators;
mod get_chat_gifts;
mod get_chat_member;
mod get_chat_member_count;
mod get_chat_members_count;
mod get_chat_menu_button;
mod get_chat_share_theme_backdrops;
mod get_custom_emoji_stickers;
mod get_file;
mod get_forum_topic_icon_stickers;
mod get_game_high_scores;
mod get_managed_bot_access_settings;
mod get_managed_bot_token;
mod get_me;
mod get_my_commands;
mod get_my_default_administrator_rights;
mod get_my_description;
mod get_my_name;
mod get_my_short_description;
mod get_my_star_balance;
mod get_star_transactions;
mod get_sticker_set;
mod get_unique_gift;
mod get_updates;
mod get_user_chat_boosts;
mod get_user_gifts;
mod get_user_personal_chat_messages;
mod get_user_profile_audios;
mod get_user_profile_photos;
mod get_webhook_info;
mod gift_premium_subscription;
mod hide_general_forum_topic;
mod kick_chat_member;
mod leave_chat;
mod log_out;
mod pin_chat_message;
mod post_story;
mod promote_chat_member;
mod read_business_message;
mod refund_star_payment;
mod remove_business_account_profile_photo;
mod remove_chat_verification;
mod remove_my_profile_photo;
mod remove_user_verification;
mod reopen_forum_topic;
mod reopen_general_forum_topic;
mod replace_managed_bot_token;
mod replace_sticker_in_set;
mod repost_story;
mod restrict_chat_member;
mod revoke_chat_invite_link;
mod save_prepared_inline_message;
mod save_prepared_keyboard_button;
mod send_animation;
mod send_audio;
mod send_chat_action;
mod send_chat_join_request_web_app;
mod send_checklist;
mod send_contact;
mod send_dice;
mod send_document;
mod send_game;
mod send_gift;
mod send_gift_chat;
mod send_invoice;
mod send_live_photo;
mod send_location;
mod send_media_group;
mod send_message;
mod send_message_draft;
mod send_paid_media;
mod send_photo;
mod send_poll;
mod send_rich_message;
mod send_rich_message_draft;
mod send_shared_widget;
mod send_sticker;
mod send_venue;
mod send_video;
mod send_video_note;
mod send_voice;
mod send_widget;
mod set_business_account_bio;
mod set_business_account_gift_settings;
mod set_business_account_name;
mod set_business_account_profile_photo;
mod set_business_account_username;
mod set_chat_administrator_custom_title;
mod set_chat_description;
mod set_chat_member_tag;
mod set_chat_menu_button;
mod set_chat_permissions;
mod set_chat_photo;
mod set_chat_sticker_set;
mod set_chat_title;
mod set_custom_emoji_sticker_set_thumbnail;
mod set_game_score;
mod set_game_score_inline;
mod set_managed_bot_access_settings;
mod set_message_reaction;
mod set_my_commands;
mod set_my_default_administrator_rights;
mod set_my_description;
mod set_my_name;
mod set_my_profile_photo;
mod set_my_settings;
mod set_my_short_description;
mod set_passport_data_errors;
mod set_sticker_emoji_list;
mod set_sticker_keywords;
mod set_sticker_mask_position;
mod set_sticker_position_in_set;
mod set_sticker_set_thumbnail;
mod set_sticker_set_title;
mod set_user_emoji_status;
mod set_webhook;
mod stop_message_live_location;
mod stop_message_live_location_inline;
mod stop_poll;
mod transfer_business_account_stars;
mod transfer_gift;
mod unban_chat_member;
mod unban_chat_sender_chat;
mod unhide_general_forum_topic;
mod unpin_all_chat_messages;
mod unpin_all_forum_topic_messages;
mod unpin_all_general_forum_topic_messages;
mod unpin_chat_message;
mod upgrade_gift;
mod upload_sticker_file;
mod verify_chat;
mod verify_user;
pub use add_sticker_to_set::{AddStickerToSet, AddStickerToSetSetters};
pub use answer_callback_query::{AnswerCallbackQuery, AnswerCallbackQuerySetters};
pub use answer_chat_join_request_query::{
AnswerChatJoinRequestQuery, AnswerChatJoinRequestQuerySetters,
};
pub use answer_guest_query::{AnswerGuestQuery, AnswerGuestQuerySetters};
pub use answer_inline_query::{AnswerInlineQuery, AnswerInlineQuerySetters};
pub use answer_pre_checkout_query::{AnswerPreCheckoutQuery, AnswerPreCheckoutQuerySetters};
pub use answer_shipping_query::{AnswerShippingQuery, AnswerShippingQuerySetters};
pub use answer_web_app_query::{AnswerWebAppQuery, AnswerWebAppQuerySetters};
pub use answer_widget_query::{AnswerWidgetQuery, AnswerWidgetQuerySetters};
pub use approve_chat_join_request::{ApproveChatJoinRequest, ApproveChatJoinRequestSetters};
pub use approve_suggested_post::{ApproveSuggestedPost, ApproveSuggestedPostSetters};
pub use ban_chat_member::{BanChatMember, BanChatMemberSetters};
pub use ban_chat_sender_chat::{BanChatSenderChat, BanChatSenderChatSetters};
pub use close::{Close, CloseSetters};
pub use close_forum_topic::{CloseForumTopic, CloseForumTopicSetters};
pub use close_general_forum_topic::{CloseGeneralForumTopic, CloseGeneralForumTopicSetters};
pub use convert_gift_to_stars::{ConvertGiftToStars, ConvertGiftToStarsSetters};
pub use copy_message::{CopyMessage, CopyMessageSetters};
pub use copy_messages::{CopyMessages, CopyMessagesSetters};
pub use create_chat_invite_link::{CreateChatInviteLink, CreateChatInviteLinkSetters};
pub use create_chat_subscription_invite_link::{
CreateChatSubscriptionInviteLink, CreateChatSubscriptionInviteLinkSetters,
};
pub use create_forum_topic::{CreateForumTopic, CreateForumTopicSetters};
pub use create_invoice_link::{CreateInvoiceLink, CreateInvoiceLinkSetters};
pub use create_new_sticker_set::{CreateNewStickerSet, CreateNewStickerSetSetters};
pub use decline_chat_join_request::{DeclineChatJoinRequest, DeclineChatJoinRequestSetters};
pub use decline_suggested_post::{DeclineSuggestedPost, DeclineSuggestedPostSetters};
pub use delete_all_message_reactions::{
DeleteAllMessageReactions, DeleteAllMessageReactionsSetters,
};
pub use delete_business_account_gift::{
DeleteBusinessAccountGift, DeleteBusinessAccountGiftSetters,
};
pub use delete_business_messages::{DeleteBusinessMessages, DeleteBusinessMessagesSetters};
pub use delete_chat_photo::{DeleteChatPhoto, DeleteChatPhotoSetters};
pub use delete_chat_sticker_set::{DeleteChatStickerSet, DeleteChatStickerSetSetters};
pub use delete_ephemeral_message::{DeleteEphemeralMessage, DeleteEphemeralMessageSetters};
pub use delete_forum_topic::{DeleteForumTopic, DeleteForumTopicSetters};
pub use delete_message::{DeleteMessage, DeleteMessageSetters};
pub use delete_message_reaction::{DeleteMessageReaction, DeleteMessageReactionSetters};
pub use delete_messages::{DeleteMessages, DeleteMessagesSetters};
pub use delete_my_commands::{DeleteMyCommands, DeleteMyCommandsSetters};
pub use delete_sticker_from_set::{DeleteStickerFromSet, DeleteStickerFromSetSetters};
pub use delete_sticker_set::{DeleteStickerSet, DeleteStickerSetSetters};
pub use delete_story::{DeleteStory, DeleteStorySetters};
pub use delete_webhook::{DeleteWebhook, DeleteWebhookSetters};
pub use edit_chat_invite_link::{EditChatInviteLink, EditChatInviteLinkSetters};
pub use edit_chat_subscription_invite_link::{
EditChatSubscriptionInviteLink, EditChatSubscriptionInviteLinkSetters,
};
pub use edit_ephemeral_message_caption::{
EditEphemeralMessageCaption, EditEphemeralMessageCaptionSetters,
};
pub use edit_ephemeral_message_media::{
EditEphemeralMessageMedia, EditEphemeralMessageMediaSetters,
};
pub use edit_ephemeral_message_reply_markup::{
EditEphemeralMessageReplyMarkup, EditEphemeralMessageReplyMarkupSetters,
};
pub use edit_ephemeral_message_text::{EditEphemeralMessageText, EditEphemeralMessageTextSetters};
pub use edit_forum_topic::{EditForumTopic, EditForumTopicSetters};
pub use edit_general_forum_topic::{EditGeneralForumTopic, EditGeneralForumTopicSetters};
pub use edit_message_caption::{EditMessageCaption, EditMessageCaptionSetters};
pub use edit_message_caption_inline::{EditMessageCaptionInline, EditMessageCaptionInlineSetters};
pub use edit_message_checklist::{EditMessageChecklist, EditMessageChecklistSetters};
pub use edit_message_live_location::{EditMessageLiveLocation, EditMessageLiveLocationSetters};
pub use edit_message_live_location_inline::{
EditMessageLiveLocationInline, EditMessageLiveLocationInlineSetters,
};
pub use edit_message_media::{EditMessageMedia, EditMessageMediaSetters};
pub use edit_message_media_inline::{EditMessageMediaInline, EditMessageMediaInlineSetters};
pub use edit_message_reply_markup::{EditMessageReplyMarkup, EditMessageReplyMarkupSetters};
pub use edit_message_reply_markup_inline::{
EditMessageReplyMarkupInline, EditMessageReplyMarkupInlineSetters,
};
pub use edit_message_text::{EditMessageText, EditMessageTextSetters};
pub use edit_message_text_inline::{EditMessageTextInline, EditMessageTextInlineSetters};
pub use edit_message_widget_data::{EditMessageWidgetData, EditMessageWidgetDataSetters};
pub use edit_message_widget_data_inline::{
EditMessageWidgetDataInline, EditMessageWidgetDataInlineSetters,
};
pub use edit_shared_widget_data::{EditSharedWidgetData, EditSharedWidgetDataSetters};
pub use edit_story::{EditStory, EditStorySetters};
pub use edit_user_star_subscription::{EditUserStarSubscription, EditUserStarSubscriptionSetters};
pub use export_chat_invite_link::{ExportChatInviteLink, ExportChatInviteLinkSetters};
pub use forward_message::{ForwardMessage, ForwardMessageSetters};
pub use forward_messages::{ForwardMessages, ForwardMessagesSetters};
pub use get_available_gifts::{GetAvailableGifts, GetAvailableGiftsSetters};
pub use get_business_account_gifts::{GetBusinessAccountGifts, GetBusinessAccountGiftsSetters};
pub use get_business_account_star_balance::{
GetBusinessAccountStarBalance, GetBusinessAccountStarBalanceSetters,
};
pub use get_business_connection::{GetBusinessConnection, GetBusinessConnectionSetters};
pub use get_chat::{GetChat, GetChatSetters};
pub use get_chat_administrators::{GetChatAdministrators, GetChatAdministratorsSetters};
pub use get_chat_gifts::{GetChatGifts, GetChatGiftsSetters};
pub use get_chat_member::{GetChatMember, GetChatMemberSetters};
pub use get_chat_member_count::{GetChatMemberCount, GetChatMemberCountSetters};
pub use get_chat_members_count::{GetChatMembersCount, GetChatMembersCountSetters};
pub use get_chat_menu_button::{GetChatMenuButton, GetChatMenuButtonSetters};
pub use get_chat_share_theme_backdrops::{
GetChatShareThemeBackdrops, GetChatShareThemeBackdropsSetters,
};
pub use get_custom_emoji_stickers::{GetCustomEmojiStickers, GetCustomEmojiStickersSetters};
pub use get_file::{GetFile, GetFileSetters};
pub use get_forum_topic_icon_stickers::{
GetForumTopicIconStickers, GetForumTopicIconStickersSetters,
};
pub use get_game_high_scores::{GetGameHighScores, GetGameHighScoresSetters};
pub use get_managed_bot_access_settings::{
GetManagedBotAccessSettings, GetManagedBotAccessSettingsSetters,
};
pub use get_managed_bot_token::{GetManagedBotToken, GetManagedBotTokenSetters};
pub use get_me::{GetMe, GetMeSetters};
pub use get_my_commands::{GetMyCommands, GetMyCommandsSetters};
pub use get_my_default_administrator_rights::{
GetMyDefaultAdministratorRights, GetMyDefaultAdministratorRightsSetters,
};
pub use get_my_description::{GetMyDescription, GetMyDescriptionSetters};
pub use get_my_name::{GetMyName, GetMyNameSetters};
pub use get_my_short_description::{GetMyShortDescription, GetMyShortDescriptionSetters};
pub use get_my_star_balance::{GetMyStarBalance, GetMyStarBalanceSetters};
pub use get_star_transactions::{GetStarTransactions, GetStarTransactionsSetters};
pub use get_sticker_set::{GetStickerSet, GetStickerSetSetters};
pub use get_unique_gift::{GetUniqueGift, GetUniqueGiftSetters};
pub use get_updates::{GetUpdates, GetUpdatesSetters};
pub use get_user_chat_boosts::{GetUserChatBoosts, GetUserChatBoostsSetters};
pub use get_user_gifts::{GetUserGifts, GetUserGiftsSetters};
pub use get_user_personal_chat_messages::{
GetUserPersonalChatMessages, GetUserPersonalChatMessagesSetters,
};
pub use get_user_profile_audios::{GetUserProfileAudios, GetUserProfileAudiosSetters};
pub use get_user_profile_photos::{GetUserProfilePhotos, GetUserProfilePhotosSetters};
pub use get_webhook_info::{GetWebhookInfo, GetWebhookInfoSetters};
pub use gift_premium_subscription::{GiftPremiumSubscription, GiftPremiumSubscriptionSetters};
pub use hide_general_forum_topic::{HideGeneralForumTopic, HideGeneralForumTopicSetters};
pub use kick_chat_member::{KickChatMember, KickChatMemberSetters};
pub use leave_chat::{LeaveChat, LeaveChatSetters};
pub use log_out::{LogOut, LogOutSetters};
pub use pin_chat_message::{PinChatMessage, PinChatMessageSetters};
pub use post_story::{PostStory, PostStorySetters};
pub use promote_chat_member::{PromoteChatMember, PromoteChatMemberSetters};
pub use read_business_message::{ReadBusinessMessage, ReadBusinessMessageSetters};
pub use refund_star_payment::{RefundStarPayment, RefundStarPaymentSetters};
pub use remove_business_account_profile_photo::{
RemoveBusinessAccountProfilePhoto, RemoveBusinessAccountProfilePhotoSetters,
};
pub use remove_chat_verification::{RemoveChatVerification, RemoveChatVerificationSetters};
pub use remove_my_profile_photo::{RemoveMyProfilePhoto, RemoveMyProfilePhotoSetters};
pub use remove_user_verification::{RemoveUserVerification, RemoveUserVerificationSetters};
pub use reopen_forum_topic::{ReopenForumTopic, ReopenForumTopicSetters};
pub use reopen_general_forum_topic::{ReopenGeneralForumTopic, ReopenGeneralForumTopicSetters};
pub use replace_managed_bot_token::{ReplaceManagedBotToken, ReplaceManagedBotTokenSetters};
pub use replace_sticker_in_set::{ReplaceStickerInSet, ReplaceStickerInSetSetters};
pub use repost_story::{RepostStory, RepostStorySetters};
pub use restrict_chat_member::{RestrictChatMember, RestrictChatMemberSetters};
pub use revoke_chat_invite_link::{RevokeChatInviteLink, RevokeChatInviteLinkSetters};
pub use save_prepared_inline_message::{
SavePreparedInlineMessage, SavePreparedInlineMessageSetters,
};
pub use save_prepared_keyboard_button::{
SavePreparedKeyboardButton, SavePreparedKeyboardButtonSetters,
};
pub use send_animation::{SendAnimation, SendAnimationSetters};
pub use send_audio::{SendAudio, SendAudioSetters};
pub use send_chat_action::{SendChatAction, SendChatActionSetters};
pub use send_chat_join_request_web_app::{
SendChatJoinRequestWebApp, SendChatJoinRequestWebAppSetters,
};
pub use send_checklist::{SendChecklist, SendChecklistSetters};
pub use send_contact::{SendContact, SendContactSetters};
pub use send_dice::{SendDice, SendDiceSetters};
pub use send_document::{SendDocument, SendDocumentSetters};
pub use send_game::{SendGame, SendGameSetters};
pub use send_gift::{SendGift, SendGiftSetters};
pub use send_gift_chat::{SendGiftChat, SendGiftChatSetters};
pub use send_invoice::{SendInvoice, SendInvoiceSetters};
pub use send_live_photo::{SendLivePhoto, SendLivePhotoSetters};
pub use send_location::{SendLocation, SendLocationSetters};
pub use send_media_group::{SendMediaGroup, SendMediaGroupSetters};
pub use send_message::{SendMessage, SendMessageSetters};
pub use send_message_draft::{SendMessageDraft, SendMessageDraftSetters};
pub use send_paid_media::{SendPaidMedia, SendPaidMediaSetters};
pub use send_photo::{SendPhoto, SendPhotoSetters};
pub use send_poll::{SendPoll, SendPollSetters};
pub use send_rich_message::{SendRichMessage, SendRichMessageSetters};
pub use send_rich_message_draft::{SendRichMessageDraft, SendRichMessageDraftSetters};
pub use send_shared_widget::{SendSharedWidget, SendSharedWidgetSetters};
pub use send_sticker::{SendSticker, SendStickerSetters};
pub use send_venue::{SendVenue, SendVenueSetters};
pub use send_video::{SendVideo, SendVideoSetters};
pub use send_video_note::{SendVideoNote, SendVideoNoteSetters};
pub use send_voice::{SendVoice, SendVoiceSetters};
pub use send_widget::{SendWidget, SendWidgetSetters};
pub use set_business_account_bio::{SetBusinessAccountBio, SetBusinessAccountBioSetters};
pub use set_business_account_gift_settings::{
SetBusinessAccountGiftSettings, SetBusinessAccountGiftSettingsSetters,
};
pub use set_business_account_name::{SetBusinessAccountName, SetBusinessAccountNameSetters};
pub use set_business_account_profile_photo::{
SetBusinessAccountProfilePhoto, SetBusinessAccountProfilePhotoSetters,
};
pub use set_business_account_username::{
SetBusinessAccountUsername, SetBusinessAccountUsernameSetters,
};
pub use set_chat_administrator_custom_title::{
SetChatAdministratorCustomTitle, SetChatAdministratorCustomTitleSetters,
};
pub use set_chat_description::{SetChatDescription, SetChatDescriptionSetters};
pub use set_chat_member_tag::{SetChatMemberTag, SetChatMemberTagSetters};
pub use set_chat_menu_button::{SetChatMenuButton, SetChatMenuButtonSetters};
pub use set_chat_permissions::{SetChatPermissions, SetChatPermissionsSetters};
pub use set_chat_photo::{SetChatPhoto, SetChatPhotoSetters};
pub use set_chat_sticker_set::{SetChatStickerSet, SetChatStickerSetSetters};
pub use set_chat_title::{SetChatTitle, SetChatTitleSetters};
pub use set_custom_emoji_sticker_set_thumbnail::{
SetCustomEmojiStickerSetThumbnail, SetCustomEmojiStickerSetThumbnailSetters,
};
pub use set_game_score::{SetGameScore, SetGameScoreSetters};
pub use set_game_score_inline::{SetGameScoreInline, SetGameScoreInlineSetters};
pub use set_managed_bot_access_settings::{
SetManagedBotAccessSettings, SetManagedBotAccessSettingsSetters,
};
pub use set_message_reaction::{SetMessageReaction, SetMessageReactionSetters};
pub use set_my_commands::{SetMyCommands, SetMyCommandsSetters};
pub use set_my_default_administrator_rights::{
SetMyDefaultAdministratorRights, SetMyDefaultAdministratorRightsSetters,
};
pub use set_my_description::{SetMyDescription, SetMyDescriptionSetters};
pub use set_my_name::{SetMyName, SetMyNameSetters};
pub use set_my_profile_photo::{SetMyProfilePhoto, SetMyProfilePhotoSetters};
pub use set_my_settings::{SetMySettings, SetMySettingsSetters};
pub use set_my_short_description::{SetMyShortDescription, SetMyShortDescriptionSetters};
pub use set_passport_data_errors::{SetPassportDataErrors, SetPassportDataErrorsSetters};
pub use set_sticker_emoji_list::{SetStickerEmojiList, SetStickerEmojiListSetters};
pub use set_sticker_keywords::{SetStickerKeywords, SetStickerKeywordsSetters};
pub use set_sticker_mask_position::{SetStickerMaskPosition, SetStickerMaskPositionSetters};
pub use set_sticker_position_in_set::{SetStickerPositionInSet, SetStickerPositionInSetSetters};
pub use set_sticker_set_thumbnail::{SetStickerSetThumbnail, SetStickerSetThumbnailSetters};
pub use set_sticker_set_title::{SetStickerSetTitle, SetStickerSetTitleSetters};
pub use set_user_emoji_status::{SetUserEmojiStatus, SetUserEmojiStatusSetters};
pub use set_webhook::{SetWebhook, SetWebhookSetters};
pub use stop_message_live_location::{StopMessageLiveLocation, StopMessageLiveLocationSetters};
pub use stop_message_live_location_inline::{
StopMessageLiveLocationInline, StopMessageLiveLocationInlineSetters,
};
pub use stop_poll::{StopPoll, StopPollSetters};
pub use transfer_business_account_stars::{
TransferBusinessAccountStars, TransferBusinessAccountStarsSetters,
};
pub use transfer_gift::{TransferGift, TransferGiftSetters};
pub use unban_chat_member::{UnbanChatMember, UnbanChatMemberSetters};
pub use unban_chat_sender_chat::{UnbanChatSenderChat, UnbanChatSenderChatSetters};
pub use unhide_general_forum_topic::{UnhideGeneralForumTopic, UnhideGeneralForumTopicSetters};
pub use unpin_all_chat_messages::{UnpinAllChatMessages, UnpinAllChatMessagesSetters};
pub use unpin_all_forum_topic_messages::{
UnpinAllForumTopicMessages, UnpinAllForumTopicMessagesSetters,
};
pub use unpin_all_general_forum_topic_messages::{
UnpinAllGeneralForumTopicMessages, UnpinAllGeneralForumTopicMessagesSetters,
};
pub use unpin_chat_message::{UnpinChatMessage, UnpinChatMessageSetters};
pub use upgrade_gift::{UpgradeGift, UpgradeGiftSetters};
pub use upload_sticker_file::{UploadStickerFile, UploadStickerFileSetters};
pub use verify_chat::{VerifyChat, VerifyChatSetters};
pub use verify_user::{VerifyUser, VerifyUserSetters};
#[test]
fn codegen_payload_mods_and_reexports() {
use crate::codegen::{
add_hidden_preamble, ensure_file_contents, project_root, reformat, replace_block, schema,
};
let path = project_root().join("src/payloads.rs");
let schema = schema::get();
let mut block = String::new();
schema.methods.iter().for_each(|m| block.push_str(&format!("mod {};\n", m.names.2)));
block.push('\n');
schema.methods.iter().for_each(|m| {
block.push_str(&format!(
"pub use {m}::{{{M}, {M}Setters}};\n",
m = m.names.2,
M = m.names.1
))
});
let contents = reformat(replace_block(
&path,
"payload_modules",
&add_hidden_preamble("codegen_payload_mods_and_reexports", block),
));
ensure_file_contents(&path, &contents);
}
#[test]
fn codegen_setters_reexports() {
use crate::codegen::{
add_hidden_preamble, ensure_file_contents, project_root, reformat, schema,
};
let path = project_root().join("src/payloads/setters.rs");
let schema = schema::get();
let mut contents = String::new();
contents.push_str("#[doc(no_inline)] pub use crate::payloads::{");
schema
.methods
.iter()
.for_each(|m| contents.push_str(&format!("{M}Setters as _,", M = m.names.1)));
contents.push_str("};\n");
let contents = reformat(add_hidden_preamble("codegen_setters_reexports", contents));
ensure_file_contents(&path, &contents);
}
#[cfg(test)]
mod codegen;
#[cfg(test)]
mod rich_message_tests {
use crate::{
payloads::{
setters::*, EditMessageText, EditMessageTextInline, SendRichMessage,
SendRichMessageDraft,
},
types::{ChatId, InputRichMessage, MessageId, Recipient},
};
fn input_rich_message() -> InputRichMessage {
InputRichMessage {
html: Some("<b>hi</b>".to_owned()),
markdown: None,
blocks: None,
media: None,
is_rtl: None,
skip_entity_detection: None,
}
}
#[test]
fn send_rich_message_serialize() {
let payload = SendRichMessage::new(input_rich_message()).chat_id(ChatId(42));
let json = serde_json::to_value(&payload).unwrap();
assert_eq!(json["chat_id"], 42);
assert_eq!(json["rich_message"]["html"], "<b>hi</b>");
}
#[test]
fn send_rich_message_draft_serialize() {
let payload = SendRichMessageDraft::new(ChatId(42), 7, input_rich_message());
let json = serde_json::to_value(&payload).unwrap();
assert_eq!(json["chat_id"], 42);
assert_eq!(json["draft_id"], 7);
assert_eq!(json["rich_message"]["html"], "<b>hi</b>");
}
#[test]
fn edit_message_text_text_only_serialize() {
let payload = EditMessageText::new(Recipient::Id(ChatId(42)), MessageId(1)).text("hello");
let json = serde_json::to_value(&payload).unwrap();
assert_eq!(json["text"], "hello");
assert!(json.get("rich_message").is_none());
}
#[test]
fn edit_message_text_rich_message_only_serialize() {
let payload = EditMessageText::new(Recipient::Id(ChatId(42)), MessageId(1))
.rich_message(input_rich_message());
let json = serde_json::to_value(&payload).unwrap();
assert!(json.get("text").is_none());
assert_eq!(json["rich_message"]["html"], "<b>hi</b>");
}
#[test]
fn edit_message_text_inline_text_only_serialize() {
let payload = EditMessageTextInline::new("inline_id").text("hello");
let json = serde_json::to_value(&payload).unwrap();
assert_eq!(json["text"], "hello");
assert!(json.get("rich_message").is_none());
}
#[test]
fn edit_message_text_inline_rich_message_only_serialize() {
let payload = EditMessageTextInline::new("inline_id").rich_message(input_rich_message());
let json = serde_json::to_value(&payload).unwrap();
assert!(json.get("text").is_none());
assert_eq!(json["rich_message"]["html"], "<b>hi</b>");
}
}
#[cfg(test)]
mod ephemeral_message_tests {
use crate::{
payloads::{
DeleteEphemeralMessage, EditEphemeralMessageCaption, EditEphemeralMessageMedia,
EditEphemeralMessageReplyMarkup, EditEphemeralMessageText, PromoteChatMember,
SendMessageDraft, SendRichMessage, SendRichMessageDraft,
},
prelude::Requester,
requests::{HasPayload, MultipartPayload},
types::{
ChatId, EphemeralMessageParameters, InputFile, InputMedia, InputMediaPhoto,
InputRichMessage, MessageId, Recipient, UserId,
},
Bot,
};
use super::setters::*;
fn input_rich_message() -> InputRichMessage {
InputRichMessage {
html: Some("<b>hi</b>".to_owned()),
markdown: None,
blocks: None,
media: None,
is_rtl: None,
skip_entity_detection: None,
}
}
#[test]
fn ephemeral_payloads_serialize_receiver_user_id() {
let chat_id = Recipient::Id(ChatId(42));
let ephemeral_message_id = MessageId(7);
let text =
EditEphemeralMessageText::new(chat_id.clone(), 99, ephemeral_message_id).text("text");
let caption = EditEphemeralMessageCaption::new(chat_id.clone(), 99, ephemeral_message_id);
let media = EditEphemeralMessageMedia::new(
chat_id.clone(),
99,
ephemeral_message_id,
InputMedia::Photo(InputMediaPhoto::new(InputFile::file_id("photo".into()))),
);
let markup =
EditEphemeralMessageReplyMarkup::new(chat_id.clone(), 99, ephemeral_message_id);
let delete = DeleteEphemeralMessage::new(chat_id, 99, ephemeral_message_id);
for payload in [
serde_json::to_value(text).unwrap(),
serde_json::to_value(caption).unwrap(),
serde_json::to_value(media).unwrap(),
serde_json::to_value(markup).unwrap(),
serde_json::to_value(delete).unwrap(),
] {
assert_eq!(payload["receiver_user_id"], 99);
assert_eq!(payload["ephemeral_message_id"], 7);
}
}
#[test]
fn send_message_uses_ephemeral_message_parameters() {
let request = Bot::new("TEST_TOKEN")
.send_message("hello")
.chat_id(ChatId(42))
.ephemeral_message_parameters(
EphemeralMessageParameters::new(UserId(99)).callback_query_id("callback_id"),
);
assert!(request.payload_ref().ephemeral_message_parameters.is_some());
let json = serde_json::to_value(request.payload_ref()).unwrap();
assert_eq!(json["ephemeral_message_parameters"]["receiver_user_id"], 99);
assert_eq!(json["ephemeral_message_parameters"]["callback_query_id"], "callback_id");
assert!(json.get("receiver_user_id").is_none());
assert!(json.get("callback_query_id").is_none());
}
#[test]
fn ephemeral_callback_reply_omits_chat_and_receiver() {
let request = Bot::new("TEST_TOKEN").send_message("hello").ephemeral_message_parameters(
EphemeralMessageParameters::from_callback_query("callback_id"),
);
let json = serde_json::to_value(request.payload_ref()).unwrap();
assert_eq!(
json,
serde_json::json!({
"text": "hello",
"ephemeral_message_parameters": {"callback_query_id": "callback_id"},
})
);
}
#[test]
fn serializes_10_3_ephemeral_edits_and_permissions() {
let chat_id = Recipient::Id(ChatId(42));
let caption = EditEphemeralMessageCaption::new(chat_id.clone(), 99, MessageId(7))
.show_caption_above_media(true);
let text = EditEphemeralMessageText::new(chat_id.clone(), 99, MessageId(7))
.rich_message(input_rich_message());
let promote = PromoteChatMember::new(chat_id, UserId(99)).can_send_welcome_messages(true);
assert_eq!(serde_json::to_value(caption).unwrap()["show_caption_above_media"], true);
let text = serde_json::to_value(text).unwrap();
assert_eq!(text["rich_message"]["html"], "<b>hi</b>");
assert!(text.get("text").is_none());
assert_eq!(serde_json::to_value(promote).unwrap()["can_send_welcome_messages"], true);
}
#[test]
fn serializes_10_3_draft_and_rich_message_parameters() {
let message_draft = SendMessageDraft::new(ChatId(42), 7).can_stop(true).keep_on_stop(true);
let rich_message = SendRichMessage::new(input_rich_message())
.chat_id(ChatId(42))
.ephemeral_message_parameters(EphemeralMessageParameters::new(UserId(99)));
let rich_draft = SendRichMessageDraft::new(ChatId(42), 7, input_rich_message())
.can_stop(true)
.keep_on_stop(true);
assert_eq!(serde_json::to_value(message_draft).unwrap()["can_stop"], true);
assert_eq!(
serde_json::to_value(rich_message).unwrap()["ephemeral_message_parameters"]
["receiver_user_id"],
99
);
assert_eq!(serde_json::to_value(rich_draft).unwrap()["keep_on_stop"], true);
}
#[test]
fn edit_ephemeral_message_media_is_multipart() {
let payload = EditEphemeralMessageMedia::new(
Recipient::Id(ChatId(42)),
99,
MessageId(7),
InputMedia::Photo(InputMediaPhoto::new(InputFile::memory("media"))),
);
let mut files = Vec::new();
payload.copy_files(&mut |file| files.push(file));
assert_eq!(files.len(), 1);
assert!(serde_json::to_value(payload).unwrap()["media"]["media"]
.as_str()
.unwrap()
.starts_with("attach://"));
}
}