я хочу интегрировать напоминания в боте aiogram 3 используя apscheduler. функция которуя я уже реализовал которая возвращается {"date":"DD.MM.YYYY","time":"HH:MM","text":text}, а на входе только текст. нужно еще запоминать utc пользователя указывая через команду /set_utc и чекер сделай правильности utc. уже реализованное в боте models: from datetime import datetime
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.orm import sessionmaker, relationship, declarative_base
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, BigInteger
import asyncio
DATABASE_URL = "postgresql+asyncpg://postgres:123@localhost/fami"

Base = declarative_base()

class User(Base):
    __tablename__ = 'sdxl_users'
    id = Column(Integer, primary_key=True, index=True)
    firstname = Column(String, nullable=True)
    lastname = Column(String, nullable=True)
    username = Column(String, nullable=True)
    telegram_id = Column(BigInteger, nullable=False)
    date_joined = Column(DateTime, default=datetime.utcnow, nullable=False)

    prompts = relationship("Prompt", back_populates="user")

class Prompt(Base):
    __tablename__ = 'sdxl_prompts'
    id = Column(Integer, primary_key=True, index=True)
    user_id = Column(Integer, ForeignKey('sdxl_users.id'), nullable=False)
    prompt_text = Column(String, nullable=False)

    user = relationship("User", back_populates="prompts")

engine = create_async_engine(DATABASE_URL, echo=False)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine, class_=AsyncSession)

async def init_db():
    async with engine.begin() as conn:
        await conn.run_sync(Base.metadata.create_all)
if __name__ == '__main__':
    asyncio.run(init_db()) database: 
from sqlalchemy.future import select
from sqlalchemy.ext.asyncio import AsyncSession
from ..database.models import User, Prompt
from sqlalchemy import delete
async def add_or_update_user(db: AsyncSession, firstname: str, lastname: str, username: str, telegram_id: int):
    result = await db.execute(select(User).filter(User.telegram_id == telegram_id))
    user = result.scalars().first()

    if user:
        # Обновляем данные существующего пользователя
        user.firstname = firstname
        user.lastname = lastname
        user.username = username
    else:
        # Добавляем нового пользователя
        user = User(firstname=firstname, lastname=lastname, username=username, telegram_id=telegram_id)
        db.add(user)
    await db.commit()
    await db.refresh(user)
    return user
async def get_prompt_by_telegram_id(db: AsyncSession, telegram_id: int):
    result = await db.execute(select(User).filter(User.telegram_id == telegram_id))
    user = result.scalars().first()
    if user:
        result = await db.execute(select(Prompt).filter(Prompt.user_id == user.id))
        return result.scalars().first()
    return None


async def set_prompt(db: AsyncSession, telegram_id: int, prompt_text: str):
    result = await db.execute(select(User).filter(User.telegram_id == telegram_id))
    user = result.scalars().first()

    if user:
        prompt_result = await db.execute(select(Prompt).filter(Prompt.user_id == user.id))
        prompt = prompt_result.scalars().first()

        if prompt:
            prompt.prompt_text = prompt_text
        else:
            prompt = Prompt(user_id=user.id, prompt_text=prompt_text)
            db.add(prompt)

        await db.commit()
        await db.refresh(prompt)
        return prompt

    return None

async def clear_prompts(db: AsyncSession, telegram_id: int):
    result = await db.execute(select(User).filter(User.telegram_id == telegram_id))
    user = result.scalars().first()
    if user:
        await db.execute(delete(Prompt).where(Prompt.user_id == user.id))
        await db.commit()

__main__.py: import asyncio
import logging
import sys

import aiohttp
from aiogram import Bot, Dispatcher
from aiogram.client.default import DefaultBotProperties
from aiogram.utils.chat_action import ChatActionMiddleware

from bot.handlers.ai_chat import chat_router
from bot.handlers.sdxl import sdxl_router
from image_generator import fai, glif
from .database.models import init_db
if sys.platform.startswith('linux'):
    import uvloop

    uvloop.install()

from bot.config import telegram_bot_token, proxy


async def main() -> None:
    logging.basicConfig(level=logging.INFO)

    properties = DefaultBotProperties(
        parse_mode='html',
    )
    bot = Bot(telegram_bot_token, default=properties)
    dispatcher = Dispatcher()

    dispatcher.include_routers(
        sdxl_router,
        chat_router,
    )

    dispatcher.message.middleware(ChatActionMiddleware())

    sd = fai.AiService(proxy)
    glif_service = glif.AiService()

    try:
        await sd.startup()
        await glif_service.startup()

        async def on_startup(dp):
            await init_db()
        await dispatcher.start_polling(
            bot,
            allowed_updates=dispatcher.resolve_used_update_types(),
            generator_session=aiohttp.ClientSession(),
            sd=sd,
            glif_service=glif_service,
            on_startup=on_startup
        )
    finally:
        await sd.shutdown()
        await glif_service.shutdown()


if __name__ == '__main__':
    asyncio.run(main())