Search code examples
telegramtelegram-botpython-telegram-bot

Automate posting messages to a Telegram channel via API


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?


Solution

  • 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