# Home

## What it is

This is a node.js library written in typescript for more than a year that is here to simplify bot creation with automation for commands/events handling, defaults commands/events, plus some utilities classes and functions.

#### [See on GitHub](https://github.com/Advanced-Command-Handler/Advanced-Command-Handler)

#### [Documentation](https://advanced-command-handler.github.io/docs/)

## Installation

To install this module, you need [Node.js](https://nodejs.org/) with at least version 16.

Then execute this command :

```
$ npm install --save advanced-command-handler
```

{% hint style="info" %}
Add `@beta` at the end to install the beta version or `@rc` to install the release candidate version if any.
{% endhint %}

For the version `3.0.x` of the library you will need Discord.js v12, it will be updated to v13 in versions `3.1.x`.

## Getting started

First, [create a bot application](https://discordjs.guide/preparations/setting-up-a-bot-application.html#creating-your-bot), then get the token of the application.

Install the dependency and create your main JavaScript (or TypeScript) file and write the first lines to setup the bot and the Command Handler and start it.

{% code title="index.js" %}

```javascript
const {CommandHandler} = require('advanced-command-handler');

CommandHandler.create({
    commandsDir: 'commands',
    eventsDir: 'events'
}).launch({
    token: 'the token of my bot'
});
```

{% endcode %}

Then run this file using `Node.js`.

```bash
$ node index.js
```

{% hint style="success" %}
Node.js will run by default files named `index.js` so you can just run this :

```
$ node
```

{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ayfri.gitbook.io/advanced-command-handler/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
