pub trait TelegramApi {
type Error;
Show methods
fn request_with_form_data<T1: Serialize, T2: DeserializeOwned>(
&self,
method: &str,
params: T1,
files: Vec<(&str, PathBuf)>
) -> Result<T2, Self::Error>;
fn request<T1: Serialize, T2: DeserializeOwned>(
&self,
method: &str,
params: Option<T1>
) -> Result<T2, Self::Error>;
fn get_updates(
&self,
params: &GetUpdatesParams
) -> Result<MethodResponse<Vec<Update>>, Self::Error> { ... }
fn send_message(
&self,
params: &SendMessageParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn set_webhook(
&self,
params: &SetWebhookParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn delete_webhook(
&self,
params: &DeleteWebhookParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn get_webhook_info(
&self
) -> Result<MethodResponse<WebhookInfo>, Self::Error> { ... }
fn get_me(&self) -> Result<MethodResponse<User>, Self::Error> { ... }
fn log_out(&self) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn close(&self) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn forward_message(
&self,
params: &ForwardMessageParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn copy_message(
&self,
params: &CopyMessageParams
) -> Result<MethodResponse<MessageId>, Self::Error> { ... }
fn send_photo(
&self,
params: &SendPhotoParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_audio(
&self,
params: &SendAudioParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_media_group(
&self,
params: &SendMediaGroupParams
) -> Result<MethodResponse<Vec<Message>>, Self::Error> { ... }
fn send_document(
&self,
params: &SendDocumentParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_video(
&self,
params: &SendVideoParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_animation(
&self,
params: &SendAnimationParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_voice(
&self,
params: &SendVoiceParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_video_note(
&self,
params: &SendVideoNoteParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_location(
&self,
params: &SendLocationParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn edit_message_live_location(
&self,
params: &EditMessageLiveLocationParams
) -> Result<EditMessageResponse, Self::Error> { ... }
fn stop_message_live_location(
&self,
params: &StopMessageLiveLocationParams
) -> Result<EditMessageResponse, Self::Error> { ... }
fn send_venue(
&self,
params: &SendVenueParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_contact(
&self,
params: &SendContactParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_poll(
&self,
params: &SendPollParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_dice(
&self,
params: &SendDiceParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn send_chat_action(
&self,
params: &SendChatActionParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn get_user_profile_photos(
&self,
params: &GetUserProfilePhotosParams
) -> Result<MethodResponse<UserProfilePhotos>, Self::Error> { ... }
fn get_file(
&self,
params: &GetFileParams
) -> Result<MethodResponse<FileObject>, Self::Error> { ... }
fn kick_chat_member(
&self,
params: &KickChatMemberParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn unban_chat_member(
&self,
params: &UnbanChatMemberParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn restrict_chat_member(
&self,
params: &RestrictChatMemberParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn promote_chat_member(
&self,
params: &PromoteChatMemberParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn set_chat_administrator_custom_title(
&self,
params: &SetChatAdministratorCustomTitleParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn set_chat_permissions(
&self,
params: &SetChatPermissionsParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn export_chat_invite_link(
&self,
params: &ExportChatInviteLinkParams
) -> Result<MethodResponse<String>, Self::Error> { ... }
fn create_chat_invite_link(
&self,
params: &CreateChatInviteLinkParams
) -> Result<MethodResponse<ChatInviteLink>, Self::Error> { ... }
fn edit_chat_invite_link(
&self,
params: &EditChatInviteLinkParams
) -> Result<MethodResponse<ChatInviteLink>, Self::Error> { ... }
fn revoke_chat_invite_link(
&self,
params: &RevokeChatInviteLinkParams
) -> Result<MethodResponse<ChatInviteLink>, Self::Error> { ... }
fn set_chat_photo(
&self,
params: &SetChatPhotoParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn delete_chat_photo(
&self,
params: &DeleteChatPhotoParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn set_chat_title(
&self,
params: &SetChatTitleParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn set_chat_description(
&self,
params: &SetChatDescriptionParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn pin_chat_message(
&self,
params: &PinChatMessageParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn unpin_chat_message(
&self,
params: &UnpinChatMessageParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn leave_chat(
&self,
params: &LeaveChatParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn get_chat(
&self,
params: &GetChatParams
) -> Result<MethodResponse<Chat>, Self::Error> { ... }
fn get_chat_administrators(
&self,
params: &GetChatAdministratorsParams
) -> Result<MethodResponse<Vec<ChatMember>>, Self::Error> { ... }
fn get_chat_members_count(
&self,
params: &GetChatMembersCountParams
) -> Result<MethodResponse<u32>, Self::Error> { ... }
fn get_chat_member(
&self,
params: &GetChatMemberParams
) -> Result<MethodResponse<ChatMember>, Self::Error> { ... }
fn set_chat_sticker_set(
&self,
params: &SetChatStickerSetParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn delete_chat_sticker_set(
&self,
params: &DeleteChatStickerSetParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn answer_callback_query(
&self,
params: &AnswerCallbackQueryParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn set_my_commands(
&self,
params: &SetMyCommandsParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn get_my_commands(
&self
) -> Result<MethodResponse<Vec<BotCommand>>, Self::Error> { ... }
fn answer_inline_query(
&self,
params: &AnswerInlineQueryParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn edit_message_text(
&self,
params: &EditMessageTextParams
) -> Result<EditMessageResponse, Self::Error> { ... }
fn edit_message_caption(
&self,
params: &EditMessageCaptionParams
) -> Result<EditMessageResponse, Self::Error> { ... }
fn edit_message_media(
&self,
params: &EditMessageMediaParams
) -> Result<EditMessageResponse, Self::Error> { ... }
fn edit_message_reply_markup(
&self,
params: &EditMessageReplyMarkupParams
) -> Result<EditMessageResponse, Self::Error> { ... }
fn stop_poll(
&self,
params: &StopPollParams
) -> Result<MethodResponse<Poll>, Self::Error> { ... }
fn delete_message(
&self,
params: &DeleteMessageParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn send_sticker(
&self,
params: &SendStickerParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn get_sticker_set(
&self,
params: &GetStickerSetParams
) -> Result<MethodResponse<StickerSet>, Self::Error> { ... }
fn upload_sticker_file(
&self,
params: &UploadStickerFileParams
) -> Result<MethodResponse<File>, Self::Error> { ... }
fn create_new_sticker_set(
&self,
params: &CreateNewStickerSetParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn add_sticker_to_set(
&self,
params: &AddStickerToSetParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn set_sticker_position_in_set(
&self,
params: &SetStickerPositionInSetParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn delete_sticker_from_set(
&self,
params: &DeleteStickerFromSetParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn set_sticker_set_thumb(
&self,
params: &SetStickerSetThumbParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn send_invoice(
&self,
params: &SendInvoiceParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn answer_shipping_query(
&self,
params: &AnswerShippingQueryParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn answer_pre_checkout_query(
&self,
params: &AnswerPreCheckoutQueryParams
) -> Result<MethodResponse<bool>, Self::Error> { ... }
fn send_game(
&self,
params: &SendGameParams
) -> Result<MethodResponse<Message>, Self::Error> { ... }
fn set_game_score(
&self,
params: &SetGameScoreParams
) -> Result<EditMessageResponse, Self::Error> { ... }
fn get_game_high_scores(
&self,
params: &GetGameHighScoresParams
) -> Result<MethodResponse<Vec<GameHighScore>>, Self::Error> { ... }
fn request_without_body<T: DeserializeOwned>(
&self,
method: &str
) -> Result<T, Self::Error> { ... }
fn request_with_possible_form_data<T1: Serialize, T2: DeserializeOwned>(
&self,
method_name: &str,
params: &T1,
files: Vec<(&str, PathBuf)>
) -> Result<T2, Self::Error> { ... }
}