Skip to content

Commit

Permalink
Stop using i32 in methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Desiders committed Jan 22, 2024
1 parent 3b1c92d commit f2047d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/methods/answer_callback_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
/// 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<i32>,
pub cache_time: Option<i64>,
}

impl AnswerCallbackQuery {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -107,7 +107,7 @@ impl AnswerCallbackQuery {
}

#[must_use]
pub fn cache_time_option(self, val: Option<i32>) -> Self {
pub fn cache_time_option(self, val: Option<i64>) -> Self {
Self {
cache_time: val,
..self
Expand Down
6 changes: 3 additions & 3 deletions src/methods/answer_inline_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct AnswerInlineQuery {
/// A JSON-serialized array of results for the inline query
pub results: Vec<InlineQueryResult>,
/// 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<i32>,
pub cache_time: Option<i64>,
/// 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<bool>,
/// 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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -107,7 +107,7 @@ impl AnswerInlineQuery {

impl AnswerInlineQuery {
#[must_use]
pub fn cache_time_option(self, val: Option<i32>) -> Self {
pub fn cache_time_option(self, val: Option<i64>) -> Self {
Self {
cache_time: val,
..self
Expand Down
2 changes: 1 addition & 1 deletion src/types/pre_checkout_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct PreCheckoutQuery {
/// Three-letter ISO 4217 [`currency`](https://core.telegram.org/bots/payments#supported-currencies) code
pub currency: Box<str>,
/// 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<str>,
/// Identifier of the shipping option chosen by the user
Expand Down

0 comments on commit f2047d2

Please sign in to comment.