mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +00:00
8f865f4911
- Updated imports and references from TON to GRAM across multiple modules. - Renamed functions and variables to reflect the change from TON to GRAM. - Adjusted validation checks for top-up and recharge amounts to use GRAM limits. - Modified error messages and exceptions to indicate GRAM instead of TON. - Updated tests to ensure they reflect the new GRAM terminology and functionality. - Introduced new constants for GRAM-related configurations.
32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from pyfragment.domains.base import BaseService
|
|
from pyfragment.domains.giveaways.giveaway import giveaway_premium, giveaway_stars
|
|
from pyfragment.models.enums import PaymentMethod
|
|
from pyfragment.models.giveaways import PremiumGiveawayResult, StarsGiveawayResult
|
|
|
|
if TYPE_CHECKING:
|
|
pass
|
|
|
|
|
|
class GiveawaysService(BaseService):
|
|
async def giveaway_stars(
|
|
self,
|
|
channel: str,
|
|
winners: int,
|
|
amount: int,
|
|
payment_method: PaymentMethod = PaymentMethod.GRAM,
|
|
) -> StarsGiveawayResult:
|
|
return await giveaway_stars(self._client, channel, winners, amount, payment_method=payment_method)
|
|
|
|
async def giveaway_premium(
|
|
self,
|
|
channel: str,
|
|
winners: int,
|
|
months: int = 3,
|
|
payment_method: PaymentMethod = PaymentMethod.GRAM,
|
|
) -> PremiumGiveawayResult:
|
|
return await giveaway_premium(self._client, channel, winners, months, payment_method=payment_method)
|