mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Change payment ammounts from i32
to u32
This commit is contained in:
parent
1b7252382f
commit
70b9510e33
5 changed files with 7 additions and 6 deletions
|
@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- `message_thread_id` method parameters now use `ThreadId` instead of `i32` ([#887][pr887])
|
||||
- `DiceEmoji` variant order ([#887][pr887])
|
||||
- `Dice::value` now use `u8`, instead of `i32` ([#887][pr887])
|
||||
- `Invoice::total_amount`, `LabeledPrice::amount`, `PreCheckoutQuery::total_amount`, `SuccessfulPayment::total_amout` now use `u32`, instead of `i32` ([#887][pr887])
|
||||
|
||||
[pr852]: https://github.com/teloxide/teloxide/pull/853
|
||||
[pr859]: https://github.com/teloxide/teloxide/pull/859
|
||||
|
|
|
@ -25,5 +25,5 @@ pub struct Invoice {
|
|||
/// majority of currencies).
|
||||
///
|
||||
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
||||
pub total_amount: i32,
|
||||
pub total_amount: u32,
|
||||
}
|
||||
|
|
|
@ -16,11 +16,11 @@ pub struct LabeledPrice {
|
|||
///
|
||||
/// [currency]: https://core.telegram.org/bots/payments#supported-currencies
|
||||
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
||||
pub amount: i32,
|
||||
pub amount: u32,
|
||||
}
|
||||
|
||||
impl LabeledPrice {
|
||||
pub fn new<S>(label: S, amount: i32) -> Self
|
||||
pub fn new<S>(label: S, amount: u32) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ impl LabeledPrice {
|
|||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn amount(mut self, val: i32) -> Self {
|
||||
pub fn amount(mut self, val: u32) -> Self {
|
||||
self.amount = val;
|
||||
self
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ pub struct PreCheckoutQuery {
|
|||
/// majority of currencies).
|
||||
///
|
||||
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
||||
pub total_amount: i32,
|
||||
pub total_amount: u32,
|
||||
|
||||
/// Bot specified invoice payload.
|
||||
pub invoice_payload: String,
|
||||
|
|
|
@ -20,7 +20,7 @@ pub struct SuccessfulPayment {
|
|||
/// the majority of currencies).
|
||||
///
|
||||
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
||||
pub total_amount: i32,
|
||||
pub total_amount: u32,
|
||||
|
||||
/// Bot specified invoice payload.
|
||||
pub invoice_payload: String,
|
||||
|
|
Loading…
Reference in a new issue