Template
mirror of
https://github.com/djimboy/djimbo_template_aio3.git
synced 2026-08-26 06:57:44 +00:00
Update
This commit is contained in:
@@ -4,10 +4,11 @@ import time
|
||||
from datetime import datetime
|
||||
from typing import Union
|
||||
|
||||
import pytz
|
||||
from aiogram import Bot, types
|
||||
from aiogram.types import InlineKeyboardButton, KeyboardButton
|
||||
|
||||
from tgbot.data.config import get_admins
|
||||
from tgbot.data.config import get_admins, BOT_TIMEZONE
|
||||
|
||||
|
||||
######################################## AIOGRAM ########################################
|
||||
@@ -120,7 +121,7 @@ def split_messages(get_list: list, count: int) -> list[list]:
|
||||
|
||||
# Получение даты
|
||||
def get_date() -> str:
|
||||
return datetime.today().replace(microsecond=0).strftime("%d.%m.%Y %H:%M:%S")
|
||||
return datetime.now(pytz.timezone(BOT_TIMEZONE)).strftime("%d.%m.%Y %H:%M:%S")
|
||||
|
||||
|
||||
# Получение юникс даты
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# - *- coding: utf- 8 - *-
|
||||
from aiogram.fsm.context import FSMContext
|
||||
|
||||
from tgbot.services.api_session import AsyncSession
|
||||
from tgbot.services.api_session import RequestSession
|
||||
|
||||
FSM = FSMContext
|
||||
AS = AsyncSession
|
||||
AS = RequestSession
|
||||
|
||||
@@ -16,9 +16,11 @@ async def startup_notify(bot: Bot):
|
||||
async def autobackup_admin(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>")
|
||||
await bot.send_document(
|
||||
admin,
|
||||
FSInputFile(PATH_DATABASE),
|
||||
caption=f"<b>📦 AUTOBACKUP</b>\n"
|
||||
f"🕰 <code>{get_date()}</code>",
|
||||
)
|
||||
except:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user