mirror of
https://github.com/djimboy/djimbo_template_aio3.git
synced 2026-07-25 09:44:29 +00:00
26 lines
773 B
Python
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:
|
|
...
|