Getting Started
To get started with aoi.js, you will need to install the package. You can do so by running the following command in your terminal.
-
- using the package manager of your choice, run the following command to install aoi.js.
-
After doing so you will need to create an application from the Developer Portal and get the bot token from there.
- Make sure all the intents are enabled, as some functions require them. If you can’t do so then ignore this step.
- Copy the Discord Bot Token for later.
-
Before we get started, create a new file called
index.js
within your project folder. This will be the main file for your bot.- index.js
- package.json
Directorynode_modules
- …
- …
To get the bot running we need to create a new instance of the
AoiClient
class. This class is the main class for the bot and is used to interact with the Discord API.Basically this will be the content of your index.js file.
The token part is where your Discord Bot Token goes, which you previously copied from the Developer Portal.
The prefix part is where your bot’s prefix goes, you can even have multiple prefixes.
Now we can run our bot, but there isn’t any functionality yet.
Continue to the next page to learn how to add commands to your bot.
Already know how to use commands? Continue to the next page to learn how to use events.