• Что нужно поправить в коде на Python, который удаляет последний пост в Телеграм канале?

    @neekerman Автор вопроса
    D:\pyMap\venv\Scripts\python.exe "D:\pyMap\main 5.py"
    Traceback (most recent call last):
    File "D:\pyMap\main 5.py", line 29, in
    asyncio.run(main())
    File "C:\Users\777\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
    ^^^^^^^^^^^^^^^^
    File "C:\Users\777\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\777\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
    return future.result()
    ^^^^^^^^^^^^^^^
    File "D:\pyMap\main 5.py", line 15, in main
    messages = await bot.get_chat(chat_id).fetch_all()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'coroutine' object has no attribute 'fetch_all'
    sys:1: RuntimeWarning: coroutine 'Bot.get_chat' was never awaited

    Process finished with exit code 1
    Написано