async def scheduler():
posting_time = ['10:00',
'18:00']
while True:
if datetime.datetime.now().strftime('%H:%M') in posting_time:
await auto_posting()
await asyncio.sleep(60)
def worker():
asyncio.run((scheduler()))
async def main():
process = Process(target=worker)
process.start()
logging.basicConfig(level=logging.INFO)
await dp.start_polling(bot)
process.join()
if __name__ == '__main__':
asyncio.run(main())