Bot Creator Documentation
Everything you need to build Discord bots — BDFD $functions, JavaScript scripting, and step-by-step guides.
Blocks Reference
Visual actions, payloads, results, permissions and control flow.
BrowseBDFD Function Reference
Syntax and parameters for every $function.
BrowseJavaScript API
db.*, interaction, message, and script globals for BDJS.
BrowseGuides & Tutorials
Step-by-step walkthroughs from token setup to advanced patterns.
BrowseGetting Started
Getting Started
Building Commands
Loops in BDFD: $for & $loop
Building CommandsHandling Rich Interactions in Bot Creator: Buttons, Select Menus, and Modals
Building CommandsModular Commands: `$callWorkflow` & `$workflowResponse` in BDFD
Building CommandsBDFD Buttons and Select Menus: $addButton and $newSelectMenu
Building CommandsDesigning Stunning Discord Embeds in BDFD
Reference & Deployment
Advanced Topics
JavaScript API
Script globals for BDJS bots — db.*, interaction, message, and more.
Blocks
(6)Create Channel, Edit Channel Permissions and Remove Channel with the real blocks of the app; expl...
IF / ELSE, nested blocks, For Loop, Wait, Stop Execution and Run Workflow, shown with the real bl...
Every block of the Bot Creator app as it appears in the editor, with its real name, category, fie...
Respond with Message versus Send Message; content, embeds, channels and interaction context, show...
How the Bot Creator Blocks editor works. What a block looks like, how its fields behave, and thre...
Robust, production-ready Discord ticket system. Private channel creation, granular permission man...
Embed & Message
(32)Adds a field to a Discord embed. The fields help structure information as name/value pairs in the...
Adds a file component (Components V2) to the message being built.
Adds a thumbnail component (Components V2). After $addSection it becomes the accessory of that se...
Adds the current date and time as the timestamp of a Discord embed. The optional argument is the ...
Restricts which roles can be pinged by the message to the listed role IDs. Without any ID, no rol...
Restricts which users can be pinged by the message to the listed user IDs. Without any ID, no use...
Sets the author name of a Discord embed. The author appears at the very top of the embed, above t...
Modifies the icon (avatar) of the author of an embed after it has been set with $author[]. Allows...
Returns the ID of the author of a specific message, identified by its channel ID and its message ID.
Modifies the destination URL of the author of an embed. Makes the author's name clickable without...
Sets the color of the left sidebar of a Discord embed. The color can be specified in hexadecimal ...
Schedules the deletion of the command's main response after a delay (at most 40 minutes).
Sets the main body (description) of a Discord embed. This is the main text area, located below th...
Redirects the response of the current command to the private messages (DM) of one or several user...
Returns the DM channel ID stored in the command context for the user (variable user.dmChannelId),...
Schedules, after a delay, the replacement of the embed of the message sent by the current command...
Schedules the editing of the message sent by the current command, after a delay, with the given n...
Sets the clickable URL of an embed's title. When the user clicks on the title of the embed, they ...
Sets the footer text of a Discord embed. The icon is set separately with $footerIcon. The footer ...
Modifies the footer icon of an embed after it has been defined with $footer[]. Allows changing on...
Sets the main image of a Discord embed. The image appears at the bottom of the embed, below the f...
Disables all mention notifications of the response, including mentions written on purpose.
Pauses the execution of the command for the given duration (at least 1 second, at most 40 minutes...
Sends a message with an embed built from its own arguments to a specific channel. Every field aft...
Explicit message send of a separate channel message; ordinary slash replies can use text or embed...
Sets the thumbnail of a Discord embed. The thumbnail is a small square image displayed at the top...
Sets the title of a Discord embed. The title appears at the top of the embed, in bold and with a ...
Sets a tts flag on the command's main response. In the current engine the flag is not read when t...
Variables
(42)Returns the number of arguments passed to the current command, or the number of words of a given ...
Reads message.content, drops its first word, and returns the remaining words joined by spaces, or...
Validates the number of arguments passed to the command and stops execution with an error message...
Stops the command when its first argument is no (or false), optionally replacing the output with ...
Reads the value of a channel-scoped variable. Returns the stored value for the current channel, o...
Reads the value of a guild-member-scoped variable. Alias: $getMemberVar. Returns the stored value...
Reads the value of a guild-scoped variable. Alias: $getServerVar. Returns the stored value for th...
Returns the rank of a user in the ranking of a stored variable (user or globalUser).
Returns the entry (name, ID or value) found at a given position in the ranking of a stored variable.
Reads the value of a guild-member-scoped variable. Alias: $getGuildMemberVar. Returns the stored ...
Reads the value of a message-scoped variable. Returns the stored value for the current message, o...
Reads the value of a guild-scoped variable. Alias: $getGuildVar. Returns the stored value for the...
Reads the value of a user-scoped variable. Returns the stored value for the current user, or a sp...
Reads a global variable or a user-scoped variable from the bot's persistent storage.
Writes the top 10 of the global user values of a variable into the description of the first embed...
Returns the value submitted for a modal input, identified by its custom ID.
Returns the names of all the variables declared by the bot (all scopes and global variables), joi...
Gets the content of the message with user, role and channel mentions removed, or its nth word (th...
Resets a channel-scoped variable to its declared default value (as defined in the Bot Creator Var...
Resets the value of a global-user variable to its declared default, for every user or for one use...
Resets a guild-member-scoped variable to its default value (as defined in the Bot Creator Variabl...
Resets a guild-scoped variable to its declared default value (as defined in the Bot Creator Varia...
Resets a guild-member-scoped variable to its default value (as defined in the Bot Creator Variabl...
Resets a message-scoped variable to its declared default value, for every message or for a single...
Resets a guild-scoped variable to its declared default value (as defined in the Bot Creator Varia...
Resets the member-scoped value of a variable to its declared default value, for every member or f...
Ranks the servers by the value of a server variable and writes the top 10 into the description of...
Stores a value into a channel-scoped variable. Writes to the current channel's variable, or to a ...
Stores a value into a guild-member-scoped variable. Alias: $setMemberVar. Writes to the current m...
Stores a value into a guild-scoped variable. Alias: $setServerVar. Writes to the current server's...
Stores a value into a guild-member-scoped variable. Alias: $setGuildMemberVar. Writes to the curr...
Stores a value into a message-scoped variable. Writes to the current message's variable, or to a ...
Stores a value into a guild-scoped variable. Alias: $setGuildVar. Writes to the current server's ...
Stores a value into a user-scoped variable. Writes to the current user's variable, or to a specif...
Creates or updates a global variable or a user-scoped variable in the bot's persistent storage.
Encodes or decodes a text as a URL query component.
Changes the destination channel of the messages sent by the rest of the command ($sendMessage and...
Writes the top 10 of the members of the current server, ranked by a user variable, into the descr...
Reads or writes a temporary variable scoped to the current execution. In read mode (1 parameter),...
Stops the script and displays the message if the variable name is not declared.
Checks whether a variable with the given name is declared for the bot (the variables defined in t...
Counts the number of variables declared for a given type (user, globaluser, server or channel).
Control Flow
(34)Logical AND — returns "true" only if ALL provided conditions evaluate to true.
Opens a block, closed by $endAsync, that runs at the same time as the rest of the script. $await[...
Waits for the $async block of that name and returns the text it wrote. An error in the block is r...
Stores a pending "await" record for a user and channel. It does not suspend the script and nothin...
Leaves the innermost loop immediately.
Calls another workflow by name, optionally passing arguments. The called workflow executes, then ...
Sets the labels (days, hours, minutes, seconds) used by the %time% placeholders in the error mess...
Evaluates a condition (a comparison written as a single expression) and returns "true" or "false".
Checks whether a string contains a substring and returns "true" or "false".
Skips the rest of the current iteration and goes to the next one.
Enforces a cooldown on command execution. Three variants: $cooldown (per user and server), $serve...
Acknowledges the interaction (optionally ephemeral) when the script was not acknowledged beforeha...
Replaces the error message shown when a function fails with a custom error embed built from its a...
Closes a block opened by $async[name].
Dynamically parses and executes a string of BDFD code at runtime. The code is treated as a sub-sc...
Repeats a block, either once per listed value ($for[name;v1;v2;...]), a given number of times ($f...
Returns the remaining cooldown time in whole seconds (rounded up) for the current command, for th...
Alias of $loopIndex. Returns the current zero-based iteration index of the innermost loop ($for, ...
Conditional branching — executes blocks of code based on runtime condition evaluation.
Continues the current block at a given action number, skipping the actions in between. It only ju...
Returns the one-based count of the current iteration of the innermost loop.
Returns the zero-based index of the current iteration of the innermost loop.
Alias of $loopIndex. Returns the zero-based index of the current iteration of the innermost loop.
Condition guard that stops the script if the condition is false. An optional message replaces the...
Stops command execution if the given text does not contain all the listed words (case-insensitive...
Logical OR — returns "true" if at least one of the provided conditions evaluates to true (1 to 10...
Skips a specified number of subsequent actions in the current execution block.
Immediately ends the current script. What was written before it is still sent.
Sets the "suppress error logging" flag of the script. The engine does not read this flag, so it h...
Replaces the error response of the script with a text message (or with nothing when called withou...
Error handling block — catches runtime errors in the try body and allows graceful recovery or log...
Pauses the script for a duration (positive, at most 40 minutes) before continuing.
Repeats a block as long as a condition is true. The condition is checked before every iteration.
Returns the status or a named result of the last workflow run with $callWorkflow.
Entity Info
(149)Returns the ID of the AFK channel configured on the current Discord server. Raises an error if th...
Returns the AFK timeout of the server in seconds, for the current server or for the server whose ...
Returns the total number of members summed over all the servers the bot is in (bots included). Fo...
Returns the URL of the global avatar of the author of the message that triggered the command.
Returns the URL of the profile banner of the author of the message, or an empty string if there i...
Returns the Discord ID of the author of the message that triggered the command.
Returns the tag of the author: username#discriminator when the account has a discriminator, other...
Returns the username of the author of the command, as supplied by the command context.
Returns the number of boosts (premium subscriptions) of the current server, or of the server whos...
Returns the boost level (tier) of the current Discord server, as reported by Discord.
Returns the names of the commands registered on the bot, joined by the separator you provide.
Returns the number of bot accounts among the members of the current Discord server.
Returns the user ID of the bot.
Compatibility flag for the BDFD bot list description. It takes exactly one argument and has no ef...
Compatibility flag for the BDFD bot list. It takes no argument and has no effect in the engine.
Returns the username of the bot (`Bot` when the context does not provide it).
Returns the node identifier supplied by the host in the context (`bot.node`), or `1` when none is...
Returns the Discord ID of the owner of the bot.
Calculates and returns the number of bytes of a text string. Useful for checking the size of a me...
Returns the channels belonging to a specific category (names by default, or IDs, mentions or the ...
Returns the number of categories of the current Discord server, or of the server whose ID is given.
Returns the ID of the category with the given name.
Returns the ID of the parent category of a Discord channel.
Returns the total number of channels on the server.
Checks if a Discord channel with the given ID exists. Returns "true" or "false".
Without argument, returns the ID of the channel in which the command is executed (`none` in a DM)...
Returns the ID of a Discord channel from its name.
Returns "true" if the channel is marked as NSFW, "false" otherwise.
Returns the name of a Discord channel from its ID.
Returns a list of all channel names on the server, joined by the separator you provide.
Returns the position of a channel in the Discord channel list.
Returns the topic of the current Discord channel, or of the channel whose ID is given.
Returns the type of a Discord channel from its ID (text, voice, category, dm, etc.).
Sets the color of the first role mentioned in the message.
Returns the name of the folder containing the command currently being executed.
Returns the name of the command currently being executed.
Returns the trigger of the command currently being executed.
Returns how the current command was invoked, taken from the execution context (chatInput, user or...
Returns the number of commands stored for the bot (all trigger types).
Returns the creation date of a Discord entity (user, server, role, channel, message, etc.) from i...
Returns the discriminator of the given user, left-padded to 4 digits, for bot accounts; returns "...
Returns the global display name of a user (the author by default), or the username if the user ha...
Returns the number of custom emojis of the current server, or of the server whose ID is given.
Returns the execution time of the current command in milliseconds. Helps measure BDFD code perfor...
Searches for a channel of the current server by mention, ID or name (case-insensitive, exact name...
Searches for a role by ID, role mention or exact name and returns its ID. Case-sensitive on names.
Searches the members of the current server for a user by mention, ID or username (case-insensitiv...
Returns the URL of one attachment, selected by a 0-based index, of the message that triggered the...
Returns the custom status text supplied in the command context (user.customStatus); an empty stri...
Extracts the data of a specific field of an embed in a message. Allows reading the title, descrip...
Returns the total number of members on the server (including bots). Possible alias of $membersCount.
Returns the ID of a role of a user according to their index (position) in the member's list of ro...
Gets the slowmode value of a channel in seconds. Returns the minimum delay between two messages.
Returns the presence status (online, idle, dnd, offline) of the specified user.
Returns the URL of the banner of the Discord server whose ID is given. $serverBanner is the equiv...
Alias of $serverCount. Returns the total number of servers the bot is present on.
Checks if a server (guild) with the given ID exists and if the bot has access to it. Returns "tru...
Returns the unique identifier (Snowflake) of the current Discord server, or of a server of the bo...
Alias of $serverIcon. Returns the URL of the Discord server icon.
Alias of $serverName. Returns the name of the Discord server.
Returns the ID of the highest role of the server, or of the highest role of a given member.
Returns the ID of the highest role of the server that possesses all the specified permissions.
Returns the hosting expiration value supplied by the host application, or an empty string.
Returns the HypeSquad value supplied by the host in the user.hypesquad context variable, or an em...
Returns "true" if the given user has the Administrator permission on the server, and "false" othe...
Returns "true" if the user is a server booster (Nitro Boost), and "false" otherwise.
Returns "true" if the user (the author by default) is a bot, and "false" otherwise.
Returns "true" if the role is displayed separately in the member list, "false" otherwise.
Checks if a role is mentionable. Returns "true" or "false".
Returns "true" if the given user ID is among the users mentioned in the message, "false" otherwise.
Checks if a message was edited. Returns "true" or "false".
Returns "true" if the given user is currently timed out (temporarily muted) on the server, "false...
Returns the ID of the last message sent in the current channel.
Returns the Unix timestamp (in seconds) of the last pinned message in the current channel.
Returns the ID of the lowest role of the server, or of a given member. @everyone is the lowest ro...
Returns the ID of the lowest role of the server (in the role hierarchy) that possesses all the sp...
Returns the total number of members (users + bots) on the Discord server.
Returns true when the user is a member of the current server (or of the given server), false othe...
Returns the Discord ID of the member who triggered the command (member.id, else the author ID).
Returns the nickname of a member on the server, falling back to a display name or username when n...
Returns the permissions of the triggering member as supplied by the host in the member.permission...
Returns the total number of members on the Discord server, or only those with a given presence. W...
Returns the ID of the user mentioned at the given position in the message (1, < for the first, > ...
Returns the ID of the channel mentioned at the given position in the message (1, < for the first,...
Returns the ID of the role mentioned at the given position in the message (1, < for the first, > ...
Returns the list of all user IDs mentioned in the message, separated by commas.
Returns the text that follows the command, or one of its words, or the value of a named slash-com...
Returns the Unix timestamp (in seconds) of the last edit of a message, or an empty string if it h...
Returns the ID (snowflake) of the message that triggered the command.
Returns the creation timestamp of the triggering message (host-supplied, milliseconds for message...
Returns the type of the triggering message as an integer (0 = normal message, 7 = member joined, ...
Returns the jump URL (direct link) to the triggering message.
Returns the server nickname of a user, or their display name (global name, else username) if they...
Returns the version string supplied by the host in bot.nodeVersion, or v20.0.0 when the host supp...
Returns the online member count supplied by the host in guild.onlineMembers or, when there is non...
Alias of $channelCategoryID. Returns the ID of a channel's parent category.
Returns the premium expiration value supplied by the host in premium.expireTime, or an empty string.
Returns the ID of the message that a given message replies to. Without argument, uses the message...
Returns the total number of roles on the Discord server.
Checks if a role exists on the server. Returns "true" or "false".
Returns the ID of a Discord role from its exact name in the current server.
Writes the information of the first role mentioned in the message into the embed description, usi...
Lists the members of the current server who have a role, as IDs, mentions or usernames.
Returns the name of a Discord role from its ID.
Returns the list of all role names of the current server, separated by commas.
Returns the permissions of a Discord role as a text list.
Returns the hierarchical position of a role in the server's role list.
Returns the ID of the rules channel of the server. Raises an error when the server has no rules c...
Returns the scripting language of the interpreter running the script.
Returns the URL of the banner of the current server, or of the server whose ID is given. Empty st...
Returns the number of active Nitro boosts on the Discord server.
Checks if a channel (or active thread) with a given name or ID exists on the current server. Retu...
Returns the total number of servers the bot is present in.
Returns the description of the current Discord server, or of the server whose ID is given.
Returns the list of custom emojis of a Discord server, joined by a separator.
Tells whether the bot can see the server with the given ID.
Returns the server features list supplied by the host in the guild.features context variable, or ...
Returns the unique identifier (Snowflake) of the Discord server where the command was executed.
Returns the URL of the icon of the current Discord server, or of the server whose ID is given.
Returns the runtime value `guild.info` of the current context, or an empty string when none is pr...
Returns the name of the server (guild) in which the command is executed.
Returns the names of the servers in which the bot is present (10 by default, -1 for all), separat...
Returns the identifier (ID) of the owner of the current Discord server, or of the server whose ID...
Returns the server region supplied by the host in the guild.region context variable, or an empty ...
Returns the invite splash value supplied by the host in the guild.splash context variable, or an ...
Returns the vanity URL code supplied by the host in the guild.vanityUrlCode context variable, or ...
Returns the verification level of the server as a label (None, Low, Medium, High, Very High).
Returns the shard of the bot, or the shard that serves the given server.
Returns the number of global slash (chat input) commands registered on Discord for the bot.
Returns the Discord ID of the slash command being executed, or of the global slash command with t...
Sets the slowmode delay of a Discord channel (write function). To read the current value, use $ge...
Returns the sticker count supplied by the host in the guild.stickerCount context variable, or 0.
Returns the identifier (ID) of the system messages channel configured on the Discord server (welc...
Returns the global avatar URL of a user. For the author of the command, use $authorAvatar.
Returns the badge names of a user (the author by default), separated by a space unless a separato...
Returns the URL of the profile banner of a user. For the author of the command, use $authorBanner.
Returns the banner color of a user in hexadecimal format (RRGGBB, without
Checks if a user ID can be resolved by the bot and returns "true" or "false". Only numeric IDs ar...
Returns the Discord ID of the user of the execution context, or of the server member found by use...
Formats the information of the first mentioned user (or of the author) into the description of th...
Returns the date when a user joined the current Discord server, formatted with a Go time layout.
Returns the creation date of a Discord account (the registration date on the platform), derived f...
Returns the global Discord username of the user who triggered the command, or of the user whose I...
Returns the permissions granted to a user by their roles on the current server, as a list of names.
Checks if a specific user reacted with a given emoji on a message. Returns true or false.
Returns the names of the roles assigned to the user on the current server, one per line.
Returns the URL of the member's server-specific avatar, or their global avatar if none is set. Th...
Returns the username of a user (the author by default); for bot accounts, the tag in the form "us...
Returns the IDs of the members of the current server who have a role, joined by a separator (defa...
Components & Interactions
(62)Starts a new action row for buttons.
Adds an interactive button to a message (legacy style).
Adds an interactive or link button to the response, in the current action row or a chosen one.
Adds a string select dropdown menu to a message.
Makes the response visible only to the user who triggered the interaction.
Adds an option to a checkbox group of the modal being built. An empty menuId targets the last che...
Starts a Components V2 container that groups the components added after it, with an optional acce...
Starts a Components V2 media gallery. Images are added with $addMediaGalleryItem[].
Adds an element (image) to a media gallery. If galleryId is omitted, the element is added to the ...
Adds an individual checkbox to the modal being built.
Creates a checkbox group in the modal being built. The individual options are added using $addChe...
Adds a file upload component (Components V2) to the modal being built.
Creates a group of radio buttons in the modal being built. Options are added using $addRadioGroup...
Adds a select menu (Components V2) to the modal being built. Options are added with $addSelectMen...
Displays a static informational text in a modal. This component is not interactive — it only serv...
Adds a Components V2 text input (wrapped in a label) to the modal being built. The style defaults...
Adds an option to a radio button group of the modal being built. An empty menuId targets the last...
Starts a section: text displays that can have a thumbnail. The text displays and the thumbnail ad...
Adds a classic text input to the modal being built with $newModal[]. The style must be "short" or...
Adds one suggestion to the answer of an option autocomplete script. Only usable in that script.
Returns the name of the option being typed in an autocomplete script.
Returns the text typed so far in the option, inside an autocomplete script.
Returns the custom ID (customId) of the interaction component that triggered the callback (button...
Modifies an existing button on a message. Replaces the label, style, disabled state, and emoji of...
Changes the accent color and the spoiler state of the n-th container of a Components V2 message.
After a delay, replaces the components of the response of the command with the Components V2 layo...
Replaces every component of a message sent by the bot with the Components V2 layout built before ...
Modifies the properties of an existing string select menu: placeholder text, minimum and maximum ...
Modifies an individual option in an existing string select menu.
Replaces the content of the n-th text display of a Components V2 message, in the response being b...
Replaces the n-th thumbnail of a Components V2 message (URL, description and spoiler).
Returns how many values were selected in a channel select menu.
Gets the ID of the channel selected by the user via a channel select menu. Allows getting the res...
Gets all channel IDs selected by the user via a channel select menu. Returns a list separated by ...
Returns how many values were selected in a mentionable select menu.
Gets one selected ID of the mentionable select menu that triggered the interaction. When users ar...
Gets all the IDs selected in a mentionable select menu, joined by a separator. When users are sel...
Returns how many values were selected in a role select menu.
Gets the ID of the role selected by the user via a role select menu.
Gets all role IDs selected by the user via a multi-select role menu.
Returns how many values were selected in a string select menu.
Gets the value of the option selected by the user in a string select menu.
Gets all option values selected in a multi-select string select menu.
Returns how many values were selected in a user select menu.
Gets the ID of the user selected via a user select menu.
Gets all user IDs selected via a multi-select user select menu.
Creates a new modal (interactive pop-up window) with a title and a custom identifier to handle su...
Removes all components from the response being built, or from an existing message sent by the bot.
Removes all buttons from the response being built, or from an existing message sent by the bot. O...
Removes a specific component from the response being built or from an existing message, using its...
Removes one option, identified by its value, from a string select menu.
HTTP & JSON
(35)Sets a header for the next HTTP request made with $httpGet, $httpPost, $httpPut, $httpPatch, $htt...
Sends an HTTP DELETE request (optionally with a body), stores the response for $httpStatus and $h...
Sends an HTTP GET request to the URL, stores the response for $httpStatus and $httpResult and ret...
Returns the value of a header of the response to the latest HTTP request.
Sends an HTTP HEAD request to a URL and keeps the response for $httpStatus.
Sends an HTTP PATCH request with an optional body, stores the response for $httpStatus and $httpR...
Sends an HTTP POST request with an optional body, stores the response for $httpStatus and $httpRe...
Sends an HTTP PUT request with an optional body, stores the response for $httpStatus and $httpRes...
Removes a header added with $httpAddHeader before the next HTTP request is sent.
Returns the body of the last HTTP response, or the JSON value found by following the given keys; ...
Returns the numeric HTTP status code of the most recent HTTP request (made with $httpGet, $httpPo...
With one argument starting with { or [, replaces the current JSON document and returns an empty s...
Converts the string stored at a path of the current JSON document into an array by splitting it o...
Appends a value to the end of the JSON array at a path of the current document; creates the array...
Returns the number of items in the JSON array at a path of the current document, or 0 if the valu...
Returns the position (zero-based) of a value in the JSON array at a path of the current document,...
Removes and returns the last item of the JSON array at a path of the current document; a missing ...
Reverses, in place, the JSON array at a path of the current document; a missing or non-array valu...
Removes and returns the first item of the JSON array at a path of the current document; a missing...
Sorts, in place, the JSON array at a path of the current document, ascending by default or descen...
Adds a value to the beginning of the JSON array at a path of the current document; creates the ar...
Empties the current JSON document, back to the state before any $jsonParse or $jsonSet, and retur...
Checks whether a path exists in the current JSON document and returns true or false (a key whose ...
Iterates over each key-value pair of the object, or each element of the array, found at a path of...
Returns the zero-based index of the current element during a $jsonForEach loop; an empty string o...
Joins the elements of the JSON array at a path of the current document into a string with the giv...
Returns the key of the current element during a $jsonForEach loop (the index for an array); an em...
Returns the keys of the JSON object at a path of the current document, joined by a separator (def...
Parses a JSON string into the current JSON document, replacing it; invalid JSON or a scalar gives...
Returns the current JSON document as indented, multi-line JSON text; the indent defaults to 2 spa...
Sets the value at a path of the current JSON document, creating missing levels; numbers, booleans...
Sets the value at a path of the current JSON document as a string, without converting numbers, bo...
Returns the current JSON document as compact JSON text; empty if no JSON document exists yet.
Removes a key (or array element) and its value from the current JSON document. With no argument, ...
Returns the value at a path of the current JSON document (one argument per level); inside $jsonFo...
Image & Canvas
(15)Renders a canvas created with $canvasCreate and attaches the PNG to the response; the canvas name...
Renders a canvas created with $canvasCreate[] and attaches it to the response as a PNG image name...
Draws an image from a URL, data URL or base64 text on the current canvas, optionally resized, cli...
Defines a named container: later canvas functions that name it in their container argument have t...
Creates a canvas with the given name, size and optional background color; the following canvas fu...
Draws a circle (filled or 1-pixel outline) on the current canvas, with an optional blend mode and...
Draws a line between two points on the current canvas, with a thickness, an optional blend mode a...
Draws a rectangle (filled or 1-pixel outline) on the current canvas, with an optional blend mode ...
Draws text on the current canvas at a position, with a font size, color and optional alignment in...
Converts the current canvas to grayscale. One optional argument is accepted and ignored.
Inverts the colors of the current canvas (negative). One optional argument is accepted and ignored.
Loads an image from a URL, data URL or base64 text; it replaces the canvas when placed at 0,0 wit...
Draws a progress bar (horizontal or vertical) with a track, a fill, a centered percentage label a...
Rotates the current canvas clockwise by an angle in degrees; the canvas grows to hold the result....
Sets the color of one pixel of the current canvas. Coordinates outside the canvas are ignored.
Moderation
(89)Adds one or more reactions to the user's command message (the message that triggered the command).
Adds a new custom emoji to the server from an image URL. The third argument (yes/no) chooses whet...
Adds one or more reactions to a specific message identified by its channel and message IDs.
Adds one or more reactions to the bot's response message (the message sent by the current command...
Returns the list of permissions of the command's author as supplied by the execution context (low...
Bans the first mentioned user with an optional reason.
Bans a user ID, with the reason as the first argument. In a prefix command, an omitted ID falls b...
Guard function that blacklists users by ID. If the triggering user ID is in the list, the command...
Guard function that blacklists roles by name. If the user has any of the roles, the command is in...
Guard function that blacklists roles by ID. If the user has any of the roles, the command is inte...
Guard function that blacklists roles by ID. If the user has any of the roles, the command is inte...
Guard function that blacklists servers. If the command is executed on a blacklisted server, it is...
Guard function that blacklists users by username. The command is interrupted if the username of t...
Makes the bot leave a server. If no ID is provided, the bot leaves the server where the command w...
Triggers the typing indicator in the current channel, showing users that the bot is typing.
Changes the server nickname of the first user mentioned in the message (the command author if nob...
Changes the server nickname of the user whose ID is given.
Sends a text message in a specific channel. Unlike $sendMessage which responds in the current cha...
Checks if a user has all the specified permissions. Alias of $hasPerms. Returns "true" or "false".
Deletes a specified number of messages in the channel.
Removes all reactions, or all reactions of one emoji, from a specific message.
Deletes the current channel if its name contains "ticket"; otherwise returns the error message an...
Creates a new channel on the server. Supports text, voice, category, stage and forum channels.
Creates a new role on the Discord server.
Returns the markup of a custom emoji in the format <:name:ID> for display in a message. The emoji...
Deletes one or multiple channels by their ID (at least one ID required). $deleteChannelsByName is...
Deletes the user's command message (the message that triggered the command). Useful for keeping c...
Deletes a role from the Discord server.
Modifies the permissions of a role or a user on a specific channel using permission names prefixe...
Modifies the properties of an existing thread: name, archive status, auto-archive duration, lock,...
Returns the number of custom emojis of a server. $emojiCount accepts an optional server ID; $emot...
Checks if a custom emoji with a given ID exists on the current server or on another server of the...
Gets the name of a custom emoji from its ID.
Gets the ban reason of a banned user on the server. Returns the reason stored in the server's ban...
Returns the bot's invite link (scopes bot and applications.commands, with the configured permissi...
Gets a property of a Discord invite from its code (channel, creation date, inviter, temporary sta...
Gets the content, author ID, author username or author avatar URL of a message specified by its c...
Returns the list of the users who reacted to a message with a given emoji, separated by the chose...
Gets the hexadecimal color of a Discord role. Returns the color as six uppercase hexadecimal digi...
Returns the server invite link supplied by the host in the context (guild.invite); it does not cr...
Assigns a role to a user on the server.
Assigns several roles to a user in a single operation.
Checks if a user has all specified permissions. Returns "true" or "false". Inline check, does not...
Guard function that stops command execution if it is triggered in one of the listed channels.
Accepted for compatibility with BDFD scripts; in this engine it does nothing and returns an empty...
Returns true if the name of a channel (the current one by default) contains "ticket", false other...
Kicks a specific user from the Discord server.
Kicks the first user mentioned in a prefix command.
Modifies the properties of an existing channel, such as its name, topic, NSFW status, position, a...
Deprecated variant of $editChannelPerms that takes one or several permissions (+ allow, - deny, /...
Modifies the properties of an existing role.
Toggles the listed permissions of an existing role.
Grants a role, identified by its name, to the user(s) mentioned in the message (role-based mute).
Creates a private ticket channel for the command author, sends an optional message in it, and ans...
A guard function that stops command execution if the author is not an administrator of the server...
A guard function that stops execution if the bot does not have the specified permissions in a giv...
A guard function that stops execution if the bot does not have all specified permissions on the s...
A guard function that stops execution if the current channel does not belong to one of the specif...
A guard function that stops execution if the command is not executed in one of the specified chan...
A guard function that stops execution if the user's ID is not in the list of allowed IDs.
A guard function that stops execution if the user does not possess any of the specified roles, co...
A guard function that stops execution if the user does not possess any of the specified roles (co...
Guard function that stops execution if the command is not used in one of the specified servers.
Guard function that stops execution if the username of the user is not in the list.
Guard function that stops execution if the current channel is not marked as NSFW, optionally send...
Guard function that stops command execution if the user does not have all the specified permissions.
Pins a message from its channel and message ID. Without argument, pins the message sent by the cu...
Publishes a message of an announcement channel to the servers that follow it.
Registers the bot's local-only slash commands on the current server, all of them or only those na...
Removes a custom emoji from the current server by its ID.
Removes all reactions of a given emoji from a given message. Useful for removing control reaction...
Adds and removes several roles of a user in one call, each role ID being prefixed by + (add) or -...
Modifies the nickname of a user on the server.
Sets the exact list of roles for a user, replacing all of their current roles.
Creates a discussion thread from the current message or a specified message. Threads allow organi...
Removes a role from a user on the server.
Removes several roles from a user in a single operation.
Adds a member to a thread. Useful for private threads where members must be added manually.
Returns the total number of messages in a thread. Includes messages within the thread only, not t...
Removes a member from a thread. The user will no longer be able to view or participate in the pri...
Returns the number of members in a thread. Useful for tracking participation in discussions.
Temporarily times out a user (temporary silence).
Unbans the banned user whose username matches the text of the message. The user will be able to r...
Unbans a user from the server using their ID. If no ID is given, the last word of the message is ...
Removes the timeout of a user before its expiration.
Removes a role, identified by its name, from the user(s) mentioned in the message (role-based unm...
Removes a pinned message from the pinned messages list of the channel.
Deletes the slash commands of the bot on the current server, all of them or only those named. Glo...
Returns the user limit recorded for the channel of the current command (0 when there is none). Th...
Math & Text
(57)Comment: the text between the brackets is never evaluated and the function returns an empty strin...
Evaluates an arithmetic expression with + - * / % ^ and parentheses. Not supported: functions (si...
Rounds a number up to the next integer.
Counts the number of characters in the given text.
Truncates text to a maximum length and appends a suffix when truncation occurs.
Divides the first value by the following ones, from left to right. A divisor equal to 0 raises an...
Replaces the element at the given 1-based position of the current split text (made by $textSplit)...
Rounds a number down to the nearest integer.
Returns the position (starting at 1) of a value in the elements produced by the last $textSplit, ...
Returns the total number of elements in the current split text, as produced by the last $textSplit.
Returns the current Unix timestamp in milliseconds.
Checks if a user has a specific role on the server.
Checks if a user is banned from the current server.
Checks if a value is one of the boolean words true, false, yes, no, on, off, enable or disable (l...
Checks if a custom emoji, given by its ID, is animated.
Checks if a value is an integer (positive, negative or zero) that fits in a 64-bit signed integer.
Checks if a channel is marked as NSFW.
Checks if a value is a finite number (decimal, scientific notation, or 0x/0b/0o prefixed integer).
Checks if the command was triggered via a slash command.
Returns the DM-enabled flag of the user in the execution context ("true" by default).
Checks if a string consists only of hexadecimal digits, with an optional leading
Joins all elements from the current split text back into a single string, separated by the given ...
Counts the lines of a text, i.e. the number of line breaks (LF) plus one. An empty text is an error.
Records a message in the execution log, with an optional level (success, info, warning or error)....
Returns the largest value among the provided arguments.
Returns the smallest value among the provided arguments.
Calculates the remainder of the integer division of a by b (a % b). Dividing by 0 is an error.
Multiplies two or more values.
Formats an integer by inserting a separator (comma by default) between groups of three digits.
Generates a random number between min (inclusive) and max (exclusive); without arguments, a rando...
Returns the ID of a random category of the current server, or of the server given as an argument.
Returns the ID of a random channel of the current server.
Returns the ID of a random server among the servers where the bot is present.
Returns the mention (format <@id>) of a random member of the server.
Returns the ID of a random role of the current server, or of the server given as an argument.
Generates a random alphanumeric string of the specified length.
Randomly chooses and returns an option from a list of provided text options.
Returns the username of a random member of the server.
Returns the ID of a random member of the server.
Removes all occurrences of a string in a given text. Searches and replaces with an empty string.
Returns a text without its http:// and https:// links. Without argument, it is a flag that remove...
Removes the element at the given 1-based index from the current split text. An index out of range...
Returns the given text repeated count times (0 to 10), with nothing between the copies. It does n...
Replaces occurrences of a search string with a replacement string in the given input text. By def...
Rounds a number to the nearest integer, or to a given number of decimal places. Values ending exa...
Sorts the given numbers in ascending or descending order and returns them joined by a separator.
Retrieves the element at the given 1-based index (or < for the first, > for the last) from the mo...
Calculates the square root of a number.
Subtracts the following values from the first one (a - b - c ...).
Calculates the sum of all provided values.
Splits a text at every occurrence of a separator and stores the pieces for later access with $spl...
Converts all characters in the given text to lowercase.
Converts the first letter of each word to uppercase and the rest to lowercase.
Converts all characters in the given text to uppercase.
Removes leading and trailing whitespace from a text and collapses repeated spaces into one. Witho...
Removes leading and trailing whitespace (spaces, tabs, newlines) from the given text.
Returns its text unchanged. Its only effect is inside $randomText, where semicolons in the text b...
Date & Time
(10)Returns the current date. This function is resolved at runtime.
Returns the current day of the month (1 to 31). Resolved at runtime.
Returns the creation date of any Discord ID (snowflake) as a Unix timestamp, in seconds or millis...
Returns the current Unix timestamp in seconds (default), milliseconds or nanoseconds.
Returns the current hour (0 to 23), in UTC or in the timezone set with $time.
Returns the current minute (0 to 59), in UTC or in the timezone set with $time.
Returns the English name of the current month (January to December), in UTC or in the timezone se...
Returns the current second (0 to 59), in UTC or in the timezone set with $time.
Sets the timezone (TZ database name) used by the date and time functions of the rest of the comma...
Returns the current year (e.g., 2026), in UTC or in the timezone set with $time.
Music
(18)Joins a voice channel; if no channel ID is given, joins the user's current voice channel
Returns the author/artist of the currently playing track
Returns the total duration of the currently playing track in milliseconds
Returns "true" if looping is currently enabled, "false" otherwise
Returns "true" if playback is currently paused, "false" otherwise
Returns the title of the currently playing track
Returns the current playback position in milliseconds
Returns the number of tracks currently in the music queue
Returns the current playback volume level (0–200, default 100)
Leaves the current voice channel
Pauses the current music playback
Plays a track from a search query or URL, auto-joining a voice channel if needed
Resumes music playback if it was previously paused
Seeks to a specific position in the currently playing track
Sets the looping mode for music playback
Sets the music playback volume to a level between 0 and 200
Skips the currently playing track and plays the next track in the queue
Stops music playback and clears the entire queue
Webhooks & Integrations
(10)Changes the avatar of the Discord webhook from an image URL.
Stages the color of the sidebar of the embed for the next message sent to this webhook with $webh...
Stages the text content of the message for the next message sent to this webhook with $webhookSend.
Creates a new webhook in a specified channel and returns its URL. The created webhook can then be...
Deletes an existing Discord webhook from its URL.
Stages the description (body) of the embed for the next message sent to this webhook with $webhoo...
Stages the footer text of the embed for the next message sent to this webhook with $webhookSend.
Sends a message (text and/or embed) through a Discord webhook, merging it with the data staged by...
Stages the title of the embed for the next message sent to this webhook with $webhookSend.
Renames the Discord webhook.
Cooldown
(3)Permission
(2)Flags & Debug
(8)Accepted for compatibility with BDFD scripts; in this engine it does nothing and returns an empty...
Accepts exactly one argument and returns an empty string; in this engine it has no other effect.
Accepted for compatibility with BDFD scripts; in this engine it does nothing and returns an empty...
Accepted for compatibility with BDFD scripts; in this engine it does nothing and returns an empty...
Enables or disables decimal results in calculations for the current command. By default, results ...
Makes the trigger of a prefix command case-insensitive in BDFD. Accepted in Bot Creator, where it...
Returns the log quota value supplied by the execution context (the log.quota variable), or 1000 i...
Accepted for compatibility with BDFD scripts; in this engine it does nothing and returns an empty...
Meta
(8)Where the Bot Creator BDFD engine behaves differently from Bot Designer For Discord, and which of...
Choose between app hosting and the self-hosted Docker runner for running Bot Creator bots.
How event-driven workflows and ((...)) placeholders work in Bot Creator bots.
Comprehensive execution model for Bot Creator. Understand the Discord interaction lifecycle, impl...
Start here — set up a bot, write your first command, and find the right documentation section.
Buttons, select menus, modals, and slash commands — how Bot Creator handles rich Discord interact...
Model Context Protocol server for AI-assisted documentation lookup and LLM code generation.
Reference guide for the ((...)) template system used in Bot Creator messages, embeds, and action ...
Misc
(11)Defines a reusable user function (name and parameters) that is called later with $funcCall.
Ends a function block started with $func.
Reads the error caught by the last $try / $catch block, or one of its details.
Repeats a block of actions a given number of times. Legacy alias of $for with the same three forms.
Returns the value of the bot.ping context variable (latency in milliseconds), or 0 when the host ...
Returns the elapsed time since the bot started, formatted as HH:MM:SS.