add sendVenue

This commit is contained in:
nextel 2019-09-12 20:33:28 +03:00
parent 6dda560cc3
commit 278f9690b7
10 changed files with 104 additions and 20 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,2 +1,44 @@
//TODO:need implementation
struct SendVenue<'a> {}
use crate::core::requests::{ChatId, RequestContext};
///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
}

View file

@ -14,6 +14,7 @@ use crate::core::{
/// returned, otherwise True is returned.
#[derive(Debug, Clone, Serialize)]
struct StopMessageLiveLocation<'a> {
#[serde(skip_serializing)]
ctx: RequestContext<'a>,
/// Required if inline_message_id is not specified. Unique identifier for
/// the target chat or username of the target channel (in the format
@ -65,7 +66,7 @@ impl<'a> StopMessageLiveLocation<'a> {
where
T: Into<ChatId>,
{
self.chat_id = chat_id.into();
self.chat_id = Some(chat_id.into());
self
}
@ -89,7 +90,7 @@ impl<'a> StopMessageLiveLocation<'a> {
where
T: Into<InlineKeyboardMarkup>,
{
self.inline_message_id = Some(reply_markup.into());
self.reply_markup = Some(reply_markup.into());
self
}
}

View file

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