fixes, chat handlers
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
@@ -11,25 +11,19 @@ from src.core.registration_services import AccountService, WinnerNotificationSer
|
||||
from src.core.services import LotteryService
|
||||
from src.core.models import User, Winner
|
||||
from src.core.config import ADMIN_IDS
|
||||
from src.core.permissions import admin_only
|
||||
|
||||
|
||||
router = Router()
|
||||
|
||||
|
||||
def is_admin(user_id: int) -> bool:
|
||||
"""Проверка прав администратора"""
|
||||
return user_id in ADMIN_IDS
|
||||
|
||||
|
||||
@router.message(Command("check_unclaimed"))
|
||||
@admin_only
|
||||
async def check_unclaimed_winners(message: Message):
|
||||
"""
|
||||
Проверить неподтвержденные выигрыши (более 24 часов)
|
||||
Формат: /check_unclaimed <lottery_id>
|
||||
"""
|
||||
if not is_admin(message.from_user.id):
|
||||
await message.answer("❌ Недостаточно прав")
|
||||
return
|
||||
|
||||
parts = message.text.split()
|
||||
if len(parts) != 2:
|
||||
@@ -125,14 +119,12 @@ async def check_unclaimed_winners(message: Message):
|
||||
|
||||
|
||||
@router.message(Command("redraw"))
|
||||
@admin_only
|
||||
async def redraw_lottery(message: Message):
|
||||
"""
|
||||
Переиграть розыгрыш для неподтвержденных выигрышей
|
||||
Формат: /redraw <lottery_id>
|
||||
"""
|
||||
if not is_admin(message.from_user.id):
|
||||
await message.answer("❌ Недостаточно прав")
|
||||
return
|
||||
|
||||
parts = message.text.split()
|
||||
if len(parts) != 2:
|
||||
|
||||
Reference in New Issue
Block a user