Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a Telegram bot about or description using telethon

When I get the history chat message with a bot I can't see the "hello" message ("What can this bot do?") in the return message_context. How can I get it?

message_context = client.send_message(bot_name, '/start')
for message in client.iter_messages(bot_name):
   print("{}".format(bot_name))
like image 863
3pun0x Avatar asked Nov 18 '25 14:11

3pun0x


1 Answers

You need to use GetFullUserRequest to fetch the bot_info attribute of the UserFull instance:

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)
like image 106
Lonami Avatar answered Nov 21 '25 03:11

Lonami



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!