How to obtain all messages from my channel in telegram?

倖福魔咒の 提交于 2019-12-08 03:33:22

问题


Hellow everyone! I have a channel on telegram. And I want to automatically build windows on my site. Widget gets last messages from channel on telegram. Like a twitter widget. Can't to find adequate manual for it


回答1:


You can use:

updates.getChannelDifference#bb32d7c0 channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;

It will return one of these:

updates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;
updates.channelDifferenceTooLong#5e167646 flags:# final:flags.0?true pts:int timeout:flags.1?int top_message:int top_important_message:int read_inbox_max_id:int unread_count:int unread_important_count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
updates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;

In your Telegram Implementation, issues updates.getChannelDifference periodically to pull (and cache) your new channel messages.

updates.channelDifferenceEmpty is returned to indicates you have seen the latest messages on your channel.

You can then stream/push new messages to your website panel/widget



来源:https://stackoverflow.com/questions/36913155/how-to-obtain-all-messages-from-my-channel-in-telegram

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!