RuntimeWarning: сопрограмма «main» никогда не была ожидаемой ошибкойPython

Программы на Python
Anonymous
RuntimeWarning: сопрограмма «main» никогда не была ожидаемой ошибкой

Сообщение Anonymous »

Я запускаю этот тестовый код:

Код: Выделить всё

import telethon.sync
from telethon import TelegramClient
from telethon.tl.functions.messages import AddChatUserRequest
from telethon.tl.functions.contacts import ImportContactsRequest

api_id = XXXXXXX
api_hash = 'XXXXXXXXXXXXXXC'

with TelegramClient('anon', api_id, api_hash) as client:
async def main():

client(AddChatUserRequest(-XXXXXXXXXXXXXX, ['username'], fwd_limit=10))
main()
И это дает мне следующее:

Код: Выделить всё

/data/data/ru.iiec.pydroid3/files/temp_iiec_codefile.py:19: RuntimeWarning: coroutine 'main' was never awaited
main()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Что мне сделать, чтобы программа заработала?

Подробнее здесь: https://stackoverflow.com/questions/598 ... ited-error

Вернуться в «Python»