mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Merge pull request #16 from ferristhecrab/dev
change reply_markup to its actual type
This commit is contained in:
commit
4c149ec6e7
5 changed files with 13 additions and 14 deletions
|
@ -1,6 +1,6 @@
|
|||
use serde::Serialize;
|
||||
use crate::core::requests::{RequestContext, ChatId, Request, RequestFuture, ResponseResult};
|
||||
use crate::core::types::Message;
|
||||
use crate::core::types::{Message, ReplyMarkup};
|
||||
use crate::core::network;
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
|
@ -32,7 +32,7 @@ pub struct EditMessageLiveLocation<'a> {
|
|||
longitude: f64,
|
||||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
/// A JSON-serialized object for a new inline keyboard.
|
||||
reply_markup: Option<()> // TODO: add reply_markup
|
||||
reply_markup: Option<ReplyMarkup>
|
||||
}
|
||||
|
||||
impl<'a> Request<'a> for EditMessageLiveLocation<'a> {
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::core::{
|
|||
network,
|
||||
requests::{ChatId, Request, RequestFuture, ResponseResult, RequestContext},
|
||||
requests::form_builder::FormBuilder,
|
||||
types::{InputFile, ParseMode, Message},
|
||||
types::{InputFile, ParseMode, Message, ReplyMarkup},
|
||||
};
|
||||
|
||||
/// Use this method to send audio files, if you want Telegram clients to display
|
||||
|
@ -54,7 +54,7 @@ pub struct SendAudio<'a> {
|
|||
pub disable_notification: Option<bool>,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: Option<i64>,
|
||||
pub reply_markup: Option<()> // TODO: add reply_markup
|
||||
pub reply_markup: Option<ReplyMarkup>,
|
||||
}
|
||||
|
||||
impl<'a> Request<'a> for SendAudio<'a> {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::core::{
|
||||
requests::{RequestContext, ChatId, Request, RequestFuture, ResponseResult},
|
||||
types::Message,
|
||||
types::{Message, ReplyMarkup},
|
||||
network,
|
||||
};
|
||||
|
||||
|
@ -33,7 +33,7 @@ pub struct SendLocation<'a> {
|
|||
/// If the message is a reply, ID of the original message
|
||||
reply_to_message_id: Option<i64>,
|
||||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
reply_markup: Option<()>,
|
||||
reply_markup: Option<ReplyMarkup>,
|
||||
}
|
||||
|
||||
impl<'a> Request<'a> for SendLocation<'a> {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use crate::core::{
|
||||
network,
|
||||
types::Message,
|
||||
types::ParseMode,
|
||||
types::{Message, ParseMode, ReplyMarkup},
|
||||
requests::{
|
||||
form_builder::FormBuilder,
|
||||
ChatId,
|
||||
|
@ -45,7 +44,7 @@ pub struct SendMessage<'a> {
|
|||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
pub reply_to_message_id: Option<i64>,
|
||||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
pub reply_markup: Option<()>, // TODO: ReplyMarkup enum
|
||||
pub reply_markup: Option<ReplyMarkup>,
|
||||
}
|
||||
|
||||
impl<'a> Request<'a> for SendMessage<'a> {
|
||||
|
@ -111,7 +110,7 @@ impl<'a> SendMessage<'a> {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn reply_markup<T: Into<()>>(mut self, val: T) -> Self {
|
||||
pub fn reply_markup<T: Into<ReplyMarkup>>(mut self, val: T) -> Self {
|
||||
self.reply_markup = Some(val.into());
|
||||
self
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::path::Path;
|
|||
|
||||
use crate::core::{
|
||||
network,
|
||||
types::{ParseMode, Message, InputFile},
|
||||
types::{ParseMode, Message, InputFile, ReplyMarkup},
|
||||
requests::{
|
||||
ChatId,
|
||||
Request,
|
||||
|
@ -44,8 +44,7 @@ pub struct SendPhoto<'a> {
|
|||
pub disable_notification: Option<bool>,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: Option<i64>,
|
||||
|
||||
// TODO: add reply_markup
|
||||
pub reply_markup: Option<ReplyMarkup>,
|
||||
}
|
||||
|
||||
impl<'a> Request<'a> for SendPhoto<'a> {
|
||||
|
@ -96,7 +95,8 @@ impl<'a> SendPhoto<'a> {
|
|||
caption: None,
|
||||
parse_mode: None,
|
||||
disable_notification: None,
|
||||
reply_to_message_id: None
|
||||
reply_to_message_id: None,
|
||||
reply_markup: None
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue