mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +00:00
9f11ccb3ee
- Moved PaymentMethod and other enums from models to enums.py for better organization. - Refactored imports in various files to reflect the new structure. - Created new model files for ads, anonymous numbers, giveaways, marketplace, purchases, and tonapi. - Removed the old models.py file to clean up the codebase. - Updated all relevant imports in the codebase to use the new model locations.
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.enums import PaymentMethod
|
|
from pyfragment.domains.giveaways.models 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)
|