【发布时间】:2020-01-20 15:19:28
【问题描述】:
当我运行这段代码时:
from telethon import TelegramClient
from telethon.tl.functions.messages import AddChatUserRequest
from telethon.tl.types import InputPhoneContact
from telethon.tl.functions.contacts import ImportContactsRequest
client = TelegramClient('session_name',
api_id,
api_hash)
client.start()
contact = InputPhoneContact(client_id=0, phone=guest_phone_number, first_name="custom_first_name", last_name="custom_last_name")
result = client(ImportContactsRequest([contact]))
client(AddChatUserRequest(user_id=result.users[0], fwd_limit=0, chat_id=group_id))
它给了我这个错误:
AttributeError: 'coroutine' object has no attribute 'users'
请帮忙(
【问题讨论】:
-
请包含返回的错误的完整堆栈。
标签: python attributeerror telethon