How to host a Telegram's OpenUserBot

How to host a Telegram's OpenUserBot

3Cube


Basic Pre Requisites:

1)GitHub Account

2)Heroku Account

3)API_HASH and API_KEY from Telegram

Getting Started:

1)Go to your GitHub Account in "Desktop Mode" and click on "New" near the Repositories Tab

2) Give your repo a name, set it to "Private" and click on create repository

3)On the next page click on "Import Code"

4)Then on the next page Paste this link

https://github.com/mkaraniya/OpenUserBot.git

And click on Begin Import.

Wait a couple of minutes for GitHub to import and prepare your repo.

5)After the importing is done and your repo is ready do the following

• Go to a folder named "userbot"

• Then click on the file __init__.py

• Edit the file as follows:

×Remove the said line

___________PLOX_______REMOVE_____THIS_____LINE__________

It should look something like this

×Then Scroll a bit down till you find "API_HASH" and "API_KEY" and edit it with the KEY & HASH you got from Telegram

Make sure there are quotation marks around your KEY & HASH & Then click on commit changes

6)Now go to your Heroku account and make a new App for generating a session(you can name it anything)

7)Then under "Deployment Method" click on GitHub and connect Heroku to your Account and then Connect it to your Userbot Repo

8)And then scroll down and click on "Deploy Branch

9)It will start deploying the bot

10)Once the build is finished, on the top Click on "More" then click on "Run Console"

11)In the Console type

python3 string_session.py

12)It will ask you for your phone number, put it in the international format like +911234567890

13)Put the OTP and then click on Save session

14)This will download the session, keep it safe we'll need it later

Setting up:

1)Delete your Heroku App and also delete your repo

2)Re-Clone the repo but this time, keep it "Public"

This is necessary to keep the bot Up-to-date

Deploying the Bot:

1)Go to you newly Cloned repo and click on "Deploy To Heroku"

2)This will create a new app, name it, also put the required Values like API HASH and KEYS

3)Finally put the string session which we generated in the previous step

It startes with a number and ends with an equals "="

4)And then click on Deploy

5)When the build succeeds, go to "Resources" tab and Enable the "Worker/Dyno" by clicking on the Pencil Icon.

6)Click on "More" and the "Logs", keep and eye on the log

7)If it fails head towards UserBot Support

8)If it is on/Alive yah! You did it!

Alive(.on) message

Keeping the bot Up-to-date:

1)Turn on "Automatic Deploy" in Heroku

2)"yourname" is Your Username on GitHub

3)"urrepo" is The name of your personal repo


cd
git clone https://github.com/yourname/urrepo.git
cd urrepo
git remote add upstream https://github.com/mkaraniya/OpenUserBot.git
git pull upstream sql-extended
git push






Report Page