我如何在Telethon图书馆获得讨论频道?

问题描述

某些频道有聊天链接,以供讨论。我想得到他们。

discussion chat button

我在图书馆文档中搜索了“ discuss”一词,但没有找到任何信息。
我希望能够使用GetFullChannelRequest函数获取此信息。
它对@mudak有效,但对@dvachannel不起作用。

ChatFull(full_chat=ChannelFull(
id=1006147755,"about=""mdk.is \nThe greatest community in Europe? ...",...
"folder_id=None",linked_chat_id=1067543874,"location=None",...
"chats="[
    Channel(id=1006147755,"title=""MDK",...
    "participants_count=None)",Channel(id=1067543874,"title=""MDK CHAT",...
    "participants_count=None)"
],"users="[
   
])

对于@dvachannel,没有linked_chat_id,而chats仅包含一次聊天:

ChatFull(full_chat=ChannelFull(
id=1003073997,"about=""Бред\n\nЛегитимный Абу - @abuwtf\nРазбаны - @Manhattan666 ...","linked_chat_id=None",...
"chats="[
   Channel(id=1003073997,"title=""Двач",...
   "participants_count=None)"
],"users="[
   ...
])

解决方法

我已经解决了我的问题。
我错误地使用了GetFullChannelRequest-我给了它实体而不是频道用户名。

使用不正确:

chat_entity = await client.get_entity(1003073997)
result = await client(GetFullChannelRequest(channel=chat_entity))
print(result.stringify())

正确使用:

result = await client(GetFullChannelRequest(channel='dvachannel'))
print(result.stringify())