Clonebot Technical Documentation
User string sessions can be generated using any pyrogram V2 compatible session maker, or can be use this repo
From the last update, clonebot repo needs a database. So, you'll need to have a database installed on your system. I personally use Postgres, so I recommend using it for optimal compatibility.
In the case of Postgres, this is how you would set up a database on a Debian/Ubuntu system. Other distributions may vary.
1. Open terminal as a superuser
2. Install PostgreSQL database:
3. Change to the Postgres user:
4. Create a new database user (change YOUR_USER appropriately):
5. This will be followed by you need to input your password
6. Create a new database table:
7. Create the database with your own values. Change YOUR_USER and YOUR_DB_NAME appropriately.
This will allow you to connect to your database via your terminal. By default, YOUR_HOST should be localhost:5432
You should now be able to build your database URI. This will be:
8. An example database URI could be like:
9. Create config.py in the main directory. With mandatory variables and database URI. Refer to sample.config or rename it as config.py with your own variables.
Open the main bot directory > right-click > open a terminal here > Or Open a terminal > change to the bot main directory by cd /xxx/xxx
10. Finally, Run the following in the Terminal:
If everything worked fine, the string session user has a message in this bot 😜
1. Progress Failed to display: When you add a source chat, the bot will automatically find out the last message-id with the supported media types of that chat. In some cases like chats having limitations due to Copywrite infringement or pornography, bot will unable to retrieve the same. So the absence of the last message-id, the bot will fail to calculate the percentage completed and the process history, unless you need to input the same at initial. To avoid the situation, kindly 'VIEW' all fields where okay before beginning the clone.
2. Errors in % or Process bar:
Case-1: This basically occurs when asynchronous message-ids were inserted in starting & ending fields. The bot is calculating the percentage with the value inserted by the user. (Eg: the user inserted an end message id 30 and continued the process. But when in execution, the selected type is ended at message id 28 will cause the percentage to be struck in 90% even when the process has been successfully completed). So, before inserting an end id of a specific type, be sure that the type exists in that id.
Case-2: Bot will automatically set the last message id when a source chat id is added. This will be done according to the presently supported file type defaults in the bot. After you select the file types and go for a clone, the bot will unable to find the last message id depending upon your selection, resulting in errors in percentage. So select filetypes first, then add source. [ Even when in some conditions, the bot will unable to set it right. For a better visual experience, add the last message id manually it doesn't show in VIEW. If you are not selecting any file types, it will be fine at most ]
3.The bot is blocked by the session user: This is a protective mechanism to avoid unauthorised usage of someone's user session string. When a bot like this is deployed somewhere, the session user will send a message in the bot with some text as self. If someone stole a session string and deployed the bot, the session user can find it in this way, and tapping the button 'Terminate' in the bot can terminate the session[Session user only]. After blocking the bot by the session user, will lead to an error message will be printed in the deploy console, every time when tried to deploy with the same bot with the same string. There will be a confirmation for the above command before it takes action. [Heroku will restart the session within 10sec after a session termination, so, the blocking should be done within the time period].
4. Bot not responding: This error basically raised when the files are too older / the DC speed and all. Symptoms are, bot struck in between Indexing / clonning. As the files or dc or the chats configured are not a concern of this bot, there is no other solution for this state. So, it's a humbl request to the users of this bot to restart the bot is an only one solution for the same and please don't raise an issue in the repo or ping with messages in my social media accounts.
To run this bot in a Linux system background refer this documentation.
Comments