Skip to content

Starting

Daniel Perales edited this page Jan 14, 2024 · 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.

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 minimum 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 v18.4.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:

πŸ’Ύ 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, 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).

We recommend unchecking the "Public Bot" slider, to prevent others from adding the bot to other guilds without your consent.

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"
}

Privileged intents

The bot makes use of a series of Privileged Gateway Intents that are necessary for its correct operation, and that must be activated from the Discord developer portal, so you must access the bot page in the "my applications" of said portal, and from the "bot" section in the application, you will have to enable the following options:

  • Presence Intent.
  • Server Members Intent.
  • Message Content Intent.

βž• Joining the bot

In order to interact with the bot, you will need to add it to ONE AND ONLY ONE guild (server).
To do this, you will have to go, within the Discord developer portal, to the OAuth2 > URL Generator section, select the bot option in the Scopes box, and in the Bot Permissions box that will appear, click the Administrator checkbox.

Once you have done the above, in the final field called Generated URL the URL to invite the bot will appear, which will be the one you have to open in a new tab of your browser in order to authorize the bot access to the guild you want.

πŸš€ 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.

ENJOY THE BOT!!! πŸŽ‰πŸŽ‰πŸŽ‰

Clone this wiki locally