From f2047d22f8dd7a1ee29e3dcbdacbdf76c9b22c1d Mon Sep 17 00:00:00 2001 From: Desiders Date: Mon, 22 Jan 2024 22:43:55 +0300 Subject: [PATCH] Stop using `i32` in methods --- src/methods/answer_callback_query.rs | 6 +++--- src/methods/answer_inline_query.rs | 6 +++--- src/types/pre_checkout_query.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/methods/answer_callback_query.rs b/src/methods/answer_callback_query.rs index 92b23e3f..baf3c9f4 100644 --- a/src/methods/answer_callback_query.rs +++ b/src/methods/answer_callback_query.rs @@ -25,7 +25,7 @@ pub struct AnswerCallbackQuery { /// Otherwise, you may use links like `t.me/your_bot?start=XXXX` that open your bot with a parameter. pub url: Option, /// The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to `0`. - pub cache_time: Option, + pub cache_time: Option, } impl AnswerCallbackQuery { @@ -73,7 +73,7 @@ impl AnswerCallbackQuery { } #[must_use] - pub fn cache_time(self, val: i32) -> Self { + pub fn cache_time(self, val: i64) -> Self { Self { cache_time: Some(val), ..self @@ -107,7 +107,7 @@ impl AnswerCallbackQuery { } #[must_use] - pub fn cache_time_option(self, val: Option) -> Self { + pub fn cache_time_option(self, val: Option) -> Self { Self { cache_time: val, ..self diff --git a/src/methods/answer_inline_query.rs b/src/methods/answer_inline_query.rs index ce7db035..cc8a2f84 100644 --- a/src/methods/answer_inline_query.rs +++ b/src/methods/answer_inline_query.rs @@ -21,7 +21,7 @@ pub struct AnswerInlineQuery { /// A JSON-serialized array of results for the inline query pub results: Vec, /// The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. - pub cache_time: Option, + pub cache_time: Option, /// Pass `true` if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query pub is_personal: Option, /// Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes. @@ -73,7 +73,7 @@ impl AnswerInlineQuery { } #[must_use] - pub fn cache_time(self, val: i32) -> Self { + pub fn cache_time(self, val: i64) -> Self { Self { cache_time: Some(val), ..self @@ -107,7 +107,7 @@ impl AnswerInlineQuery { impl AnswerInlineQuery { #[must_use] - pub fn cache_time_option(self, val: Option) -> Self { + pub fn cache_time_option(self, val: Option) -> Self { Self { cache_time: val, ..self diff --git a/src/types/pre_checkout_query.rs b/src/types/pre_checkout_query.rs index 99550938..eda98b75 100644 --- a/src/types/pre_checkout_query.rs +++ b/src/types/pre_checkout_query.rs @@ -16,7 +16,7 @@ pub struct PreCheckoutQuery { /// Three-letter ISO 4217 [`currency`](https://core.telegram.org/bots/payments#supported-currencies) code pub currency: Box, /// Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of `US$ 1.45` pass `amount = 145`. See the *exp* parameter in [`currencies.json`](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). - pub total_amount: i32, + pub total_amount: i64, /// Bot specified invoice payload pub invoice_payload: Box, /// Identifier of the shipping option chosen by the user