skip to Main Content

I saw on internet that there is some programs that can use Telegram CLI.
I want to choose between them
for Telegram bot API there is much more documents explaining its functionality, but for CLI there isn’t much that explains its features
it seems the only way to know about is to experiment with it.
unfortunately i don’t have a linux distro installed on my pc so experimenting isn’t an option right know.

so I thought to ask from people who already used it
I know about Telegram bot api, its powers and its limitations
here is my questions:

what can I do using Telegram CLI that I can’t do with with bot api, and vice versa?

3

Answers


  1. The Telegram CLI library interacts directly with their MTproto protocol, which means it’s like their desktop/mobile app…but for the console. You can send messages from one phone number to another. This means that when authenticating with the CLI application, you use your real number as if you were logging into the mobile application.

    I wouldn’t suggest using it for bot behavior as you have to write an application that wraps the Telegram CLI and parses the log file as it is displayed…since it doesn’t implement all the MTproto methods and the outputs for the log file are custom…it can be quite annoying and different than what you would expect.

    With Telegram CLI you can send a number to another Telegram user without having them initiate the conversation first (since it functions just like a normal Telegram client) where the Bot API requires the user to add the Bot and start interaction before the Bot knows you are there.

    Login or Signup to reply.
  2. Telegram bot API:

    • do not require to register new Telegram account, so you don’t need to have another phone number;
    • bot cannot write to user first, only after user sends a first message to bot;
    • already has the commands interface (/command);
    • can do stuff by simple HTTP POST (by sending request via cURL, for example). So you can hook to this tons of stuff (notifications about new articles at the website or so);
    • you can rather easily create lots of them;
    • you can write you own implementation in almost any programming language;
    • you have a list of bots you have created (thanks to @BotFather). If you have lost somehow control of your bot – just revoke the token via @BotFather and it’s yours again;
    • pretty simple to use.

    Telegram client application (in this case – CLI):

    • requires new Telegram account registration with phone number;
    • acts like any other actual Telegram user (can write to other users first, without invitation). Well, that’s a good thing;
    • not really good cross-platform abilities for now (some lack of CLI-realisations);
    • not really easy to install and use;
    • you have to implement the commands handling part;
    • if you have lost your phone number – pretty much you lose this account, because it’s not like you would make some precautions for CLI client account. So you will have to register a new one and repeat the setting procedure for client.

    In conclusion, bots actually got rid of CLI clients, in my opinion. I had CLI account right to the moment the bots appeared. After that I deleted it and created a bot. And not just one 🙂

    So, bots are for the “robot” stuff, and real accounts are for the real people.

    Login or Signup to reply.
  3. previous answers are almost correct. Two different interfaces for different purposes:

    1. Telegram Bot API allows to develop a Telegram Bot.

    2. Telegram CLI (as this one, as an implementation example: https://github.com/vysheng/tg) are telegram client implementations, running from command line, based on MTproto protocol, as Chris Brand said.

    As a bot developer, I’m interested to have a TG CLI interface (2) to automatize dialogs tests, with bash scripts, with a bot made with (1).

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