Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot API 8.0 #234

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/api_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,12 +1277,14 @@ pub struct SendInvoiceParams {
#[apply(apistruct!)]
#[derive(Eq)]
pub struct CreateInvoiceLinkParams {
pub business_connection_id: Option<String>,
pub title: String,
pub description: String,
pub payload: String,
pub provider_token: Option<String>,
pub currency: String,
pub prices: Vec<LabeledPrice>,
pub subscription_period: Option<u32>,
pub max_tip_amount: Option<u32>,
pub suggested_tip_amounts: Option<Vec<u32>>,
pub provider_data: Option<String>,
Expand Down Expand Up @@ -1331,6 +1333,14 @@ pub struct RefundStarPaymentParams {
pub telegram_payment_charge_id: String,
}

#[apply(apistruct!)]
#[derive(Eq)]
pub struct EditUserStarSubscriptionParams {
pub user_id: u64,
pub telegram_payment_charge_id: String,
pub is_canceled: bool,
}

#[apply(apistruct!)]
#[derive(Eq)]
pub struct SetPassportDataErrorsParams {
Expand Down
4 changes: 4 additions & 0 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,9 @@ pub struct SuccessfulPayment {
pub currency: String,
pub total_amount: u32,
pub invoice_payload: String,
pub subscription_expiration_date: Option<u64>,
pub is_recurring: Option<bool>,
pub is_first_recurring: Option<bool>,
pub shipping_option_id: Option<String>,
pub order_info: Option<OrderInfo>,
pub telegram_payment_charge_id: String,
Expand Down Expand Up @@ -2243,6 +2246,7 @@ pub enum TransactionPartner {
pub struct TransactionPartnerUser {
pub user: User,
pub invoice_payload: Option<String>,
pub subscription_period: Option<u32>,
pub paid_media: Option<Vec<PaidMedia>>,
}

Expand Down
1 change: 1 addition & 0 deletions src/trait_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ where
request!(answerPreCheckoutQuery, bool);
request!(getStarTransactions, StarTransactions);
request!(refundStarPayment, bool);
request!(editUserStarSubscription, bool);
request!(sendGame, Message);
request!(setGameScore, MessageOrBool);
request!(getGameHighScores, Vec<GameHighScore>);
Expand Down
1 change: 1 addition & 0 deletions src/trait_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ pub trait TelegramApi {
request!(answerPreCheckoutQuery, bool);
request!(getStarTransactions, StarTransactions);
request!(refundStarPayment, bool);
request!(editUserStarSubscription, bool);
request!(sendGame, Message);
request!(setGameScore, MessageOrBool);
request!(getGameHighScores, Vec<GameHighScore>);
Expand Down