From e9a799f68a8803327d2b791f07e07926aa6abd1e Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Sat, 7 Dec 2024 13:59:02 +0200 Subject: [PATCH] Bot API 8.1 (#239) * Bot API 8.1 * fix clippy * non_exhaustive --- src/objects.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/objects.rs b/src/objects.rs index f926fc2..db69e62 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -2252,10 +2252,22 @@ pub struct RevenueWithdrawalStateSucceeded { #[derive(Eq)] pub struct RevenueWithdrawalStateFailed {} +#[apply(apistruct!)] +#[derive(Eq)] +pub struct AffiliateInfo { + pub affiliate_user: Option, + pub affiliate_chat: Option, + pub commission_per_mille: u32, + pub amount: u32, + pub nanostar_amount: Option, +} + #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(tag = "type", rename_all = "snake_case")] +#[non_exhaustive] pub enum TransactionPartner { User(Box), + AffiliateProgram(TransactionPartnerAffiliateProgram), Fragment(TransactionPartnerFragment), TelegramAds(TransactionPartnerTelegramAds), TelegramApi(TransactionPartnerTelegramApi), @@ -2265,6 +2277,7 @@ pub enum TransactionPartner { #[apply(apistruct!)] pub struct TransactionPartnerUser { pub user: User, + pub affiliate: Option, pub invoice_payload: Option, pub subscription_period: Option, pub paid_media: Option>, @@ -2272,6 +2285,13 @@ pub struct TransactionPartnerUser { pub gift: Option, } +#[apply(apistruct!)] +#[derive(Eq)] +pub struct TransactionPartnerAffiliateProgram { + pub sponsor_user: User, + pub commission_per_mille: u32, +} + #[apply(apistruct!)] #[derive(Eq)] pub struct TransactionPartnerFragment { @@ -2296,6 +2316,7 @@ pub struct TransactionPartnerOther {} pub struct StarTransaction { pub id: String, pub amount: u32, + pub nanostar_amount: u32, pub date: u64, pub source: Option, pub receiver: Option,