пытаюсь получить все чаты но у меня постоянно loop task ошибка
Traceback (most recent call last):
File "/root/crystal/main.py", line 30, in <module>
asyncio.run(main())
File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/root/crystal/main.py", line 18, in main
await app.stop()
File "/root/crystal/venv/lib/python3.11/site-packages/pyrogram/methods/utilities/stop.py", line 65, in stop
await do_it()
File "/root/crystal/venv/lib/python3.11/site-packages/pyrogram/methods/utilities/stop.py", line 61, in do_it
await self.terminate()
File "/root/crystal/venv/lib/python3.11/site-packages/pyrogram/methods/auth/terminate.py", line 47, in terminate
await self.dispatcher.stop()
File "/root/crystal/venv/lib/python3.11/site-packages/pyrogram/dispatcher.py", line 162, in stop
await i
RuntimeError: Task <Task pending name='Task-1' coro=<main() running at /root/crystal/main.py:18> cb=[_run_until_complete_cb() at /usr/lib/python3.11/asyncio/base_events.py:180]> got Future <Task pending name='Task-31' coro=<Dispatcher.handler_worker() running at /root/crystal/venv/lib/python3.11/site-packages/pyrogram/dispatcher.py:202>> attached to a different loop
async def main():
app=apps["My_loveroud"]
await app.start()
await app.send_message("KeithEngel", "ddd")
await app.stop()
if __name__ == "__main__":
asyncio.run(main())
как можно ее обойти ? чтобы не было этих ошибок