# Default Commands & Events

## Defaults Events

There is for now only one Default Event which is the `message` event. To use it, simply execute the [`useDefaultEvents`](https://advanced-command-handler.github.io/docs/modules/commandhandler.html#setdefaultevents) function from the CommandHandler Namespace.

## Defaults Commands

There is for now only two default Command which are the `help` and `ping` command. To use it, simply execute the [`useDefaultCommands`](https://advanced-command-handler.github.io/docs/modules/commandhandler.html#setdefaultcommands) function from the CommandHandler Namespace.

{% hint style="danger" %}
Both must be used after the `create` function.
{% endhint %}

## Example

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

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

CommandHandler
.create({
    commandsDir: 'commands',
    eventsDir: 'events',
})
.useDefaultEvents()
.useDefaultCommands()
.launch({
    token: 'token goes here',
});
```

{% endcode %}


---

# 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/defaults.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.
