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

# Leveling

> XP curve, multipliers, and rewards, all configurable.

## Overview

Leveling tracks XP per member with a curve and cooldown you control, not a fixed formula. Every `!level` subcommand below requires **Manage Guild**.

## Turning it on and setting the rate

<CodeGroup>
  ```javascript Syntax theme={null}
  !level enable <enabled>
  !level xp <min> <max>
  !level voice-xp <amount>
  !level cooldown <seconds>
  ```

  ```javascript Example theme={null}
  !level enable true
  !level xp 15 25
  !level voice-xp 5
  !level cooldown 60
  ```

  ```text Result theme={null}
  ✅ Leveling enabled.
  ```
</CodeGroup>

XP per message is a random amount between `min` and `max`, on a per-member cooldown. `voice-xp` is a flat amount per minute in voice, no cooldown.

## The XP curve

<Warning>
  Total XP per level is `(a·L³ + b·L² + c·L) × difficulty`, rounded. Existing members' levels are recalculated against the new curve when you change it, only touch this if you know what you're doing.
</Warning>

<CodeGroup>
  ```javascript Syntax theme={null}
  !level curve [a] [b] [c] [difficulty] [rounding]
  !level max-level <count>
  ```

  ```javascript Example theme={null}
  !level curve 1 50 100 3 100
  !level max-level 200
  ```
</CodeGroup>

Defaults: `a=1`, `b=50`, `c=100`, `difficulty=2.5`, `rounding=50`.

## Notifications

<CodeGroup>
  ```javascript Syntax theme={null}
  !level notify <mode> [channel] [embed] [every] [message]
  ```

  ```javascript Example theme={null}
  !level notify channel #level-ups true 5
  !level notify reply "{user} hit level {level}!"
  ```
</CodeGroup>

`mode` is `off`, `reply` (in the channel they leveled up in), `channel` (fixed), or `dm`. `every` limits announcements to every N levels instead of every single one. `message` supports `{user}`, `{level}`, `{level_xp}`, `{level_rank}`, and every [variable](/resources/scripting/variables).

## Ignored channels

<CodeGroup>
  ```javascript Syntax theme={null}
  !level ignore <channel>
  ```

  ```javascript Example theme={null}
  !level ignore #bot-commands
  ```
</CodeGroup>

Running it again on the same channel toggles it back off. Channels on the list grant no XP.

## Join bonus

<CodeGroup>
  ```javascript Syntax theme={null}
  !level join [xp] [level]
  !level sync-join
  ```

  ```javascript Example theme={null}
  !level join 0 5
  ```
</CodeGroup>

Grants new members a starting XP/level. `level` takes priority if both are set. `sync-join` retroactively applies the current bonus to every member who's still at zero.

## Manual XP/level management

<CodeGroup>
  ```javascript Syntax theme={null}
  !level manage xp <action> <user> <amount> [target]
  !level manage level <action> <user> <amount>
  !level reset <user>
  ```

  ```javascript Example theme={null}
  !level manage xp add @Someone 500
  !level manage xp transfer @A 200 @B
  ```
</CodeGroup>

`action` is `add`, `set`, `remove`, or (XP only) `transfer` to another member. `reset` wipes a member's XP/level and removes their reward roles.

## Status

<CodeGroup>
  ```javascript Syntax theme={null}
  !level status
  ```
</CodeGroup>

Shows the full current configuration in one place.

## Related

<Card title="Level Rewards" icon="trophy" href="/community/leveling-rewards">
  Role rewards and XP multipliers.
</Card>
