mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +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])
|
- `message_thread_id` method parameters now use `ThreadId` instead of `i32` ([#887][pr887])
|
||||||
- `DiceEmoji` variant order ([#887][pr887])
|
- `DiceEmoji` variant order ([#887][pr887])
|
||||||
- `Dice::value` now use `u8`, instead of `i32` ([#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
|
[pr852]: https://github.com/teloxide/teloxide/pull/853
|
||||||
[pr859]: https://github.com/teloxide/teloxide/pull/859
|
[pr859]: https://github.com/teloxide/teloxide/pull/859
|
||||||
|
|
|
@ -25,5 +25,5 @@ pub struct Invoice {
|
||||||
/// majority of currencies).
|
/// majority of currencies).
|
||||||
///
|
///
|
||||||
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
/// [`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
|
/// [currency]: https://core.telegram.org/bots/payments#supported-currencies
|
||||||
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
||||||
pub amount: i32,
|
pub amount: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LabeledPrice {
|
impl LabeledPrice {
|
||||||
pub fn new<S>(label: S, amount: i32) -> Self
|
pub fn new<S>(label: S, amount: u32) -> Self
|
||||||
where
|
where
|
||||||
S: Into<String>,
|
S: Into<String>,
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ impl LabeledPrice {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn amount(mut self, val: i32) -> Self {
|
pub fn amount(mut self, val: u32) -> Self {
|
||||||
self.amount = val;
|
self.amount = val;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub struct PreCheckoutQuery {
|
||||||
/// majority of currencies).
|
/// majority of currencies).
|
||||||
///
|
///
|
||||||
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
||||||
pub total_amount: i32,
|
pub total_amount: u32,
|
||||||
|
|
||||||
/// Bot specified invoice payload.
|
/// Bot specified invoice payload.
|
||||||
pub invoice_payload: String,
|
pub invoice_payload: String,
|
||||||
|
|
|
@ -20,7 +20,7 @@ pub struct SuccessfulPayment {
|
||||||
/// the majority of currencies).
|
/// the majority of currencies).
|
||||||
///
|
///
|
||||||
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
/// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
|
||||||
pub total_amount: i32,
|
pub total_amount: u32,
|
||||||
|
|
||||||
/// Bot specified invoice payload.
|
/// Bot specified invoice payload.
|
||||||
pub invoice_payload: String,
|
pub invoice_payload: String,
|
||||||
|
|
Loading…
Add table
Reference in a new issue