当我通过漫游器收到历史聊天消息时,在返回message_context中看不到“ hello”消息(“此漫游器能做什么?”)。我怎么能得到它?
message_context = client.send_message(bot_name, '/start')
for message in client.iter_messages(bot_name):
print("{}".format(bot_name))
答案 0 :(得分:3)
您需要使用GetFullUserRequest
来获取bot_info
实例的UserFull
属性:
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.users.GetFullUserRequest(bot_name))
bot_info = result.bot_info
print(bot_info)
print(bot_info.description)