# Invites

## <mark style="color:blue;">Introduction</mark>

The Invites configuration file (`invites.json`) controls the invite tracking system and role rewards for users who invite members to your server.

***

## <mark style="color:blue;">Role Rewards</mark>

Automatically assign roles to users based on how many members they've successfully invited to the server.

### <mark style="color:yellow;">enabled</mark>

**Type:** Boolean

Enables or disables invite role rewards.

```json
role_rewards: {
    enabled: false,
}
```

**When `true`:** Users receive roles when they reach invite milestones\
**When `false`:** Invite tracking still works, but no roles are automatically assigned

***

### <mark style="color:yellow;">keep\_all\_roles</mark>

**Type:** Boolean

Determines whether users keep all earned invite roles or only the highest one.

```json
keep_all_roles: true
```

**When `true`:**

* User with 5 invites gets the 5-invite role
* When they reach 10 invites, they keep the 5-invite role AND get the 10-invite role
* Users accumulate all milestone roles

**When `false`:**

* User with 5 invites gets the 5-invite role
* When they reach 10 invites, the 5-invite role is removed and replaced with the 10-invite role
* Users only have their highest milestone role

***

### <mark style="color:yellow;">roles</mark>

**Type:** Array of Objects

Define which roles are awarded at which invite counts.

```json
roles: [
    {
        invites: 5,
        role_id: "804354034135597066",
    },
    {
        invites: 10,
        role_id: "804354033338286130",
    },
    {
        invites: 25,
        role_id: "123456789012345678",
    },
    {
        invites: 50,
        role_id: "234567890123456789",
    },
]
```

**invites** - Number of successful invites required to earn the role\
**role\_id** - Discord role ID to assign

{% hint style="info" %}
**Note:** Only successful invites count - if an invited member leaves the server, the invite count may be adjusted based on your server's invite tracking settings.
{% endhint %}

***

## <mark style="color:blue;">Complete Configuration Example</mark>

Here's a complete invite rewards configuration:

```json
{
    config: {
        role_rewards: {
            enabled: true,
            keep_all_roles: true,
            roles: [
                {
                    invites: 5,
                    role_id: "804354034135597066",
                },
                {
                    invites: 10,
                    role_id: "804354033338286130",
                },
                {
                    invites: 25,
                    role_id: "123456789012345678",
                },
                {
                    invites: 50,
                    role_id: "234567890123456789",
                },
                {
                    invites: 100,
                    role_id: "345678901234567890",
                },
            ]
        }
    },
}
```


---

# 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://docs.iynxdev.com/configuration-files/invites.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.
