Answer the question
In order to leave comments, you need to log in
I can't figure out what the error is: TypeError: on_startup() missing 1 required positional argument: 'message'?
I'm trying to make it so that a message is sent to the chat every day at a certain time.
async def on_startup(_):
print('Бот в онлайне')
asyncio.create_task(scheduler())
@dp.message_handler()
async def choose_your_dinner(message:types.Message):
await message.answer("Доброе утро!")
async def scheduler(message:types.Message):
aioschedule.every().day.at("09:00").do(choose_your_dinner())
while True:
await aioschedule.run_pending()
await asyncio.sleep(1)
executor.start_polling(dp, skip_updates=True, on_startup=on_startup)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question