Skip to content

Commit

Permalink
send_backup_database
Browse files Browse the repository at this point in the history
  • Loading branch information
salko-ua committed Jan 3, 2024
1 parent c975dbc commit 3a9d111
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion handlers/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio

from aiogram import Bot, F, Router
from aiogram import types, F, Router
from aiogram.filters import Command
from aiogram.filters.state import State, StatesGroup
from aiogram.fsm.context import FSMContext
Expand All @@ -22,6 +22,15 @@ class SendNews(StatesGroup):
send_news_premium = State()


@router.message(F.text == "db")
async def send_file_db(message: Message):
if not (message.from_user.id in ADMINS):
return

file_path = types.FSInputFile("data/database.db")
await bot.send_document(message.from_user.id, file_path)


@router.message(Command("admin"))
async def admin(message: Message):
if message.from_user.id in ADMINS:
Expand Down

0 comments on commit 3a9d111

Please sign in to comment.