Mochi Sign in

Levels and rewards

Open Community → Levels and rewards at /levels. Manage Server is required. The levels plugin can be disabled per server or globally.

Enable XP

XP earning starts paused. Open XP settings and role rewards, select Enable XP earning, configure the options, and save.

By default, an eligible message earns a random 15 to 25 XP. Each member has a 60-second cooldown in each server. The limits are 1 to 100 XP per message and a 15 to 3,600 second cooldown.

Messages must contain at least five characters after trimming spaces. Bot messages, webhooks, system messages, and commands starting with ! or / do not earn XP. Attachment-only messages do not earn XP. Repeating the last rewarded text does not earn XP, even after the cooldown. This comparison ignores case and repeated spaces. Only a SHA-256 hash of the last rewarded text is stored. Message content is not stored by the levels feature.

Use the separate channel, category, and role exclusion lists. Select categories under Categories that do not earn XP. A member with any excluded role cannot earn XP. Excluding a channel also excludes its threads. Excluding a category excludes its child channels and their threads. XP is earned from new messages only; earlier chat history is not imported. Cooldowns and duplicate-message protection survive restarts.

Levels

By default, total XP needed for level N is 100 × N²:

LevelTotal XP
1100
2400
3900
52,500
1010,000

Custom calculation

Choose a preset under Level calculation, or enter a custom formula. The formula defines total XP needed to reach a level, not XP for that level alone. Supported inputs are level (or n), decimal numbers, +, -, *, /, ^ (or **), and parentheses. Examples:

The preview shows total XP and the increase from the previous level. Level 0 always starts at 0 XP. Results are rounded up to whole XP. Total XP must be positive, strictly increasing, and a safe whole number at every level from 1 through 1,000. Level 1 must be reachable within the XP limit. Invalid formulas cannot be saved. Formula text is parsed as arithmetic and is never run as JavaScript.

XP is capped at 100,000,000. The level limit is 1,000. The preview shows the maximum reachable level for the selected formula. A steeper curve can make some higher levels unreachable within the XP limit.

Changing the formula keeps existing XP. Dashboard ranks, progress, reward eligibility, and /rank and /levels use the saved formula. Roles follow the selected reward mode. Newly eligible rewards apply on the next XP award or with Apply earned rewards. Formula changes do not send level announcements.

Existing servers keep the default curve after migration. Category exclusions previously stored in the channel list remain active and appear in the category list when channel choices load.

Members use /rank [member] to view XP, level, server rank, and progress to the next level. /levels [page] shows the activity leaderboard, with 25 members per page. This is separate from the invite leaderboard. Equal XP is sorted by member ID. The dashboard supports search and pagination.

When Mochi observes a member leave, their row is hidden from the leaderboard. Their XP is kept. They return to the leaderboard when Mochi observes them rejoin or they earn XP again. Earned rewards are checked on rejoining if earning is enabled.

Role rewards

Add up to 25 reward roles, each at a level from 1 to 1,000. Several roles can use the same level. A role can be listed once.

The staff member who saves reward rules needs Manage Roles, and each reward must be below their highest role. The server owner is exempt from that position comparison. Mochi needs Manage Roles and a higher role position than every reward. The everyone role and integration-managed roles cannot be rewards.

The default cumulative mode keeps all earned roles. The highest mode keeps only rewards at the highest earned threshold. In the highest mode, lowering XP can remove roles tracked by Mochi. Roles that members had before tracking are kept. Pausing earning or disabling the plugin stops reward changes.

New rules apply when a member next earns XP. Staff can also load that member and select Apply earned rewards. This uses their current XP and the current saved rules. The feature does not immediately assign roles to every existing member after a settings change.

Reward requests change roles individually. Roles owned by another tracked reward source are kept. Partial failures are safe to retry. The dashboard shows failed or pending rewards. A background task retries up to ten pending members each minute, with at least five minutes between automatic failed attempts for a member. Staff can request an earlier retry with Apply earned rewards. Pending work survives restarts. It pauses while XP earning or the plugin is disabled.

Successfully checked rewards are not repeatedly assigned on every message. Use Apply earned rewards if an earned role was removed manually and should be restored.

Announcements

Optionally select a text or announcement channel for level announcements. Mochi needs View Channel and Send Messages there. Announcements occur when XP from a message crosses a level threshold. They do not send mention notifications. Staff XP adjustments do not send announcements.

Staff XP changes

Select a member in the leaderboard or load their Discord member ID. Enter the new total XP and a reason, then select Set total XP and confirm. The member must still be in the server and cannot be a bot.

The dashboard records the actor, previous XP, new XP, reason, and time. It shows the latest 20 adjustments for a member. Concurrent XP changes require a reload. If earning is enabled, eligible reward roles are checked after the adjustment. Roles follow the selected reward mode when XP is reduced.

Operations

Restart Mochi to apply the levels migration. Run bun run deploy-commands to register /rank and /levels. Guild Messages and Message Content intents are required for message XP; Mochi already requests both. Enable Message Content in the Discord developer portal if it is not already enabled.

Settings, XP, cooldowns, pending rewards, and adjustment history are stored in SQLite. Run one Mochi process. Changes are serialized per server in that process. Protect the database and its backups. Disabling the plugin keeps stored data.

Voice XP

Voice XP starts disabled. Enable it in XP settings and select 1 to 100 XP per minute. The default rate is 5 XP.

A standard voice channel needs at least two eligible human members. Bots, muted members, deafened members, and the server AFK channel do not qualify. The channel, category, and role exclusion lists apply. Stage channels do not earn XP.

Mochi samples activity each minute. A member needs two consecutive samples in the same channel. Voice state changes reset that member's sample. Long gaps and offline time do not earn XP. Voice XP uses the same level curve and role rewards. It does not send level announcements.

Mochi requests the Guild Voice States intent. This intent is not privileged. No voice connection or audio recording is used.