API Reference
💫 Sparks Reference
Spark paths match the Canvas autocomplete — context from triggers and spells, flow sparks from upstream pieces, library values from Booster Packs.
📐Under the hood — Usage
TypeScript
// Use {{path}} in any string config field on a Piece node.
// Example: "Hello {{input.user.name}}, you have {{score}} points!"
//
// Spell context: input.user.id, input.user.name, input.guild.id, input.options.*
// Event context: varies by trigger — see each event reference page
// Flow sparks: named by upstream pieces ({{result}}, {{score}}, {{item}})💡Good to know
Wrap paths in {{double curly braces}}. Missing paths resolve to an empty string at runtime.
🪄Context sparks (Spells)
Available in every spell flow from the first node.
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{input.user.id}} | string | Who ran the command — Discord ID |
{{input.user.name}} | string | Who ran the command — username |
{{input.user.displayName}} | string | Who ran the command — nickname in this server |
{{input.channel.id}} | string | The channel this command was used in |
{{input.channel.name}} | string | The channel's name |
⏱️Context sparks (Timers)
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{timestamp}} | string | Current time in ISO format |
{{date}} | string | Today's date |
⚡Context sparks (Triggers)
Paths differ by event type — open a trigger reference for the full list.
🟢 Bot is ready →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
👋 Member joins →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{member.id}} | string | The new member's Discord ID |
{{member.username}} | string | Their Discord username |
{{member.displayName}} | string | Their nickname in this server, or username if none |
{{member.name}} | string | Their username (alias for member.username) |
{{member.joinedAt}} | string | When they joined (ISO timestamp) |
👋 Member leaves →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{member.id}} | string | The member who left — their Discord ID |
{{member.username}} | string | Their username |
{{member.displayName}} | string | Their display name (may be unavailable if uncached) |
{{member.name}} | string | Their username (alias for member.username) |
🔨 Member banned →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{ban.user.id}} | string | Discord ID of the banned user |
{{ban.user.username}} | string | Username of the banned user |
{{ban.reason}} | string | Reason provided for the ban (may be empty) |
🔓 Member unbanned →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{ban.user.id}} | string | Discord ID of the unbanned user |
{{ban.user.username}} | string | Username of the unbanned user |
💬 Message sent →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{message.id}} | string | The message's unique ID |
{{message.content}} | string | The full text of the message |
{{message.channelId}} | string | ID of the channel the message was sent in |
{{message.author.id}} | string | Discord ID of who sent the message |
{{message.author.username}} | string | Sender's Discord username |
{{message.author.displayName}} | string | Sender's display name in this server (nickname or username) |
{{message.author.name}} | string | Sender's username (alias for message.author.username) |
{{channel.id}} | string | ID of the channel (same as message.channelId) |
{{channel.name}} | string | Name of the channel |
🗑️ Message deleted →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{message.id}} | string | The deleted message's ID |
{{message.content}} | string | The deleted message's text (empty if message was not cached) |
{{message.channelId}} | string | ID of the channel the message was in |
{{message.author.id}} | string | Who sent the message (may be empty for uncached messages) |
{{message.author.name}} | string | Sender's username (may be empty for uncached messages) |
{{channel.id}} | string | ID of the channel (same as message.channelId) |
✏️ Message edited →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{oldMessage.content}} | string | The message before the edit (empty if uncached) |
{{newMessage.content}} | string | The message after the edit |
{{message.id}} | string | The message's unique ID |
{{message.author.id}} | string | Discord ID of who sent the message |
{{message.author.name}} | string | Author's username |
{{message.channelId}} | string | ID of the channel |
{{channel.id}} | string | ID of the channel (same as message.channelId) |
{{channel.name}} | string | Name of the channel |
😀 Reaction added →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{reaction.emoji}} | string | The emoji that was reacted with |
{{reaction.userId}} | string | Discord ID of who reacted |
{{reaction.messageId}} | string | ID of the message that was reacted to |
{{reaction.channelId}} | string | ID of the channel where the reaction happened |
😶 Reaction removed →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{reaction.emoji}} | string | The emoji that was removed |
{{reaction.userId}} | string | Discord ID of who removed the reaction |
{{reaction.messageId}} | string | ID of the message |
{{reaction.channelId}} | string | ID of the channel |
🎙️ Voice state changes →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{voice.userId}} | string | Discord ID of the user who changed voice state |
{{voice.channelId}} | string | Voice channel ID (empty string if they left) |
{{voice.joined}} | boolean | True when the user joined a voice channel |
{{voice.left}} | boolean | True when the user left a voice channel |
⚡ Interaction received →
| Path | Type | Description |
|---|---|---|
{{input.guild.id}} | string | Your Discord server's unique ID |
{{input.guild.name}} | string | Your server's name |
{{input.guild.memberCount}} | string | How many members are in the server |
{{interaction.user.id}} | string | Discord ID of who triggered the interaction |
{{interaction.user.username}} | string | Username of the person who triggered the interaction |
{{interaction.channelId}} | string | ID of the channel the interaction came from |
{{interaction.type}} | string | Interaction type (ChatInputCommand, Button, SelectMenu, etc.) |
📥Option spark shapes (by Discord type)
| Discord type | type int | Sub-paths |
|---|---|---|
| STRING | 3 | — |
| INTEGER | 4 | — |
| BOOLEAN | 5 | — |
| NUMBER | 10 | — |
| USER | 6 | .id .username .displayName |
| CHANNEL | 7 | .id .name |
| ROLE | 8 | .id .name |
📝Flow sparks (from Pieces)
Downstream pieces expose sparks by the name you configure (as / name fields).
| Path | Type | Description |
|---|---|---|
{{<name>}} | varies | Named spark you set — use {{score}}, not vars.score |
{{<as>}} | array | All matching rows — e.g. {{result}} |
{{<as>.length}} | number | Number of rows returned |
{{<as>.0.<column>}} | varies | First row column — e.g. {{result.0.coins}} |
{{<as>}} | varies | Current loop item — name from “Call each item” field |
{{<as>}} | string | number | Result spark named in the piece config |
See each Piece reference for the exact sparks it adds.
🎴Library sparks (Packs)
| Path | Type | Description |
|---|---|---|
{{lib.filter.profanity}} | array | Array of common profanity and strong language |
{{lib.filter.slurs}} | array | Array of racial, ethnic, and identity-based slurs |
{{lib.filter.spam_phrases}} | array | Array of common spam and scam phrases |
{{lib.filter.discord_invite}} | string (regex) | Regex — detects Discord invite links (discord.gg/...) |
{{lib.filter.external_links}} | string (regex) | Regex — detects any http or https URL |
{{lib.filter.excessive_caps}} | string (regex) | Regex — detects 4+ consecutive uppercase characters (SHOUTING) |
{{lib.validate.email}} | string (regex) | Regex — validates email address format (user@domain.tld) |
{{lib.validate.url}} | string (regex) | Regex — validates http/https URLs |
{{lib.validate.phone}} | string (regex) | Regex — validates international phone numbers (E.164 style, optional +) |
{{lib.validate.discord_id}} | string (regex) | Regex — validates Discord snowflake IDs (17–20 digit numbers) |
{{lib.validate.discord_invite}} | string (regex) | Regex — validates a Discord invite link or code |
{{lib.validate.hex_color}} | string (regex) | Regex — validates hex color codes (#RGB or #RRGGBB) |
{{lib.validate.ip_address}} | string (regex) | Regex — validates IPv4 addresses (0.0.0.0 – 255.255.255.255) |
{{lib.validate.number_only}} | string (regex) | Regex — validates that a string contains only digits (0–9) |