This commit is contained in:
djimbo
2022-08-13 09:18:51 +03:00
commit 562d7f1acf
34 changed files with 1236 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# - *- coding: utf- 8 - *-
from aiogram import Bot
from aiogram.types import FSInputFile
from tgbot.config import get_admins, PATH_DATABASE
from tgbot.utils.const_functions import get_date, send_admins
# Выполнение функции после запуска бота (рассылка админам о запуске бота)
async def startup_notify(bot: Bot):
if len(get_admins()) >= 1:
await send_admins(bot, "<b>✅ Бот был запущен</b>")
# Автоматические бэкапы БД
async def autobackup(bot: Bot):
for admin in get_admins():
try:
await bot.send_document(admin,
FSInputFile(PATH_DATABASE),
caption=f"<b>📦 AUTOBACKUP</b>\n"
f"<code>🕰 {get_date()}</code>")
except:
pass