I'm willing to send some messages using telethon based on time, my approach was to write a function and start it in a new thread and check what messages I have to send each second. i.e. something like below:
async def function():
while True:
time = datetime.datetime.now()
await send_some_messages(time)
but telethon needs me to await on the same loop as it is running. I know that I can get the current loop with client.run_until_disconnected(), but I'm confused how can I do this.
It'd be great if you could give me an approach to run this function in a different thread, but still be able to send messages using the telethon client.