A Discord leveling bot (XP and leaderboard), built from blocks
Bot Creator has no ready-made leveling block. What it gives you is the parts: events, per-member variables, a calculator and a block that lists a variable's values sorted, which is all an XP system and a leaderboard need.
How to build it
- Create a command with an Event trigger on Message Create. Start with Stop Unless Condition (continue only if
((author.isBot))is false) so bots earn nothing. - Read the member’s XP with Get variable (scope: each member, per server; store it as
xp), then add to it with Calculate (for example((xp))+5) and save it with Set variable. - Add the level rule you want (for example with an IF / ELSE Block comparing the value) and congratulate the member with Send Message.
- For the leaderboard, create a Slash command
/topwith List a variable’s values (scope: each member, sorted descending, up to 25 per call) and show the result with Respond with Message.
Blocks you will use
Block names are the ones of the app; each links to its entry in the dictionary.
- Stop Unless Condition — Stops the flow unless a condition holds, which is how you filter out bots.
- Get variable (per server, member…) — Reads a variable stored per server, member, user, channel or message.
- Calculate — Does the arithmetic and stores the result.
- Set variable (per server, member…) — Writes the variable back, optionally with an expiry.
- List a variable’s values (per server, member…) — Lists the values of a variable sorted, 1 to 25 items per call.
- IF / ELSE Block — Branches on a condition, for level-up rules.
What to know
- You design the formula and the level thresholds yourself; nothing is preset.
- Every message runs the flow, so keep it short. The Cooldown block exists but is described for commands; check that it fits your event before relying on it.
- A leaderboard call returns at most 25 entries.