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.
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
2
Answers
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
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.