async def test_123(message: types.Message):
await message.answer("test")
scheduler = AsyncIOScheduler(timezone="Europe/Moscow")
scheduler.add_job(test_123, trigger='interval', seconds=5,
kwargs={"message": types.Message})
from handlers.admin_private import admin_router, bd_scheduler, test_123
from aiogram.dispatcher import Dispatcher
from aiogram import Bot, types, Dispatcher
today = datetime.date.today().strftime('%d-%m')
from sqlalchemy.future import select
у меня from sqlalchemy import delete, select
async def main():
dp = Dispatcher()
dp.include_router(user_private_router)
dp.include_router(user_group_router)
dp.include_router(admin_router)
dp.startup.register(on_startup)
dp.shutdown.register(on_shutdown)
scheduler = AsyncIOScheduler(timezone="Europe/Moscow")
scheduler.add_job(bd_scheduler, trigger='interval', seconds=5,
kwargs={"message": types.Message, 'session': AsyncSession})
# scheduler.add_job(bd_sheduler, trigger='cron', hour=12, minute=52, start_date=datetime.datetime.now(),
# kwargs={'message': types.Message, 'session': AsyncSession})
scheduler.start()
dp.update.middleware(DataBaseSession(session_pool=session_maker))
await bot.delete_webhook(drop_pending_updates=True)
# await bot.delete_my_commands(scope=types.BotCommandScopeAllPrivateChats())
# await bot.set_my_commands(commands=private, scope=types.BotCommandScopeAllPrivateChats())
await dp.start_polling(bot, allowed_updates=dp.resolve_used_update_types())
изменил на
Может быть я неправильно kwargs записываю у себя, что он ругается?