Documentation / Levels and XP / Coin Flip
On this page
Overview A Mokito Premium feature How the game works Win and loss Clamping on a loss Wagers do not count as messages Arguments Example Winning flip Losing flip Channel Restrictions Whitelist Blacklist Clearing the restriction The Coin Flip page Limits & Edge Cases

XP & Levels — Coin Flip Premium

A wager-based mini-game: a member bets an amount of their own XP on a coin flip. A correct guess wins the wager; a wrong guess loses it. The result is posted as a public embed so the whole channel can see the flip.

Overview

Coin Flip is one of the five mini-games in the XP & Levels category, which is Mokito Premium-only. Members run the /coin-flip slash command, pick a side (heads or tails), and bet an amount of XP. A 50/50 random roll decides the outcome. Winning adds the wager to the member's XP; losing removes it (but never below zero).

There is no XP range, no cooldown, and no minimum level to play — the member chooses the wager at call time, and the command is always available (subject to channel restrictions). The only server-side configuration is the channel whitelist/blacklist, which controls where /coin-flip is allowed to run.

A Mokito Premium feature

The entire XP & Levels category is Premium-only. In a server without Premium, running /coin-flip produces an ephemeral reply visible only to the caller: "XP & Levels is a Mokito Premium feature. Ask the server owner to subscribe to Premium to enable this command." No wager is taken, no XP changes, and no embed is posted to the channel.

How the game works

When a member runs /coin-flip with a wager and a side, Mokito:

  1. Validates that the server has Premium and that the command is allowed in the current channel.
  2. Checks the wager is a positive integer (≥ 1) and the side is Heads or Tails.
  3. Rolls a fair 50/50 coin (0 = heads, 1 = tails).
  4. Loads the member's current XP (0 if they have no XP yet).
  5. Applies the outcome and recomputes the member's level.
  6. Posts a public embed to the channel showing the pick, the result, the wager, the XP change, the new total, and the level.

The embed is never ephemeral — everyone in the channel sees the flip and the outcome.

Win and loss

Clamping on a loss

If a member wagers more XP than they currently have, they cannot go negative. The loss is clamped to their current balance — only the available XP is actually removed. The embed always displays the wager the member bet, but the "XP Change" field reflects the realized (clamped) delta. For example, a member with 30 XP who wagers 100 and loses will see "Wager: 100 XP" and "XP Change: −30 XP" — they lose exactly what they had.

Wagers do not count as messages

A coin flip does not increment the member's "Messages Sent" stat. This means the average XP per message (shown on /profile) is not inflated by wager activity. Only genuine chat messages earn per-message XP; the coin flip moves XP independently.

Arguments

The command takes two required arguments, presented as native Discord slash-command options:

ArgumentTypeRequiredWhat it means
wagerINTEGERYesThe amount of XP to bet. Must be a positive integer (≥ 1). The Discord client enforces a minimum of 1; the server also rejects zero or negative values as a safety check.
sideSTRINGYesThe side the coin must land on. Two choices: Heads or Tails.

Example

Winning flip

/coin-flip wager: 50 side: Heads
🪙 Coin Flip 🎉  (green embed)
Your Pick:    Heads
Result:       Heads
Wager:        50 XP
XP Change:    +50 XP
New Total XP: 1,290
Level:        7
XP & Levels · Mokito Test Server

Losing flip

/coin-flip wager: 100 side: Tails
🪙 Coin Flip 💸  (red embed)
Your Pick:    Tails
Result:       Heads
Wager:        100 XP
XP Change:    −100 XP
New Total XP: 1,140
Level:        6
XP & Levels · Mokito Test Server

The embed always shows the member's Discord avatar as the thumbnail. On a loss, the level may drop — Mokito recomputes the member's level after applying the XP change, and a large enough loss can demote the member to a lower level.

Channel Restrictions

The XP & Levels → Coin Flip page in the guild dashboard lets you restrict which channels allow /coin-flip. This is the only configuration available for this game — there is no XP-range, cooldown, or enable/disable toggle, because the wager is always chosen by the member at call time.

There are three modes:

Whitelist

Choose "Whitelist (only selected channels)" from the restriction mode dropdown, then add the allowed channels to the channel list. The channel picker is a type-to-search input that lists text and announcement channels; selected channels appear as removable chips below the input. Only the channels listed here can run the command. Running /coin-flip in a non-whitelisted channel produces an ephemeral "This command is not allowed in this channel" reply visible only to the caller.

Blacklist

Choose "Blacklist (all except selected channels)" and add the channels where /coin-flip should be blocked. The command works everywhere except those channels. Running it in a blacklisted channel produces the same ephemeral rejection.

Whitelist and blacklist are mutually exclusive. You can use one or the other, not both. Switching from one mode to the other replaces the previous restriction entirely.

Clearing the restriction

The "Clear restrictions" button resets the mode to "No restriction" and removes all selected channels. The command then works in every channel again. Changes take effect within about 60 seconds.

The Coin Flip page

The page is accessible to the server owner, managers, and Mokito admins only. Non-premium guilds are redirected to the Premium subscription page. The page has a single widget — the channel restriction form — with the restriction mode dropdown, the channel search input, the selected channel chips, and two buttons at the bottom: "Clear restrictions" and "Save restrictions."

Limits & Edge Cases

LimitDetail
Wager rangeAny positive integer (≥ 1). There is no upper bound on the wager — a member can wager more than their current XP, but the loss is clamped to their balance.
OddsExactly 50/50. The coin is a fair random roll.
Going negativeImpossible. XP is clamped at 0 on a loss. A member can never owe XP.
Level on a lossCan drop. Mokito recomputes the level after every flip; a large loss may demote the member.
CooldownNone. A member can flip as often as they like, subject only to channel restrictions.
Channel restriction cacheAbout 60 seconds. After changing the restriction, allow up to a minute for the new rule to take effect.
VisibilityThe embed is public — everyone in the channel sees the flip. Rejection messages (premium, channel, invalid wager) are ephemeral — only the caller sees them.
Message statNot incremented. Wagers do not count as messages for the purposes of /profile or the average XP per message.
Premium lapseIf the server's Premium subscription lapses, /coin-flip returns the Premium-required ephemeral reply. All channel restriction settings are preserved and resume when the server re-subscribes.