K
Docs
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.

PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{input.user.id}}stringWho ran the command — Discord ID
{{input.user.name}}stringWho ran the command — username
{{input.user.displayName}}stringWho ran the command — nickname in this server
{{input.channel.id}}stringThe channel this command was used in
{{input.channel.name}}stringThe channel's name

⏱️Context sparks (Timers)

PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{timestamp}}stringCurrent time in ISO format
{{date}}stringToday's date

Context sparks (Triggers)

Paths differ by event type — open a trigger reference for the full list.

🟢 Bot is ready
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
👋 Member joins
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{member.id}}stringThe new member's Discord ID
{{member.username}}stringTheir Discord username
{{member.displayName}}stringTheir nickname in this server, or username if none
{{member.name}}stringTheir username (alias for member.username)
{{member.joinedAt}}stringWhen they joined (ISO timestamp)
👋 Member leaves
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{member.id}}stringThe member who left — their Discord ID
{{member.username}}stringTheir username
{{member.displayName}}stringTheir display name (may be unavailable if uncached)
{{member.name}}stringTheir username (alias for member.username)
🔨 Member banned
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{ban.user.id}}stringDiscord ID of the banned user
{{ban.user.username}}stringUsername of the banned user
{{ban.reason}}stringReason provided for the ban (may be empty)
🔓 Member unbanned
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{ban.user.id}}stringDiscord ID of the unbanned user
{{ban.user.username}}stringUsername of the unbanned user
💬 Message sent
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{message.id}}stringThe message's unique ID
{{message.content}}stringThe full text of the message
{{message.channelId}}stringID of the channel the message was sent in
{{message.author.id}}stringDiscord ID of who sent the message
{{message.author.username}}stringSender's Discord username
{{message.author.displayName}}stringSender's display name in this server (nickname or username)
{{message.author.name}}stringSender's username (alias for message.author.username)
{{channel.id}}stringID of the channel (same as message.channelId)
{{channel.name}}stringName of the channel
🗑️ Message deleted
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{message.id}}stringThe deleted message's ID
{{message.content}}stringThe deleted message's text (empty if message was not cached)
{{message.channelId}}stringID of the channel the message was in
{{message.author.id}}stringWho sent the message (may be empty for uncached messages)
{{message.author.name}}stringSender's username (may be empty for uncached messages)
{{channel.id}}stringID of the channel (same as message.channelId)
✏️ Message edited
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{oldMessage.content}}stringThe message before the edit (empty if uncached)
{{newMessage.content}}stringThe message after the edit
{{message.id}}stringThe message's unique ID
{{message.author.id}}stringDiscord ID of who sent the message
{{message.author.name}}stringAuthor's username
{{message.channelId}}stringID of the channel
{{channel.id}}stringID of the channel (same as message.channelId)
{{channel.name}}stringName of the channel
😀 Reaction added
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{reaction.emoji}}stringThe emoji that was reacted with
{{reaction.userId}}stringDiscord ID of who reacted
{{reaction.messageId}}stringID of the message that was reacted to
{{reaction.channelId}}stringID of the channel where the reaction happened
😶 Reaction removed
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{reaction.emoji}}stringThe emoji that was removed
{{reaction.userId}}stringDiscord ID of who removed the reaction
{{reaction.messageId}}stringID of the message
{{reaction.channelId}}stringID of the channel
🎙️ Voice state changes
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{voice.userId}}stringDiscord ID of the user who changed voice state
{{voice.channelId}}stringVoice channel ID (empty string if they left)
{{voice.joined}}booleanTrue when the user joined a voice channel
{{voice.left}}booleanTrue when the user left a voice channel
Interaction received
PathTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{interaction.user.id}}stringDiscord ID of who triggered the interaction
{{interaction.user.username}}stringUsername of the person who triggered the interaction
{{interaction.channelId}}stringID of the channel the interaction came from
{{interaction.type}}stringInteraction type (ChatInputCommand, Button, SelectMenu, etc.)

📥Option spark shapes (by Discord type)

Discord typetype intSub-paths
STRING3
INTEGER4
BOOLEAN5
NUMBER10
USER6.id .username .displayName
CHANNEL7.id .name
ROLE8.id .name

📝Flow sparks (from Pieces)

Downstream pieces expose sparks by the name you configure (as / name fields).

PathTypeDescription
{{<name>}}variesNamed spark you set — use {{score}}, not vars.score
{{<as>}}arrayAll matching rows — e.g. {{result}}
{{<as>.length}}numberNumber of rows returned
{{<as>.0.<column>}}variesFirst row column — e.g. {{result.0.coins}}
{{<as>}}variesCurrent loop item — name from “Call each item” field
{{<as>}}string | numberResult spark named in the piece config

See each Piece reference for the exact sparks it adds.

🎴Library sparks (Packs)

PathTypeDescription
{{lib.filter.profanity}}arrayArray of common profanity and strong language
{{lib.filter.slurs}}arrayArray of racial, ethnic, and identity-based slurs
{{lib.filter.spam_phrases}}arrayArray 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)
Packs docs →