discord / action / schema v1
Leveling
Attach to a Message trigger: awards XP per message, tracks levels automatically, announces level-ups and can grant roles at chosen levels, no other nodes needed.
Prerequisites
- Add the discord plugin inside this workflow.
Parameters
| Parameter | Type | Description |
|---|---|---|
ServerguildId | discord_guild Required | XP is tracked separately per server. |
XP per messagexpAmount | number Required Default: | The exact amount, or the MINIMUM of a range if "Maximum XP" below is also set. |
Maximum XP (optional)xpAmountMax | number Optional | Set this higher than "XP per message" to award a random amount in that range each time (e.g. 15-25), instead of the same flat amount every message. Harder to game by spamming short messages. Leave empty for a flat amount. |
XP needed per levelxpPerLevel | number Required Default: | Level = total XP ÷ this number, rounded down. E.g. 100 → level 3 at 300 XP. |
Cooldown between XP gainscooldownSeconds | number Optional Default: | A member only earns XP once per this many seconds, however often they message. |
No-XP channelsexcludedChannelIds | discord_channel Optional | Messages in these channels never earn XP. E.g. a #bot-commands or #rules channel. |
Level-up announcement channelannounceChannelId | discord_channel Optional | Leave empty to announce in the same channel the message was sent in. Ignored when "Silent level-ups" is on. |
Level-up messagelevelUpMessage | textarea Optional | {{user}} is replaced with a mention, {{level}} with the new level, {{rank}} with their place on the server board. Filled in by this node when someone levels up. |
Silent level-upssilent | boolean Optional | Grant role rewards without posting a level-up announcement anywhere. |
Roles that earn no XPnoXpRoleIds | discord_role Optional | Members holding any of these never gain XP. E.g. a muted role, or bots given a role. |
Bonus XP rolesxpBoostRoleIds | discord_role Optional | Members holding any of these earn more per message: boosters, subscribers, veterans. |
Bonus multiplierxpBoostMultiplier | number Optional Default: | What "Bonus XP roles" multiply the award by. 2 = double. Holding several bonus roles still multiplies once, not once per role. |
Role rewardsroleRewards | level_role_map Optional | Grant a role the first time a member reaches each level. |
Keep reward roles from earlier levelsstackRoleRewards | boolean Optional Default: | On (default): a member collects every reward role they pass. Off: reaching a new reward level swaps the previous one out, so a member wears only their highest rank. |
Inputs and outputs
Inputs
execute- Execute (input)
Outputs
done- Done (output)xp- Total XP (output)level- Level (output)leveled_up- Leveled up? (output)rank- Rank on the server (output)error- Error (output)
No detailed data schema is declared. Inspect a test run to see its result.
Examples and troubleshooting have not yet been reviewed for this contract.
Version and compatibility
This reference follows the current authoring contract. Existing workflows retain their saved node revisions.
Contract identifier
fcabced76206bb6b4bc16115f05e67cc8f67639325198fe57a2383d0e61e8892