Skip to content

Starting

Daniel Perales Mauriz edited this page Mar 11, 2022 · 43 revisions

πŸ“– Welcome to the start guide!

Although the bot has been designed to be as simple as possible for the end user (within the limitations of its own design philosophy), it is possible that if you have never worked with Node.js or Discord bots before, you may feel lost when you start using it.

For this same reason, we have designed this guide in the best possible way so that everyone can take advantage of this repository, and remember that if you have any questions about the installation process, you can use the "Discussions" tab.

πŸ–₯ Prerequisites

Since this bot is designed to work in a single guild exclusively, the hardware requirements are quite low compared to other bots, although that will ultimately depend on how active your community is and how intensive the bot is used at the same time.

The function that demands the most hardware resources is undoubtedly the playback of audio tracks, whether local or from YouTube, therefore the system requirements described below are adjusted to provide this function.

System requierements

During the life cycle of this project, the bot has been hosted on an AWS EC2 instance of type t2.micro with an image of Ubuntu v20.04.4, therefore the recommended system requirements are:

  • 1 CPU core
  • 1 GB of RAM
  • 8 GB SSD storage
  • 2 Mb/s bandwidth

Node.js installation

HelpBot is an application designed to run on a Node.js runtime. Specifically, the version that we have verified that works perfectly for the bot is v17.5.0, although the libraries are perfectly compatible with versions of Node.js equal to or greater than v16.6.0.

You can download Node.js from here:

To install Node.js, you can follow this tutorials:

FFMPEG installation

For some types of local and remote audio track encoding, the bot makes use of the FFMPEG library, which must be installed on the system (not a bot dependency) and added as an environment variable.

You can download FFMPEG from here:

To install FFMPEG, you can follow this (unnoficial) tutorials:

πŸ’Ύ Clonning the repository

In order to run the bot, you will have to download it to the same computer where you had previously installed Node.js and FFMPEG, so to do this you will have to clone a copy of the code from the repository using git-clone or direct download.

Instructions for cloning the master branch:

For more information, follow this guide.

Downloading dependencies

Once you have obtained your copy of the bot (and uncompressed if necessary), you will have to access the bot folder from a command line:

  • On Windows: By accessing the root folder of the bot, clicking on the address bar, typing cmd and pressing Enter.
  • On Linux (no interface): Using the cd command to arribe the root folder of the bot.

Once you're in the folder, you'll need to use the npm install command to install the dependencies (or sudo npm install if you're on Linux and don't have elevated privileges).

πŸ€– Creating an account for the bot

Before you can start your bot, you need to access the Discord developer portal and create a new "bot" type app. This will allow you to get a login token so that the bot can connect to a Discord account (bot account), and start receiving events from the websocket (such as messages).

Storing the token

Once you have obtained your bot's token, you will need to store it in the following bot directory path: configs/token.json and paste it into the key field, just as shown below:

{
    "key":"YOUR-TOKEN-GOES-HERE"
}

πŸš€ Launching the bot

Congratulations!! You are now ready to perform the first start of the bot.
To do this, you just have to execute, from the root folder of the bot, the command npm start (or sudo npm start if you're on Linux and don't have elevated privileges).

Note that if you make any changes to the bot's configuration files, you'll need to restart the program, although we recommend that while you're configuring it to your liking, you use the npm run devStart (or sudo run devStart if you're on Linux and don't have elevated privileges) so that the bot automatically restarts every time you save a configuration file.

Next steps

We recommend you take a look at the article on how to configure the bot that we have written on this wiki, as well as review the article called "Commands" to learn how to use the bot commands.

ENJOY TE BOT!!! πŸŽ‰πŸŽ‰πŸŽ‰

Clone this wiki locally