使用 Telegram TL 获取频道列表 [英] Get list of channels with Telegram TL

查看:155
本文介绍了使用 Telegram TL 获取频道列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用户已加入的所有频道的列表.我找到了以下功能:

I need a list of all channels that user has already joined. I found the below function:

channels.getChannels#0a7f6bbb id:Vector<InputChannel> = messages.Chats

但我无法理解id: Vector".如果是频道ID,是不是只返回单个频道的信息?!另一方面,它的返回类型是messages.Chats".我真的不明白.

But I couldn't understand "id: Vector<InputChannel>". If it's ID of a channel, is that mean it only return information of a single channel?! On the other hand, its return type is "messages.Chats". I really don't get it.

推荐答案

使用 messages.Dialogs 我们将拥有所有对话框(组、频道和用户):

With messages.Dialogs we will have all dialog (Groups, Channel, and Users):

messages.getDialogs#191ba9c5 exclude_pinned:true offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs;

这将返回 messages.dialogsSlice 对象:

This will return messages.dialogsSlice object:

messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;

这里的聊天"是一个包含群组和频道的列表(向量).

Here "chats" is a list (vector) that contain groups and channels.

这篇关于使用 Telegram TL 获取频道列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆