如何通过电报从我的频道获取所有消息?

时间:2016-04-28 11:22:56

标签: php html telegram

大家好! 我有一个电报频道。我想在我的网站上自动构建窗口。 Widget从电报上的频道获取最后的消息。 喜欢推特小部件。无法找到适当的手册

1 个答案:

答案 0 :(得分:2)

您可以使用:

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

它将返回其中一个:

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;

在您的电报实施中,定期发布updates.getChannelDifference以提取(和缓存)您的新频道消息。

updates.channelDifferenceEmpty返回,表示您已看到频道上的最新消息。

然后,您可以流式传输新消息到您的网站 panel / widget