Files
FragmentAPI/pyfragment/domains/giveaways/service.py
T
bohd4nx 9f11ccb3ee Refactor pyfragment structure: Move models to domain-specific modules
- 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.
2026-06-16 01:02:28 +03:00

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)