skip to Main Content

I am new to the Telegram API.
I would like to automate posting messages to my public telegram channel.
I read a few posts that with bots I can achieve this, but I am not sure if that’s the best way and whether the API has an option to directly post to a channel.

I would like to get some start points on how to achieve this?
Which API should I use?
Whether I need a dev account or bot, etc?

3

Answers


  1. Chosen as BEST ANSWER

    After 1 year of working with telegram API, I wanted to update this answer for best possible ways to interact with telegram API.

    For posting to channels, both telegram API and telegram bot API can post to channels.

    I worked directly with both the APIs, but I found the following clients for telegram API and bot API to be faster and easier to interact with telegram.

    Telegram API client:

    https://github.com/LonamiWebs/Telethon

    Telegram bot API:

    https://github.com/python-telegram-bot/python-telegram-bot


  2. You can use bots to send message to channels. But there is some limitation, like size of files.

    1. create your bot, by sending message to @botfather
    2. add the bot to your channel. stackoverflow
    3. write a code to send message to your channel. bot api
    Login or Signup to reply.
  3. It is impossible to read messages from Telegram channels using Telegram Bot API.

    In order to be able to scrape messages from Telegram channels that you do not own, you need to develop you own Telegram client that is capable of:

    1. Joining your desired channels by links
    2. Forwarding messages, arriving to the channels your client is subscribed to, to your own Telegram channel

    In order to develop your own Telegram client, you need to use some implementation of MTProto.

    You can find a lot of implementations of MTProto on https://github.com using mtproto keyword.

    A few examples of well-documented implementations:


    But probably it would be an overkill to develop your own solution to this problem if the only thing you want is to have several redirections from existing Telegram channels to your own channel.

    There are applications that provide such a service.

    For example, there is MultiFeed Bot from telespace.me team:

    It allows you to setup forwarding of messages within Telegram as well as redirections to external services.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search