Python 如何使用telethon获取关于或描述的电报机器人
当我通过bot获取历史聊天消息时,我在返回消息上下文中看不到“hello”消息(“这个bot可以做什么?”)。我怎样才能得到它Python 如何使用telethon获取关于或描述的电报机器人,python,telethon,Python,Telethon,当我通过bot获取历史聊天消息时,我在返回消息上下文中看不到“hello”消息(“这个bot可以做什么?”)。我怎样才能得到它 message_context = client.send_message(bot_name, '/start') for message in client.iter_messages(bot_name): print("{}".format(bot_name)) 您需要使用获取实例的属性: from telethon.sync import Telegram
message_context = client.send_message(bot_name, '/start')
for message in client.iter_messages(bot_name):
print("{}".format(bot_name))
您需要使用获取实例的属性:
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)