Get Started - Learn How To Make Your Bot!GuidesCode SnippetsGet methodsPost methodsWeb APIUseful linksList of all currently Free ItemsList of EmotesHighrise Bot SDK Changelog
Concept
In this guide we will abroad how to deploy your bot on Railway App, a paid service for running apps remotely.
The repository created in this guide is available at:
Testbot
itzvini • Updated Jun 5, 2024
Requirements
- A Github account
- Git
- Knowledge on how to commit and push your repository to Github
How to do it
Create a Github repository to host your code
Login into your Github account and Create a new repository.
Name your repository, set it to private so no one has access to your code and add a .gitignore template to it avoiding to commit undesired files to your repository.
Now click on Create Repository
Your repository is now done and ready to be used!
Clonning your repository into your local machine
In your repository click on Code and then copy the link of your repository.
Press ctrl + r to execute a command, mine is in portuguese but it should be similar for you if you’re using Windows. Type “cmd” and press ok, this will open the Windows command terminal:
Now type “cd” and the path where you want to clone your repository into, mine will be in a folder called “bots” located in my desktop, for that I will drag the folder into the terminal an that will automatically copy the path of it.
Press Enter and now you are in the folder.
Now let’s clone the repository into the folder, for that you will need Git installed.
Type “git clone” and paste the link of your repository, after that press enter.
You have now your Github repository in your local machine!
Adding code and the necessary files to your Repository
Left click the folder that you clonned into and click on “Open with Code” or any other text editor that you wish to use, after opening it you should see something like this:
Now let’s add a bot code to it
I’ve added two files to it, a main.py and a run.py file:
Now let’s add a requirements file with all of the required libraries to run the bot. I will be using a modified library with the necessary changes to avoid the bot from raising an error on eventual disconections.
And lastly let’s add a railway.json file needed to deploy your code on Railway.
After everything is added let’s send this code to Github using the commands:
git add . git commit -m "First Commit" git push
Remember that you need to first setup your github account in your machine
Now your code is successifuly stored in Github!
Deploying into Railway
Open Railway and click on “Start New Project”
Select “Deploy with Github Repo” and login with your Github account.
Now setup your Railway account, if you wish to support me you can use my referral code: Itsvini
After Creating your account click in New Project.
Select Github again
Select your repository
Click in “Add Variables”
Write the variable name as “NIXPACKS_PYTHON_VERSION” and set the value as “3.11”, after it click on “Add”.
Now click on Settings
Click in the filter settings and write “deploy”, after it click on “Add Start Command”
On it write “python run.py” and then click in the checkmark.
Finally, click on Deploy.
After it your bot will begin to build and after a few seconds it will start.
Please send any feedbacks or doubts that you have about this guide in the bot-api channel in the Highrise Discord (https://discord.gg/highrise)
The repository created in this guide is available at
Testbot
itzvini • Updated Jun 5, 2024