# Leveling

Source: https://righteousbot.dev/docs/features/leveling/

Turn on XP and levels, give out reward roles, fix or reset XP, and bring levels over from MEE6 or Lurkr.

Nothing is tracked until you unlock it, so a server that set up rewards and never unlocked sees nothing happen. To change the rank card or the level-up message, see [Rank cards and level-ups](/docs/features/level-up-messages/).

## Turn leveling on [#turn-leveling-on]

[`,levels unlock`](/commands/levels/levels/#levels-unlock) needs **Manage Server**. Before it runs, messages earn nothing at all.

<CommandBlock syntax=",levels unlock" />

[`,levels lock`](/commands/levels/levels/#levels-lock) stops new XP but keeps everything, so unlocking later picks up where you left off. Members can opt out for themselves (no XP, no leaderboard, no level-up ping) with [`,levels notifyme`](/commands/levels/levels/#levels-notifyme).

## Check a rank or the leaderboard [#check-a-rank-or-the-leaderboard]

[`,levels rank`](/commands/levels/levels/#levels-rank) shows a rank card. You can also right-click a member, then **Apps → Rank Card**. [`,levels leaderboard`](/commands/levels/levels/#levels-leaderboard) ranks the server by XP.

<CommandBlock syntax=",levels rank [user]" example=",levels rank @cami" />

<DiscordEmbed caption="The leaderboard in a small server. Past 10 members it adds arrow buttons and a page count, and it stops at the top 100." invokedWith=",levels leaderboard" color="#1e90ff" title="Righteous | Levels Leaderboard" description="&#x22;`1.` **sam** — Level 27 (48,210 XP)\n`2.` **riley** — Level 25 (41,530 XP)\n`3.` **jordan** — Level 24 (36,900 XP)\n`4.` **alex** — Level 22 (29,770 XP)\n`5.` **casey** — Level 20 (22,140 XP)\n`6.` **morgan** — Level 17 (15,380 XP)&#x22;" />

Levels start at **1**, not 0, and changing the curve applies to everyone.

## Tune how XP is earned [#tune-how-xp-is-earned]

| Command                                                                               | Does                                              |
| ------------------------------------------------------------------------------------- | ------------------------------------------------- |
| [`,levels setrate <0.1-5>`](/commands/levels/levels/#levels-setrate)                  | Scales everyone's XP                              |
| [`,levels ignore add <#channel/@role>`](/commands/levels/levels/#levels-ignore)       | Stops a channel or role earning                   |
| [`,levels multiplier set <role> <value>`](/commands/levels/levels/#levels-multiplier) | Bonus (above 1) or penalty (below 1) for one role |

<CommandBlock syntax=",levels multiplier set <role> <value>" example=",levels multiplier set @Booster 1.5" />

## Give out reward roles [#give-out-reward-roles]

[`,levels roles add`](/commands/levels/levels/#levels-roles) attaches a role to a level. The role is checked against **your** hierarchy when you add it and against **Righteous's** every time it's handed out, so a reward fails if the bot's role is moved below it.

<CommandBlock syntax=",levels roles add <level> <role>" example=",levels roles add 10 @Regular" />

| Command                                                                   | Does                                                                                                                                              |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `,levels roles remove <level>`                                            | Removes a reward                                                                                                                                  |
| [`,levels update <role> <level>`](/commands/levels/levels/#levels-update) | Moves a reward to another level                                                                                                                   |
| [`,levels roles stack <on/off>`](/commands/levels/levels/#levels-roles)   | **On by default**: every tier stays. Off keeps only the highest tier and strips lower reward roles the bot manages. Other roles are never touched |

Members who leave and return get their reward roles back from stored XP, with no announcement. The exception is a member rejoining under a mute or jail.

## Fix roles without waiting for a message [#fix-roles-without-waiting-for-a-message]

[`,levels sync`](/commands/levels/levels/#levels-sync) reconciles your own roles with your XP. With **Manage Server** it can also target `@member` or `server`. `++strip confirm` also removes roles no longer earned, and works on `server` only. One sync runs per server at a time.

<CommandBlock syntax=",levels sync server [++strip confirm]" example=",levels sync server ++strip confirm" />

## Set or wipe XP [#set-or-wipe-xp]

<Callout type="error" title="Reset, cleanup and import need the server owner">
  [`,levels reset`](/commands/levels/levels/#levels-reset), [`,levels cleanup`](/commands/levels/levels/#levels-cleanup) and [`,levels import`](/commands/levels/levels/#levels-import) are owner-only, like `,antinuke`. Manage Server, even a fake permission, doesn't open them.
</Callout>

[`,levels xp`](/commands/levels/levels/#levels-xp) sets, adds or removes a member's XP. Setting or removing checks role hierarchy against the target; adding doesn't. [`,levels setlevel`](/commands/levels/levels/#levels-setlevel) does the same in levels.

<CommandBlock syntax=",levels xp set <member> <amount>" example=",levels xp set @cami 5000" />

<Callout type="warn" title="Reset has no undo">
  `,levels reset confirm` wipes **every** member's XP. Name a member to wipe only theirs. It needs the literal word `confirm`.
</Callout>

<CommandBlock syntax=",levels reset [member] confirm" example=",levels reset confirm" />

`,levels cleanup` only removes rows for members who left and entries pointing at deleted roles or channels. [`,levels panel`](/commands/levels/levels/#levels-panel) opens a menu for all of these settings.

## Move from MEE6 or Lurkr [#move-from-mee6-or-lurkr]

[`,levels import`](/commands/levels/levels/#levels-import) brings members' levels across. Leveling must be unlocked first. You download the data yourself; Righteous never contacts MEE6 or Lurkr. Other bots (Arcane, for example) aren't supported.

<Steps>
  <Step title="From MEE6">
    In MEE6's dashboard, turn on **Make my server's leaderboard public**, then save the leaderboard as a `.json` file (a bigger server saves each page). `,levels import` with nothing attached prints the exact link for your server.
  </Step>

  <Step title="From Lurkr">
    In Lurkr's dashboard, open **Danger Zone** and choose **Download Leveling Data**.
  </Step>
</Steps>

<CommandBlock syntax=",levels import <attach the export files>" />

Attach up to 10 files of 8 MB each. Nothing changes until you press **Confirm** on the preview.

* **Imported XP replaces what members have here.**
* **Levels keep their number.** MEE6 level 15 is level 15 here, with the same progress. A Lurkr member starts at the beginning of their level.
* **Only current members** are imported. People who left, bots and opted-out members are skipped.
* **A MEE6 file from another server is refused.**
* **Reward roles aren't handed out.** Run [`,levels sync server`](/commands/levels/levels/#levels-sync) afterwards.
* **One import per server per hour.**

<Callout type="warn" title="Undo lasts 7 days">
  `,levels import undo` restores XP to just before the import, and loses any XP earned since. After 7 days the import is permanent.
</Callout>

<CommandBlock syntax=",levels import undo" />

## Common issues [#common-issues]

**Import says the file is another server's.** Use the link `,levels import` prints with nothing attached.

**MEE6 shows an error instead of a leaderboard.** The leaderboard isn't public yet. Turn it on in MEE6's dashboard.

More fixes are on the shared [common issues](/docs/common-issues/) page.
