Refactor bot handlers and keyboards; implement admin features
- Removed unused prehandling, referrals, support, and states files. - Updated admin and client handlers to improve structure and functionality. - Introduced admin filters and routers for better access control. - Added new billing and deposit functionalities for client interactions. - Enhanced keyboard layouts for admin and client menus. - Implemented promotion handling for admin users. - Updated configuration to include admin settings. - Improved utility functions for quote fetching and menu text building. - Added common handlers for undefined commands and message deletions.
This commit is contained in:
@@ -2,6 +2,7 @@ import datetime
|
||||
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy.sql.functions import count
|
||||
|
||||
from db.models import User
|
||||
from db.models.transactions import BalanceTransaction, BalanceTxType
|
||||
@@ -121,3 +122,9 @@ class UserRepository:
|
||||
|
||||
await session.commit()
|
||||
return user
|
||||
|
||||
async def user_count(self, session: AsyncSession) -> int:
|
||||
stmt = select(count()).select_from(User)
|
||||
res = await session.execute(stmt)
|
||||
|
||||
return int(res.scalar_one_or_none())
|
||||
|
||||
Reference in New Issue
Block a user