> For the complete documentation index, see [llms.txt](https://bit.lockyzdev.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bit.lockyzdev.com/docs/dev/create-plugins/definable-intents.md).

# Definable Intents

{% hint style="danger" %}
WARNING: This feature is EXPERIMENTAL.

Please exercise caution when using this feature!
{% endhint %}

Added in Bit 2025.2, you can now define intents to be added to the bot before the bot starts.

This feature adds a new function that runs when the bot first starts `define_intents()` runs BEFORE the Discord client is defined and started, meaning that any discord.js specific functions DO NOT work.

This function can be used to run literally any code, however plugins will NOT be certified if they run any code within this function that isn't used to define an intent, or a node module.

Within your plugin.json file you'll need to set `has_intents` and `has_index` to true, you'll also need to define your `main_file`

Example, defining the MessageContent privileged intent

{% code overflow="wrap" %}

```javascript
const core = require('bit/core');
const { GatewayIntentBits } = require('discord.js');

module.exports = {
    define_intents: function define_intents() {
        // Adds the MessageContent intent
        // I recommend against adding this intent unless ABSOLUTELY required
        // This intent allows the bot to see Message Content and is ABSOLUTELY dangerous
        core.add_intent(GatewayIntentBits.MessageContent)
    }
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://bit.lockyzdev.com/docs/dev/create-plugins/definable-intents.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.
