1

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

Adobe
  • 558
  • 5
  • 23

1 Answers1

2

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

Charles Okwuagwu
  • 10,538
  • 16
  • 87
  • 157