Answer the question
In order to leave comments, you need to log in
How to create a Telegram bot that creates bots?
Is there any centralized mechanism for creating or cloning bots?
There are 10 bots during the operation and testing of which there are bugs that need to be fixed. All of them are based on the 1st bot. (the bot files are simply copied, a virtual environment is created and they work quietly for themselves).
It turns out that you need to fix the same thing 10 times.
Does anyone have any ideas to solve this problem? It turns out that you need 1 core with which you need to work. And when you make changes or new functionality, this is also displayed for other bots.
PS
How do bot constructors work? We give a token, then we work in the constructor. It turns out that it can be done.
Answer the question
In order to leave comments, you need to log in
Write an update service.
On the bot side, write an updater class (or method) (should not depend on the bot) that will send the current version of the bot to the update service -> the service receives the bot version, compares it with the current version of the current one -> if there are updates -> return a link to the zip (when updating the root bot, you can automatically pack it into an archive).
The updater (class) receives the package, makes a backup of the current bot somewhere, overwrites and unpacks the new one. The version can be stored either as a file, or as a property, or you can calculate the md5 hash of the core (the bot's main file). Last must-have :)
As I understand it, you have a ready-made working bot that will be assembled and this bot has a config file with all the settings, and when a person creates his bot in your bot, you create a copy of this bot, change the config file and run it on your server
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question