async def main():
me = await client.get_me()
await client.send_message(####, 'Hello')
with client:
client.loop.run_until_complete(main())
I want to run the code above every 1 minute, how can I achieve this?
Here is one solution using asyncio sleep:
from asyncio import sleep
async def main():
while True:
me = await client.get_me()
await client.send_message(####, 'Hello')
await sleep(60) # sleep for a min
with client:
client.loop.run_until_complete(main())