Meta
Events & Placeholders
Bot Creator bots react to Discord events (messages, joins, button clicks) and resolve dynamic values through the ((...)) template system.
Event-driven workflows
Commands are not the only entry point. You can attach logic to Discord events such as:
| Event family | Typical use |
|---|---|
messageCreate |
Auto-moderation, keyword triggers |
guildMemberAdd |
Welcome messages, auto-roles |
interactionCreate |
Buttons, select menus, modals, slash commands |
voiceStateUpdate |
Voice channel logging |
Configure events in the Bot Creator app under Events. Each event workflow runs in its own context with event-specific placeholders available.
Placeholders ((...))
Placeholders insert runtime values into messages, embeds, and action parameters. They are resolved when the bot executes — not at design time.
$sendMessage[Welcome ((user.username))! You joined ((guild.name)).]
Core placeholder families
| Prefix | Examples |
|---|---|
((user.*)) |
((user.id)), ((user.username)), ((user.avatar)) |
((member.*)) |
((member.nick)), ((member.joinedAt)), ((member.roles)) |
((guild.*)) |
((guild.name)), ((guild.memberCount)) |
((channel.*)) |
((channel.id)), ((channel.name)) |
((message.*)) |
((message.content)), ((message.id)) |
((interaction.*)) |
((interaction.customId)), ((interaction.kind)) |
((opts.*)) |
((opts.reason)), ((opts.target.id)) (Slash command options) |
Interaction placeholders
When a user clicks a button or submits a modal, interaction placeholders are populated automatically.
BDScript (BDFD):
$if[((interaction.kind))==button]
$ephemeral
Clicked: ((interaction.customId))
$endif
Blocks:
{
"type": "respondWithMessage",
"payload": {
"content": "Clicked: ((interaction.customId))",
"ephemeral": true
}
}
See Interactions overview for component-specific patterns.
Full reference
| Resource | Scope |
|---|---|
| Template system | Complete ((...)) syntax, fallbacks, JSONPath, inline functions |
| Exhaustive event variables guide | Every variable per event type |
| JavaScript placeholders | BDJS usage of ((...)) patterns |
BDScript vs JavaScript
- BDScript: placeholders work directly in
$sendMessage, embed fields, and component payloads. - JavaScript: use template strings or read resolved values from the
variablesobject. See variables.
Next steps
- Register persistent variables in the app panel before using
$getUserVar— see the Database variables guide. - Build your first event workflow with Create Your First Command.