mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +00:00
961 B
961 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 = PaymentMethod.GRAM,
) -> PremiumResult
Parameters
username: accepts@username,username, orhttps://t.me/usernamemonths: one of3,6,12show_sender: controls sender visibility on recipient sidepayment_method:PaymentMethod.GRAM(default),PaymentMethod.USDT_GRAM, or any otherPaymentMethodvalue
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=PaymentMethod.GRAM)
print(result.transaction_id)