tommorow and week

This commit is contained in:
2026-03-30 21:23:44 +03:00
parent a6c6f061ce
commit 9a49271a0d
6 changed files with 142 additions and 43 deletions

View File

@@ -48,4 +48,10 @@ async def get_all_users_with_time():
async with aiosqlite.connect(DB_PATH) as db:
db.row_factory = aiosqlite.Row
async with db.execute("SELECT * FROM users WHERE time IS NOT NULL") as cursor:
return await cursor.fetchall()
return await cursor.fetchall()
async def delete_user(user_id: int):
"""Удаляет пользователя из БД (например, если он заблокировал бота)."""
async with aiosqlite.connect(DB_PATH) as db:
await db.execute("DELETE FROM users WHERE user_id = ?", (user_id,))
await db.commit()