-
Notifications
You must be signed in to change notification settings - Fork 2
Starting
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.
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.
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
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:
- How to install Node.js.
- Installing Node.js (Windows, Linux & macOS) (unofficial).
- How To Install Node.js on Ubuntu 20.04 (unofficial).
- How To Install Node.js on Windows 10/11 (unofficial).
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:
In the case of carrying out the process in Windows, it will be necessary to have the Python software installed on the computer, which does not come by default in the operating system and is necessary for audio decoding and encoding.
You can download Python from here:
Audio encoding and decoding also requires the "Desktop development with C++" workload, which you'll need to get with the Visual Studio installer, and which you will have to select in the "workloads" tab, in the category of "Desktop & Mobile" to later install it.
You can download the Visual Studio Installer from here:
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:
- If you have Git installed, you can do
git-clonefrom https://github.com/EasyXploit/HelpBot.git.
- You can also directly download the
.zipfile of the code from https://github.com/EasyXploit/HelpBot/archive/refs/heads/master.zip and unzip it.
For more information, follow this guide.
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
cmdand 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).
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).
- To do this, we recommend following this Discord.js community guide.
We recommend unchecking the "Public Bot" slider, to prevent others from adding the bot to other guilds without your consent.
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"
}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.
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.
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(orsudo run devStartif you're on Linux and don't have elevated privileges) so that the bot automatically restarts every time you save a configuration file.
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 THE BOT!!! πππ
π‘ In case you have any questions about how to use the bot, or anything else related to this repository, you can make use of the support Discord Server.