Python 3.x 如何获得电报';电视节目中的s频道描述?

Python 3.x 如何获得电报';电视节目中的s频道描述?,python-3.x,telegram,telethon,Python 3.x,Telegram,Telethon,我正在用Telethon给客户写电报。如何获取频道描述get\u entity方法不提供频道描述。您必须使用带有chat\u id或@username的方法,并且.result。描述是您需要的。有方法 因此,您可能需要检查full_chat属性,因为它包含其余的信息另一个使用bot的示例 from telethon.sync import TelegramClient, events from telethon import functions bot = TelegramClient(

我正在用Telethon给客户写电报。如何获取频道描述
get\u entity
方法不提供频道描述。

您必须使用带有
chat\u id
@username
的方法,并且
.result。描述是您需要的。

有方法


因此,您可能需要检查
full_chat
属性,因为它包含其余的信息

另一个使用bot的示例

from telethon.sync import TelegramClient, events
from telethon import functions

bot = TelegramClient(
    'bot', API_ID, API_HASH).start(bot_token=BOT_TOKEN)

@bot.on(events.NewMessage)
async def my_event_handler(event):
    chat = await event.get_chat()
    result = await bot(functions.messages.GetFullChatRequest(
        chat_id=chat.id
    ))
    print(result.full_chat.about)

bot.run_until_disconnected()

你能加几行代码吗。是
Channel
类的
getChat
方法吗?事实上,我不知道如何在Python中使用它,它是Bot API方法:(
from telethon.sync import TelegramClient, events
from telethon import functions

bot = TelegramClient(
    'bot', API_ID, API_HASH).start(bot_token=BOT_TOKEN)

@bot.on(events.NewMessage)
async def my_event_handler(event):
    chat = await event.get_chat()
    result = await bot(functions.messages.GetFullChatRequest(
        chat_id=chat.id
    ))
    print(result.full_chat.about)

bot.run_until_disconnected()