> ## Documentation Index
> Fetch the complete documentation index at: https://docs.criminal.work/llms.txt
> Use this file to discover all available pages before exploring further.

# Levels

> Message XP, a rank card, a leaderboard and role rewards · off until you enable it.

Leveling is **disabled by default**, because tracking every message isn't something a server should
opt into by accident.

```text theme={null}
/config toggle levels enabled:True
```

## How XP works

| Setting | Default | Meaning |
| - | - | - |
| XP per message | 15–25 | A random amount in that range |
| Cooldown | 60 seconds | Per member, across the whole server |
| Curve | `50 × level^1.6` | XP needed to reach a level |

Level 1 costs 50 XP, level 10 costs about 1,995, level 25 about 8,700, level 50 about 26,000. The
curve is progressive, so early levels arrive quickly and later ones take real activity.

Bots never gain XP, and messages only count while Leveling is enabled.

## Commands

| Command | What it shows |
| - | - |
| `/level [member]` | Rank card: level, total XP, progress into the level, server rank, rendered as an image with a progress bar |
| `/ranks` | Leaderboard of the top 100, paginated ten per page |

## Rewards

```text theme={null}
/levelreward set 5 @Active
/levelreward set 25 @Regular
/levelreward list
/levelreward remove 25
/levelreward setxp @member 5000
```

When a member levels up, Criminal checks the reward table and grants the matching role. Roles it
can't assign · anything at or above its own top role · are refused when you set them up rather than
silently failing later.

`/levelreward setxp` overwrites a member's XP outright; the reply confirms the level that XP maps to.

**Rewards are granted, not owned**

A reward role is added when the level is reached. If you later change the reward table, members
keep roles they already earned · clearing those is a normal `/role remove` job.

## Announcements and DMs

Both messages are templates and both accept embed scripts:

```text theme={null}
/config channel levelup-channel #level-ups
/config text    levelup-message "{user} hit level {level}!"
/config toggle  level-announcements enabled:True
```

| Setting | Default | Notes |
| - | - | - |
| Chat announcement | **Off** | Posts only in `levelup-channel`; nothing posts until one is set |
| Level-up DM | On | Turn off with `/config toggle levelup-dms enabled:False` |
| DM message | Built-in | Edit with `/config text levelup-dm-message "Congrats {user}, level {level}!"` |

If the member has DMs closed, the DM silently fails and the chat announcement still posts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.