skip to Main Content

I am subscribed to a private telegram bot, how can I redirect messages to my bot in Java?
somewhere I read that in python there is a teleton class, but how to do it in java.

2

Answers


  1. Telegram used to allow communications between bots, and then decided to revoke it afterwards.

    So I would tell you to subscribe to the bot using your bot and read the updates that way, but that is no longer possible…

    Bots simply don’t catch updates from other bots…

    But… if you really desire this functionality you could build a web scraper that reads your private messages and handles them as you please.

    Or you could contact the creator of the said private bot and ask them to send the data via some other interface, other than telegram.

    See:
    https://core.telegram.org/bots/faq#what-messages-will-my-bot-get

    Why doesn’t my bot see messages from other bots?

    Bots talking to each other could potentially get stuck in unwelcome loops. To avoid this, we decided that bots will not be able to see messages from other bots regardless of mode.

    Login or Signup to reply.
  2. I think what you said is Telethon. If so, you are right that it can read bot messages because it is using Telegram client API instead of Telegram bot API.

    Telegram client API is available for many different languages including Java. It supports both bot account or normal telegram account.

    But Tdlib is not easy to use and you need to compile the library for your platform. You can find it here:
    https://github.com/tdlib/td

    Some people use TDLib as service/server and receive requests from bot.

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