Files
Bot-Template/tgbot/utils/misc_functions.py
T
2025-10-10 07:06:23 +03:00

26 lines
773 B
Python

# - *- coding: utf- 8 - *-
from aiogram import Bot
from aiogram.types import FSInputFile
from tgbot.data.config import get_admins, PATH_DATABASE, BOT_STATUS_NOTIFICATION
from tgbot.utils.const_functions import get_date, send_admins
# Notification after run bot (for all admins)
async def startup_notify(bot: Bot):
if len(get_admins()) >= 1 and BOT_STATUS_NOTIFICATION:
await send_admins(bot, "<b>✅ Bot was started</b>")
# Autobackup Database
async def autobackup_admin(bot: Bot):
for admin in get_admins():
try:
await bot.send_document(
admin,
FSInputFile(PATH_DATABASE),
caption=f"<b>📦 #AUTOBACKUP | <code>{get_date()}</code></b>",
)
except:
...