Use MessageId for reply_to_message_id for some methods that were forgotten

This commit is contained in:
Maybe Waffle 2023-06-05 17:58:25 +04:00
parent 84683d3a35
commit 9c2330897a
5 changed files with 13 additions and 9 deletions

View file

@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Poll::total_voter_count` and `PollOption::voter_count` now use `u32` instead of `i32` ([#887][pr887]) - `Poll::total_voter_count` and `PollOption::voter_count` now use `u32` instead of `i32` ([#887][pr887])
- `PollAnswer::option_ids` now use `u8` instead of `i32` ([#887][pr887]) - `PollAnswer::option_ids` now use `u8` instead of `i32` ([#887][pr887])
- Use `u32` for sizes and `Seconds` for timespans in `InlineQueryResult*` ([#887][pr887]) - Use `u32` for sizes and `Seconds` for timespans in `InlineQueryResult*` ([#887][pr887])
- `SendGame::reply_to_message_id`, `SendSticker::reply_to_message_id` and `SendInvoice::reply_to_message_id` now use `MessageId` instead of `i32` ([#887][pr887])
[pr852]: https://github.com/teloxide/teloxide/pull/853 [pr852]: https://github.com/teloxide/teloxide/pull/853
[pr859]: https://github.com/teloxide/teloxide/pull/859 [pr859]: https://github.com/teloxide/teloxide/pull/859

View file

@ -3437,7 +3437,7 @@ Schema(
), ),
Param( Param(
name: "reply_to_message_id", name: "reply_to_message_id",
ty: Option(i32), ty: Option(RawTy("MessageId")),
descr: Doc(md: "If the message is a reply, ID of the original message") descr: Doc(md: "If the message is a reply, ID of the original message")
), ),
Param( Param(
@ -3798,7 +3798,7 @@ Schema(
), ),
Param( Param(
name: "reply_to_message_id", name: "reply_to_message_id",
ty: Option(i32), ty: Option(RawTy("MessageId")),
descr: Doc(md: "If the message is a reply, ID of the original message") descr: Doc(md: "If the message is a reply, ID of the original message")
), ),
Param( Param(
@ -4049,7 +4049,7 @@ Schema(
), ),
Param( Param(
name: "reply_to_message_id", name: "reply_to_message_id",
ty: Option(i32), ty: Option(RawTy("MessageId")),
descr: Doc(md: "If the message is a reply, ID of the original message") descr: Doc(md: "If the message is a reply, ID of the original message")
), ),
Param( Param(

View file

@ -2,7 +2,7 @@
use serde::Serialize; use serde::Serialize;
use crate::types::{Message, ReplyMarkup, ThreadId}; use crate::types::{Message, MessageId, ReplyMarkup, ThreadId};
impl_payload! { impl_payload! {
/// Use this method to send a game. On success, the sent [`Message`] is returned. /// Use this method to send a game. On success, the sent [`Message`] is returned.
@ -26,7 +26,8 @@ impl_payload! {
/// Protects the contents of sent messages from forwarding and saving /// Protects the contents of sent messages from forwarding and saving
pub protect_content: bool, pub protect_content: bool,
/// If the message is a reply, ID of the original message /// If the message is a reply, ID of the original message
pub reply_to_message_id: i32, #[serde(serialize_with = "crate::types::serialize_reply_to_message_id")]
pub reply_to_message_id: MessageId,
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found /// Pass _True_, if the message should be sent even if the specified replied-to message is not found
pub allow_sending_without_reply: bool, pub allow_sending_without_reply: bool,
/// A JSON-serialized object for an [inline keyboard]. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. /// A JSON-serialized object for an [inline keyboard]. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.

View file

@ -3,7 +3,7 @@
use serde::Serialize; use serde::Serialize;
use url::Url; use url::Url;
use crate::types::{InlineKeyboardMarkup, LabeledPrice, Message, Recipient, ThreadId}; use crate::types::{InlineKeyboardMarkup, LabeledPrice, Message, MessageId, Recipient, ThreadId};
impl_payload! { impl_payload! {
/// Use this method to send invoices. On success, the sent [`Message`] is returned. /// Use this method to send invoices. On success, the sent [`Message`] is returned.
@ -71,7 +71,8 @@ impl_payload! {
/// Protects the contents of sent messages from forwarding and saving /// Protects the contents of sent messages from forwarding and saving
pub protect_content: bool, pub protect_content: bool,
/// If the message is a reply, ID of the original message /// If the message is a reply, ID of the original message
pub reply_to_message_id: i32, #[serde(serialize_with = "crate::types::serialize_reply_to_message_id")]
pub reply_to_message_id: MessageId,
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found /// Pass _True_, if the message should be sent even if the specified replied-to message is not found
pub allow_sending_without_reply: bool, pub allow_sending_without_reply: bool,
/// A JSON-serialized object for an [inline keyboard]. If empty, one 'Pay `total price`' button will be shown. If not empty, the first button must be a Pay button. /// A JSON-serialized object for an [inline keyboard]. If empty, one 'Pay `total price`' button will be shown. If not empty, the first button must be a Pay button.

View file

@ -2,7 +2,7 @@
use serde::Serialize; use serde::Serialize;
use crate::types::{InputFile, Message, Recipient, ReplyMarkup, ThreadId}; use crate::types::{InputFile, Message, MessageId, Recipient, ReplyMarkup, ThreadId};
impl_payload! { impl_payload! {
@[multipart = sticker] @[multipart = sticker]
@ -29,7 +29,8 @@ impl_payload! {
/// Protects the contents of sent messages from forwarding and saving /// Protects the contents of sent messages from forwarding and saving
pub protect_content: bool, pub protect_content: bool,
/// If the message is a reply, ID of the original message /// If the message is a reply, ID of the original message
pub reply_to_message_id: i32, #[serde(serialize_with = "crate::types::serialize_reply_to_message_id")]
pub reply_to_message_id: MessageId,
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found /// Pass _True_, if the message should be sent even if the specified replied-to message is not found
pub allow_sending_without_reply: bool, pub allow_sending_without_reply: bool,
/// 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. /// 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.