init commit
This commit is contained in:
32
simple_draw.py
Normal file
32
simple_draw.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Простой скрипт для проведения розыгрыша
|
||||
"""
|
||||
import asyncio
|
||||
from database import async_session_maker
|
||||
from services import LotteryService
|
||||
|
||||
async def conduct_simple_draw():
|
||||
"""Проводим розыгрыш"""
|
||||
print("🎲 Проведение розыгрыша")
|
||||
print("=" * 30)
|
||||
|
||||
lottery_id = 1 # Первый розыгрыш
|
||||
|
||||
async with async_session_maker() as session:
|
||||
print(f"🎯 Проводим розыгрыш #{lottery_id}")
|
||||
|
||||
try:
|
||||
# Проводим розыгрыш
|
||||
winners = await LotteryService.conduct_draw(session, lottery_id)
|
||||
|
||||
print(f"🎉 Розыгрыш проведен!")
|
||||
print(f"📊 Результат: {winners}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Ошибка: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(conduct_simple_draw())
|
||||
Reference in New Issue
Block a user