mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 14:24:31 +00:00
865 B
865 B
Premium Purchase
Use this method to gift Telegram Premium to a specific user.
Method
await client.purchase_premium(
username: str,
months: int,
show_sender: bool = True,
payment_method: PaymentMethod = "ton",
) -> PremiumResult
Parameters
username: accepts@username,username, orhttps://t.me/usernamemonths: one of3,6,12show_sender: controls sender visibility on recipient sidepayment_method:"ton"or"usdt_ton"
months only supports 3, 6, or 12.
Return
PremiumResult(transaction_id, username, amount)
Typical errors
ConfigurationErrorUserNotFoundErrorWalletErrorVerificationError
Example
result: PremiumResult = await client.purchase_premium("@username", months=6, payment_method="ton")
print(result.transaction_id)