How to get feed of Telegram channel
Asked Answered
R

2

5

I need to show telegram channel posts in a website. but I don't know how to export telegram channel into xml. I need to have both texts and images and also other files and media like mp4 - pdf or other things. Is there any way to do that?

Reisch answered 11/6, 2017 at 8:0 Comment(2)
Hi Mewtei, so you have an answer for your question already? I'm considering implementing something quite similarly, expect that I want to mirror a Telegram Group and not a Channel. But the concept doesn't change from your usecase. Because of this I would be happy to get an update from you.Strouse
@RogerSchaerer Hi Roger, sorry but I haven't had actually looked for it. I think you should use bot (and maybe make it the admin of the group) to get the data of the group and then get the data of the bot via Telegram API. I don't know exactly how to do that because I haven't worked on it. So hope you will realize it. Good luck.Reisch
A
5

In three steps:

  • First you need create a bot with @botfather. Then add bot to channel. (There is no need to make bot admin.)
  • Second use a programming language and write a program that receives message from channel and send it to server.
  • Third you must provide a way in site back-end to receive posts that your program sends.

For second step i suggest you to use python. there are some modules that can deal with bots.i think in your case telepot can be simplest module that do everything you need.

For third step you must add more details about your site back-end. anyway i suggest you to write a Restful API for back-end and send posts to site with python requests module.

Adverbial answered 12/6, 2017 at 11:2 Comment(3)
Does a bot have access to channel content?Joella
@Joella yes.it has. Also it can send post to channel if you make it admin.Adverbial
Not forget to mention that to do this, you should be the admin of channel. It can't be done in other case as far as I know.Cock
J
4

You need to use telegram API to access the content of a channel.

Telegram API is fairly complicated. There are clients in different languages that makes it easier to interact with the API.

I personally worked with Telethon and it's relatively simple to get it work. If you follow the directions on the home page, there is also an interactive client you can play around to get yourself familiar with how it works.

If you are familiar with other languages there are clients for those languages as well. If you prefer any specific language please comment.

Joella answered 11/6, 2017 at 12:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.