Merge branch 'dev' of github.com:async-telegram-bot/async-telegram-bot into dev

This commit is contained in:
Waffle 2019-09-06 02:26:56 +03:00
commit 88ec897751

View file

@ -5,11 +5,15 @@ use crate::core::network;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
/// Use this method to forward messages of any kind. On success, the sent /// Use this method to forward messages of any kind. On success, the sent
/// [Message]: crate::core::types::message::Message is returned. /// [`Message`] is returned.
struct ForwardMessage<'a> { pub struct ForwardMessage<'a> {
info: RequestContext<'a>, ctx: RequestContext<'a>,
/// Unique identifier for the target chat or username of the target channel
/// (in the format @channelusername)
pub chat_id: ChatId, pub chat_id: ChatId,
/// Unique identifier for the target chat or username of the target channel
/// (in the format @channelusername)
pub from_chat_id: ChatId, pub from_chat_id: ChatId,
/// Message identifier in the chat specified in from_chat_id /// Message identifier in the chat specified in from_chat_id
pub message_id: i64, pub message_id: i64,
@ -34,9 +38,9 @@ impl<'a> Request<'a> for ForwardMessage<'a> {
.build(); .build();
network::request( network::request(
&self.info.client, &self.ctx.client,
&self.info.token, &self.ctx.token,
"ForwardMessage", "forwardMessage",
Some(params), Some(params),
).await ).await
}) })
@ -44,12 +48,12 @@ impl<'a> Request<'a> for ForwardMessage<'a> {
} }
impl<'a> ForwardMessage<'a> { impl<'a> ForwardMessage<'a> {
pub(crate) fn new(info: RequestContext<'a>, pub(crate) fn new(ctx: RequestContext<'a>,
chat_id: ChatId, chat_id: ChatId,
from_chat_id: ChatId, from_chat_id: ChatId,
message_id: i64) -> Self { message_id: i64) -> Self {
Self { Self {
info, ctx,
chat_id, chat_id,
from_chat_id, from_chat_id,
message_id, message_id,