Merge pull request #30 from async-telegram-bot/fix_request_imports

Fix `request::` imports
This commit is contained in:
Temirkhan Myrzamadi 2019-09-21 05:38:06 +06:00 committed by GitHub
commit e39ba98368
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 32 deletions

View file

@ -1,12 +1,9 @@
use crate::{ use crate::{
bot::Bot, bot::Bot,
requests::{ requests::{
edit_message_live_location::EditMessageLiveLocation, ChatId, EditMessageLiveLocation, ForwardMessage, GetFile, GetMe,
forward_message::ForwardMessage, get_file::GetFile, get_me::GetMe, SendAudio, SendLocation, SendMediaGroup, SendMessage, SendPhoto,
send_audio::SendAudio, send_location::SendLocation, StopMessageLiveLocation,
send_media_group::SendMediaGroup, send_message::SendMessage,
send_photo::SendPhoto,
stop_message_live_location::StopMessageLiveLocation, ChatId,
}, },
types::{InputFile, InputMedia}, types::{InputFile, InputMedia},
}; };

View file

@ -5,7 +5,7 @@ use crate::requests::RequestContext;
///Use this method to get a list of profile pictures for a user. Returns a ///Use this method to get a list of profile pictures for a user. Returns a
/// UserProfilePhotos object. /// UserProfilePhotos object.
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
struct GetUserProfilePhotos<'a> { pub struct GetUserProfilePhotos<'a> {
#[serde(skip_serializing)] #[serde(skip_serializing)]
ctx: RequestContext<'a>, ctx: RequestContext<'a>,
/// Unique identifier of the target user /// Unique identifier of the target user

View file

@ -6,7 +6,7 @@ use crate::requests::RequestContext;
/// bot must be an administrator in the chat for this to work and must have the /// bot must be an administrator in the chat for this to work and must have the
/// appropriate admin rights. Returns True on success. /// appropriate admin rights. Returns True on success.
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
struct KickChatMember<'a> { pub struct KickChatMember<'a> {
#[serde(skip_serializing)] #[serde(skip_serializing)]
ctx: RequestContext<'a>, ctx: RequestContext<'a>,
} }

View file

@ -7,6 +7,22 @@ use std::{future::Future, pin::Pin};
use crate::RequestError; use crate::RequestError;
pub use self::{
answer_pre_checkout_query::AnswerPreCheckoutQuery,
answer_shipping_query::AnswerShippingQuery,
edit_message_live_location::EditMessageLiveLocation,
forward_message::ForwardMessage, get_chat::GetChat, get_file::GetFile,
get_me::GetMe, get_updates::GetUpdates,
get_user_profile_photos::GetUserProfilePhotos,
kick_chat_member::KickChatMember, restrict_chat_member::RestrictChatMember,
send_audio::SendAudio, send_chat_action::SendChatAction,
send_contact::SendContact, send_location::SendLocation,
send_media_group::SendMediaGroup, send_message::SendMessage,
send_photo::SendPhoto, send_poll::SendPoll, send_venue::SendVenue,
stop_message_live_location::StopMessageLiveLocation,
unban_chat_member::UnbanChatMember,
};
pub type ResponseResult<T> = Result<T, RequestError>; pub type ResponseResult<T> = Result<T, RequestError>;
/// Request that can be sent to telegram. /// Request that can be sent to telegram.
@ -63,25 +79,25 @@ mod tests {
} }
} }
pub mod answer_pre_checkout_query; mod answer_pre_checkout_query;
pub mod answer_shipping_query; mod answer_shipping_query;
pub mod edit_message_live_location; mod edit_message_live_location;
pub mod forward_message; mod forward_message;
pub mod get_chat; mod get_chat;
pub mod get_file; mod get_file;
pub mod get_me; mod get_me;
pub mod get_updates; mod get_updates;
pub mod get_user_profile_photos; mod get_user_profile_photos;
pub mod kick_chat_member; mod kick_chat_member;
pub mod restrict_chat_member; mod restrict_chat_member;
pub mod send_audio; mod send_audio;
pub mod send_chat_action; mod send_chat_action;
pub mod send_contact; mod send_contact;
pub mod send_location; mod send_location;
pub mod send_media_group; mod send_media_group;
pub mod send_message; mod send_message;
pub mod send_photo; mod send_photo;
pub mod send_poll; mod send_poll;
pub mod send_venue; mod send_venue;
pub mod stop_message_live_location; mod stop_message_live_location;
pub mod unban_chat_member; mod unban_chat_member;

View file

@ -2,7 +2,7 @@ use crate::requests::RequestContext;
//TODO:: need implementation //TODO:: need implementation
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
struct RestrictChatMember<'a> { pub struct RestrictChatMember<'a> {
#[serde(skip_serializing)] #[serde(skip_serializing)]
ctx: RequestContext<'a>, ctx: RequestContext<'a>,
} }

View file

@ -2,7 +2,7 @@ use crate::requests::RequestContext;
//TODO:: need implementation //TODO:: need implementation
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
struct UnbanChatMember<'a> { pub struct UnbanChatMember<'a> {
#[serde(skip_serializing)] #[serde(skip_serializing)]
ctx: RequestContext<'a>, ctx: RequestContext<'a>,
} }