Skip to content

Commit

Permalink
Bot API 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed Dec 6, 2024
1 parent cbb2e22 commit 7c56862
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2252,10 +2252,20 @@ pub struct RevenueWithdrawalStateSucceeded {
#[derive(Eq)]
pub struct RevenueWithdrawalStateFailed {}

#[apply(apistruct!)]
pub struct AffiliateInfo {
pub affiliate_user: Option<User>,
pub affiliate_chat: Option<Chat>,
pub commission_per_mille: u32,
pub amount: u32,
pub nanostar_amount: Option<u32>,
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum TransactionPartner {
User(Box<TransactionPartnerUser>),
AffiliateProgram(TransactionPartnerAffiliateProgram),
Fragment(TransactionPartnerFragment),
TelegramAds(TransactionPartnerTelegramAds),
TelegramApi(TransactionPartnerTelegramApi),
Expand All @@ -2265,13 +2275,20 @@ pub enum TransactionPartner {
#[apply(apistruct!)]
pub struct TransactionPartnerUser {
pub user: User,
pub affiliate: Option<AffiliateInfo>,
pub invoice_payload: Option<String>,
pub subscription_period: Option<u32>,
pub paid_media: Option<Vec<PaidMedia>>,
pub paid_media_payload: Option<String>,
pub gift: Option<Gift>,
}

#[apply(apistruct!)]
pub struct TransactionPartnerAffiliateProgram {
pub sponsor_user: User,
pub commission_per_mille: u32,
}

#[apply(apistruct!)]
#[derive(Eq)]
pub struct TransactionPartnerFragment {
Expand All @@ -2296,6 +2313,7 @@ pub struct TransactionPartnerOther {}
pub struct StarTransaction {
pub id: String,
pub amount: u32,
pub nanostar_amount: u32,
pub date: u64,
pub source: Option<TransactionPartner>,
pub receiver: Option<TransactionPartner>,
Expand Down

0 comments on commit 7c56862

Please sign in to comment.