Preparation

To get started with your Node.js / JavaScript based bot, you'll want to make sure you have all of the files that you need for your bot ready first. Primarily, you will need the following:

- package.json — This file tells our panel about any requirements/dependencies your bot requires. As long as this file contains the list of packages that your bot uses, our panel will automatically install said packages when your bot is next started. Alternatively, you can install any needed packages manually via the Node Package Manager link on the left sidebar of your panel.
- package-lock.json — This file is optional, however it generally is a companion to package.json. If you do not have one, that will not be an issue, however if you do have one, we recommend uploading it as well.
- index.js — Your bot's main starting point. While the name of this file is not important, we will use index.js as the example for this guide. This file can be named whatever you would like, so long as you remember to mentally replace index.js with whichever file name you go with while reading this guide.

Both of these files should be saved somewhere on your computer, along with any other files that your bot requires to run.

Uploading your bot's files

For the next step, we'll go ahead and get our bot's files uploaded to our bot hosting service.
To do so, first head over to the File Manager link on your panel's left sidebar, like so:

Click the File Manager link, which is the second item on the panel's left sidebar
From here, you will most likely see that there are already some files here, that comes pre-installed on a NodeJS bot hosting plan. Although these files will not cause any sort of issues (in fact, uploading a file with the same name will just simply overwrite it), we'll go ahead and delete some of these files just to ensure we have a fresh start. In this case, delete package.json, package-lock.json, and bot.js.

Organizing our workspace by removing some default files
Now that some of those default files have been removed, lets go ahead and actually upload our bot's files. There are a couple of ways to do this:

- Simply drag and drop your bot's files onto the File Manager window
- Or, click Upload -> File and choose your bot's files in the file picker window that pops up
- Alternatively, you can also deploy your bot's files via FTP, which is useful for deploying from say a build service. You can grab the FTP details for your bot hosting plan via the FTP Client Details link on the left sidebar of the File Manager.

In this example, my bot only has three files that need to be uploaded, an index.js file, a package.json file, and a package-lock.json file — depending on how your bot is constructed, it will most likely have more files, you'll want to ensure you upload these as well.

Note: One particular folder you should avoid uploading is the node_modules folder, as our panel will automatically generate this for you, so long as your bot's package.json file contains its necessary packages in this file. Some node packages may contain various files for different types of operating systems, so it is best to let us generate this folder for you to avoid any issues. In addition, it will most likely trim off some time from your upload as well!

Uploading our bot's files

Final steps

Now that our bot's files are uploaded, it's just about time to go ahead and start our bot for the first time! Head back over to the main page of your panel using the Back button on the left sidebar from the File Manager.

The last step in our checklist is to ensure that the Start File section on the panel is correct. By default, the panel will automatically use the file defined as main in your package.json file if one is present. Earlier we mentioned that we would be utilizing index.js as our bot's main file, however if your bot uses a different file name, you will need to make sure this is entered in the Start File textbox. Don't forget to click save after updating this!

Ensure that the Start File textbox contains your bot's main file name
Next head over to the Console link on the left sidebar of your panel, this will allow us to see any output from our bot, whether said output is an error, or just informational output.

The console link is the first item on the panel's left sidebar
From the console page, click the Start button at the top right of the page, and your bot should now start up!
Press the Start button at the top right of the console window to give your bot a try!
And with that, your bot should now be up and running!

Our bot is ready for action!
In our example of course, our bot only prints one line and then stops, however yours will continue running in the background. Feel free to leave the console page once you're all set. If you run into any issues getting your bot started, 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!