mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Merge pull request #19 from async-telegram-bot/feature/sendVenue
fix mistakes for stop sent live location and unused live times for temlpates in action directory
This commit is contained in:
commit
b95b1c15aa
11 changed files with 109 additions and 29 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
use crate::core::requests::RequestContext;
|
||||||
|
//TODO:: need implementation
|
||||||
|
|
||||||
//TODO: need implementation
|
#[derive(Debug, Clone, Serialize)]
|
||||||
struct GetFile<'a>{}
|
struct GetFile<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
ctx: RequestContext<'a>,
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
use crate::core::requests::RequestContext;
|
||||||
|
//TODO:: need implementation
|
||||||
|
|
||||||
//TODO: need implementation
|
#[derive(Debug, Clone, Serialize)]
|
||||||
struct GetUserProfilePhotos<'a>{}
|
struct GetUserProfilePhotos<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
ctx: RequestContext<'a>,
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
use crate::core::requests::RequestContext;
|
||||||
|
//TODO:: need implementation
|
||||||
|
|
||||||
//TODO: need implementation
|
#[derive(Debug, Clone, Serialize)]
|
||||||
struct KickChatMember<'a>{}
|
struct KickChatMember<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
ctx: RequestContext<'a>,
|
||||||
|
}
|
||||||
|
|
|
@ -91,19 +91,19 @@ mod tests {
|
||||||
|
|
||||||
pub mod edit_message_live_location;
|
pub mod edit_message_live_location;
|
||||||
pub mod forward_message;
|
pub mod forward_message;
|
||||||
|
pub mod get_file;
|
||||||
pub mod get_me;
|
pub mod get_me;
|
||||||
|
pub mod get_user_profile_photos;
|
||||||
|
pub mod kick_chat_member;
|
||||||
|
pub mod restrict_chat_member;
|
||||||
pub mod send_audio;
|
pub mod send_audio;
|
||||||
|
pub mod send_chat_action;
|
||||||
|
pub mod send_contact;
|
||||||
pub mod send_location;
|
pub mod send_location;
|
||||||
pub mod send_media_group;
|
pub mod send_media_group;
|
||||||
pub mod send_message;
|
pub mod send_message;
|
||||||
pub mod send_photo;
|
pub mod send_photo;
|
||||||
pub mod stop_message_live_location;
|
|
||||||
pub mod send_venue;
|
|
||||||
pub mod send_contact;
|
|
||||||
pub mod send_poll;
|
pub mod send_poll;
|
||||||
pub mod send_chat_action;
|
pub mod send_venue;
|
||||||
pub mod get_user_profile_photos;
|
pub mod stop_message_live_location;
|
||||||
pub mod get_file;
|
|
||||||
pub mod kick_chat_member;
|
|
||||||
pub mod unban_chat_member;
|
pub mod unban_chat_member;
|
||||||
pub mod restrict_chat_member;
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
use crate::core::requests::RequestContext;
|
||||||
|
//TODO:: need implementation
|
||||||
|
|
||||||
//TODO: need implementation
|
#[derive(Debug, Clone, Serialize)]
|
||||||
struct RestrictChatMember<'a>{}
|
struct RestrictChatMember<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
ctx: RequestContext<'a>,
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
use crate::core::requests::RequestContext;
|
||||||
|
//TODO:: need implementation
|
||||||
|
|
||||||
//TODO: need implementation
|
#[derive(Debug, Clone, Serialize)]
|
||||||
struct SendChatAction<'a>{}
|
struct SendChatAction<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
ctx: RequestContext<'a>,
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
use crate::core::requests::RequestContext;
|
||||||
//TODO: need implementation
|
//TODO:: need implementation
|
||||||
struct SendContact<'a>{}
|
#[derive(Debug, Clone, Serialize)]
|
||||||
|
struct SendContact<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
ctx: RequestContext<'a>,
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
use crate::core::requests::RequestContext;
|
||||||
|
//TODO:: need implementation
|
||||||
|
|
||||||
//TODO: need implementation
|
#[derive(Debug, Clone, Serialize)]
|
||||||
struct SendPoll<'a>{}
|
struct SendPoll<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
ctx: RequestContext<'a>,
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,43 @@
|
||||||
|
use crate::core::requests::{ChatId, RequestContext};
|
||||||
|
|
||||||
//TODO:need implementation
|
//TODO:: need implementation
|
||||||
struct SendVenue<'a>{}
|
///Use this method to send information about a venue. On success, the sent
|
||||||
|
/// Message is returned.
|
||||||
|
#[derive(Debug, Clone, Serialize)]
|
||||||
|
struct SendVenue<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
ctx: RequestContext<'a>,
|
||||||
|
/// Integer or String Yes Unique identifier for the target chat or
|
||||||
|
/// username of the target channel (in the format @channelusername)
|
||||||
|
chat_id: ChatId,
|
||||||
|
/// Float number Yes Latitude of the venue
|
||||||
|
latitude: f64,
|
||||||
|
///Float number Yes Longitude of the venue
|
||||||
|
longitude: f64,
|
||||||
|
/// Yes Name of the venue
|
||||||
|
title: String,
|
||||||
|
///String Yes Address of the venue
|
||||||
|
address: String,
|
||||||
|
/// String Optional Foursquare identifier of the venue
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
foursquare_id: Option<String>,
|
||||||
|
/// String Optional Foursquare type of the venue, if known. (For
|
||||||
|
/// example, “arts_entertainment/default”, “arts_entertainment/aquarium” or
|
||||||
|
/// “food/icecream”.)
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
foursquare_type: Option<String>,
|
||||||
|
/// Boolean Optional Sends the message silently. Users will receive a
|
||||||
|
/// notification with no sound.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
disable_notification: Option<bool>,
|
||||||
|
/// Integer Optional If the message is a reply, ID of the original
|
||||||
|
/// message
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
reply_to_message_id: Option<i32>,
|
||||||
|
/// InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or
|
||||||
|
/// ForceReply Optional Additional interface options. A JSON-serialized
|
||||||
|
/// object for an inline keyboard, custom reply keyboard, instructions to
|
||||||
|
/// remove reply keyboard or to force a reply from the user.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
reply_markup: Option<()>, //TODO: need concrete type
|
||||||
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ use crate::core::{
|
||||||
/// returned, otherwise True is returned.
|
/// returned, otherwise True is returned.
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
struct StopMessageLiveLocation<'a> {
|
struct StopMessageLiveLocation<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
ctx: RequestContext<'a>,
|
ctx: RequestContext<'a>,
|
||||||
/// Required if inline_message_id is not specified. Unique identifier for
|
/// Required if inline_message_id is not specified. Unique identifier for
|
||||||
/// the target chat or username of the target channel (in the format
|
/// the target chat or username of the target channel (in the format
|
||||||
|
@ -65,7 +66,7 @@ impl<'a> StopMessageLiveLocation<'a> {
|
||||||
where
|
where
|
||||||
T: Into<ChatId>,
|
T: Into<ChatId>,
|
||||||
{
|
{
|
||||||
self.chat_id = chat_id.into();
|
self.chat_id = Some(chat_id.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@ impl<'a> StopMessageLiveLocation<'a> {
|
||||||
where
|
where
|
||||||
T: Into<InlineKeyboardMarkup>,
|
T: Into<InlineKeyboardMarkup>,
|
||||||
{
|
{
|
||||||
self.inline_message_id = Some(reply_markup.into());
|
self.reply_markup = Some(reply_markup.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
use crate::core::requests::RequestContext;
|
||||||
|
//TODO:: need implementation
|
||||||
|
|
||||||
//TODO: need implementation
|
#[derive(Debug, Clone, Serialize)]
|
||||||
struct UnbanChatMember<'a>{}
|
struct UnbanChatMember<'a> {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
ctx: RequestContext<'a>,
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue