Our bot hosting plan allows for you to run multiple Python or NodeJS based bots on one plan! You can extend this as much as you'd like, until the combination of bots being run exceeds the resources of your plan (such as RAM usage). We'll show you how to get that up and running!

Before starting this process, please ensure you've created a backup copy of your bot's files.

Running multiple Python bots
To get the process started, you'll need to do the following:
- Click the Languages & Preinstalls button on the main page of your panel
- Select Bot Preinstalls from the left sidebar, and check the Multiple Bots At Once - Python option, then press save
- Restart your bot

After performing these steps, your service will be configured to run loader.py and will have a Bot1 and Bot2 folder created, with an example python file within each of those folders. If you're wanting to only run two bots, those are the only folders you will need, however if you want additional bots, create a new folder for each bot you'd like to run. Once they have been created, within each folder upload the files necessary for each bot to run.

Head back to the root folder of your service if you're not already there, and open the loader.py file, which should look something like this by default:


You'll only be concerned with editing the start_files section - this tells the bot loader which files to launch, and each entry counts as a bot. If I had a bot called bestbot.py in the Bot1 folder, I'd edit the first line to be as follows:

"./Bot1/bestbot.py,

Repeat this process for as many bots as you have, and remember to add a , at the end of each line, except for the last line. Once you've done this, save the file.

Lastly, open the requirements.txt file, which should be in the same folder that loader.py was in - you'll need to specify the packages that any of your bots require to run in here, with each package being separated by a new line.

After you've finished this, you should now be able to head back over to the console page for your bot, and press the Start button - which will launch all of the bots you've configured!

Running multiple NodeJS bots
To get the process started, you'll need to do the following:
- Click the Languages & Preinstalls button on the main page of your panel
- Select Bot Preinstalls from the left sidebar, and check the Multiple Bots At Once - NodeJS option, then press save
- Restart your bot

This will look similar will then work similarly to running multiple Python bots - a Bot1 and Bot2 folder will be created, a long with a loader.js file that gets automatically set as the main start file for your bot.

Next, head over to the File Manager in your panel - if you only need to run two bots at once, then you do not need to create any additional folders. However if you'd like to run more, just simply create additional folders for each additional bot you plan to run (such as Bot3, Bot4, etc). Upload each bot's files into their respective folders, then open the loader.js file that was created, and you should see something at the top that looks like the following:


Just as was done for configuring multiple Python bots, you will need to add in an entry to the start_files array for each bot's main file you want to run. Be sure to edit the main.js at the end to also match up with the proper main file for your bot. As an example, if you wanted to run four bots, that may look something like:

const start_files = [
"./Bot1/main.js",
"./Bot2/main.js",
"./Bot3/index.js",
"./Bot4/index.js"
];


Remember that at the end of each line, with the exception of the last line, there should be a , that tells the loader to expect another entry - then save the file.

In addition, don't forget to upload the package.json file for each bot, so that any dependencies your bot needs to run can automatically be installed. This differs from the Python multiple bot setup, where also dependencies are specified in one file - for NodeJS based bots, each bot will have its own package.json file with it's needed dependencies specified.

After you've completed this, you should now be able to press the Start button via your console, and any bots you've configured should start to run!

If you run into any issues getting this configured, please feel free to reach out to our support team so that we may provide assistance with this. You can reach our support team by either opening a ticket on our website or our Discord.
Was this article helpful?
Cancel
Thank you!