Skip to content
Documentation Hub

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.

Browse

BDFD Function Reference

Syntax and parameters for every $function.

Browse

JavaScript API

db.*, interaction, message, and script globals for BDJS.

Browse

Guides & Tutorials

Step-by-step walkthroughs from token setup to advanced patterns.

Browse

Getting Started

JavaScript API

Script globals for BDJS bots — db.*, interaction, message, and more.

View JavaScript API reference

Blocks

(6)

Embed & Message

(32)
Allowmention

Deletemessage

Editmessage

Reply

$addField[name;value;(inline);(embedIndex)]

Adds a field to a Discord embed. The fields help structure information as name/value pairs in the...

$addFile[url;(spoiler)]

Adds a file component (Components V2) to the message being built.

$addThumbnail[url;(description);(spoiler);(sectionID)]

Adds a thumbnail component (Components V2). After $addSection it becomes the accessory of that se...

$addTimestamp[(embedIndex)]

Adds the current date and time as the timestamp of a Discord embed. The optional argument is the ...

$allowRoleMentions[(roleID;...)]

Restricts which roles can be pinged by the message to the listed role IDs. Without any ID, no rol...

$allowUserMentions[(userID;...)]

Restricts which users can be pinged by the message to the listed user IDs. Without any ID, no use...

$author[name;(embedIndex)]

Sets the author name of a Discord embed. The author appears at the very top of the embed, above t...

$authorIcon[url;(embedIndex)]

Modifies the icon (avatar) of the author of an embed after it has been set with $author[]. Allows...

$authorOfMessage[channelID;messageID]

Returns the ID of the author of a specific message, identified by its channel ID and its message ID.

$authorUrl[url;(embedIndex)]

Modifies the destination URL of the author of an embed. Makes the author's name clickable without...

$color[hexColor;(embedIndex)]

Sets the color of the left sidebar of a Discord embed. The color can be specified in hexadecimal ...

$deleteIn[duration]

Schedules the deletion of the command's main response after a delay (at most 40 minutes).

$description[text;(embedIndex)]

Sets the main body (description) of a Discord embed. This is the main text area, located below th...

$dm[userID]

Redirects the response of the current command to the private messages (DM) of one or several user...

$dmChannelID[(userID)]

Returns the DM channel ID stored in the command context for the user (variable user.dmChannelId),...

$editEmbedIn[duration;title;(description);(footer);(color)]

Schedules, after a delay, the replacement of the embed of the message sent by the current command...

$editIn[duration;content]

Schedules the editing of the message sent by the current command, after a delay, with the given n...

$embeddedURL[url;(embedIndex)]

Sets the clickable URL of an embed's title. When the user clicks on the title of the embed, they ...

$footer[text;(embedIndex)]

Sets the footer text of a Discord embed. The icon is set separately with $footerIcon. The footer ...

$footerIcon[url;(embedIndex)]

Modifies the footer icon of an embed after it has been defined with $footer[]. Allows changing on...

$image[url;(embedIndex)]

Sets the main image of a Discord embed. The image appears at the bottom of the embed, below the f...

$noMention

Disables all mention notifications of the response, including mentions written on purpose.

$replyIn[duration]

Pauses the execution of the command for the given duration (at least 1 second, at most 40 minutes...

$sendEmbedMessage[channelID;content;(title;titleURL;description;color;author;authorIcon;footer;footerIcon;thumbnail;image;addTimestamp;returnID)]

Sends a message with an embed built from its own arguments to a specific channel. Every field aft...

$sendMessage[content;(returnMessageID)]

Explicit message send of a separate channel message; ordinary slash replies can use text or embed...

$thumbnail[url;(embedIndex)]

Sets the thumbnail of a Discord embed. The thumbnail is a small square image displayed at the top...

$title[text;(embedIndex)]

Sets the title of a Discord embed. The title appears at the top of the embed, in bold and with a ...

$tts

Sets a tts flag on the command's main response. In the current engine the flag is not read when t...

Variables

(42)
$argCount[(Text)]

Returns the number of arguments passed to the current command, or the number of words of a given ...

$args / $args[(index)]

Reads message.content, drops its first word, and returns the remaining words joined by spaces, or...

$argsCheck[operator;count;errorMessage] / $argsCheck[operatorAndCount;errorMessage]

Validates the number of arguments passed to the command and stops execution with an error message...

$enabled[yes/no;(errorMessage)]

Stops the command when its first argument is no (or false), optionally replacing the output with ...

$getChannelVar[name] or $getChannelVar[name;Channel ID]

Reads the value of a channel-scoped variable. Returns the stored value for the current channel, o...

$getGuildMemberVar[name] or $getGuildMemberVar[name;User ID] or $getGuildMemberVar[name;User ID;Guild ID]

Reads the value of a guild-member-scoped variable. Alias: $getMemberVar. Returns the stored value...

$getGuildVar[name] or $getGuildVar[name;Guild ID]

Reads the value of a guild-scoped variable. Alias: $getServerVar. Returns the stored value for th...

$getLeaderboardPosition[type;varName;sort;(userID)]

Returns the rank of a user in the ranking of a stored variable (user or globalUser).

$getLeaderboardValue[type;varName;sort;position;(returnType)]

Returns the entry (name, ID or value) found at a given position in the ranking of a stored variable.

$getMemberVar[name] or $getMemberVar[name;User ID] or $getMemberVar[name;User ID;Guild ID]

Reads the value of a guild-member-scoped variable. Alias: $getGuildMemberVar. Returns the stored ...

$getMessageVar[name] or $getMessageVar[name;Message ID]

Reads the value of a message-scoped variable. Returns the stored value for the current message, o...

$getServerVar[name] or $getServerVar[name;Guild ID]

Reads the value of a guild-scoped variable. Alias: $getGuildVar. Returns the stored value for the...

$getUserVar[name] or $getUserVar[name;User ID] or $getUserVar[name;User ID;Guild ID]

Reads the value of a user-scoped variable. Returns the stored value for the current user, or a sp...

$getVar[name;(User ID)]

Reads a global variable or a user-scoped variable from the bot's persistent storage.

$globalUserLeaderboard[variable] or $globalUserLeaderboard[variable;sort]

Writes the top 10 of the global user values of a variable into the description of the first embed...

$input[inputID]

Returns the value submitted for a modal input, identified by its custom ID.

$listVar[(separator)]

Returns the names of all the variables declared by the bot (all scopes and global variables), joi...

$noMentionMessage[n]

Gets the content of the message with user, role and channel mentions removed, or its nth word (th...

$resetChannelVar[name]

Resets a channel-scoped variable to its declared default value (as defined in the Bot Creator Var...

$resetGlobalUserVar[name] or $resetGlobalUserVar[name;User ID]

Resets the value of a global-user variable to its declared default, for every user or for one use...

$resetGuildMemberVar[name] or $resetGuildMemberVar[name;User ID] or $resetGuildMemberVar[name;User ID;Guild ID]

Resets a guild-member-scoped variable to its default value (as defined in the Bot Creator Variabl...

$resetGuildVar[name]

Resets a guild-scoped variable to its declared default value (as defined in the Bot Creator Varia...

$resetMemberVar[name] or $resetMemberVar[name;User ID] or $resetMemberVar[name;User ID;Guild ID]

Resets a guild-member-scoped variable to its default value (as defined in the Bot Creator Variabl...

$resetMessageVar[Name;(Message ID)]

Resets a message-scoped variable to its declared default value, for every message or for a single...

$resetServerVar[name]

Resets a guild-scoped variable to its declared default value (as defined in the Bot Creator Varia...

$resetUserVar[name] or $resetUserVar[name;User ID]

Resets the member-scoped value of a variable to its declared default value, for every member or f...

$serverLeaderboard[variable] or $serverLeaderboard[variable;sort]

Ranks the servers by the value of a server variable and writes the top 10 into the description of...

$setChannelVar[name;value] or $setChannelVar[name;value;Channel ID]

Stores a value into a channel-scoped variable. Writes to the current channel's variable, or to a ...

$setGuildMemberVar[name;value] or $setGuildMemberVar[name;value;User ID] or $setGuildMemberVar[name;value;User ID;Guild ID]

Stores a value into a guild-member-scoped variable. Alias: $setMemberVar. Writes to the current m...

$setGuildVar[name;value] or $setGuildVar[name;value;Guild ID]

Stores a value into a guild-scoped variable. Alias: $setServerVar. Writes to the current server's...

$setMemberVar[name;value] or $setMemberVar[name;value;User ID] or $setMemberVar[name;value;User ID;Guild ID]

Stores a value into a guild-member-scoped variable. Alias: $setGuildMemberVar. Writes to the curr...

$setMessageVar[name;value] or $setMessageVar[name;value;Message ID]

Stores a value into a message-scoped variable. Writes to the current message's variable, or to a ...

$setServerVar[name;value] or $setServerVar[name;value;Guild ID]

Stores a value into a guild-scoped variable. Alias: $setGuildVar. Writes to the current server's ...

$setUserVar[name;value;(User ID;Guild ID)]

Stores a value into a user-scoped variable. Writes to the current user's variable, or to a specif...

$setVar[name;value;(User ID)]

Creates or updates a global variable or a user-scoped variable in the bot's persistent storage.

$url[mode;text]

Encodes or decodes a text as a URL query component.

$useChannel[channelID]

Changes the destination channel of the messages sent by the rest of the command ($sendMessage and...

$userLeaderboard[variable] or $userLeaderboard[variable;sort]

Writes the top 10 of the members of the current server, ranked by a user variable, into the descr...

$var[name] / $var[name;value]

Reads or writes a temporary variable scoped to the current execution. In read mode (1 parameter),...

$varExistError[name;message]

Stops the script and displays the message if the variable name is not declared.

$varExists[name]

Checks whether a variable with the given name is declared for the bot (the variables defined in t...

$variablesCount[type]

Counts the number of variables declared for a given type (user, globaluser, server or channel).

Control Flow

(34)
$and[condition1;(condition2);(...)]

Logical AND — returns "true" only if ALL provided conditions evaluate to true.

$async[name]

Opens a block, closed by $endAsync, that runs at the same time as the rest of the script. $await[...

$await[name]

Waits for the $async block of that name and returns the text it wrote. An error in the block is r...

$awaitFunc[functionName;(userID);(channelID)]

Stores a pending "await" record for a user and channel. It does not suspend the script and nothin...

$break

Leaves the innermost loop immediately.

$callWorkflow[name;(arg1);(arg2);...]

Calls another workflow by name, optionally passing arguments. The called workflow executes, then ...

$changeCooldownTime[days;hours;minutes;seconds]

Sets the labels (days, hours, minutes, seconds) used by the %time% placeholders in the error mess...

$checkCondition[condition]

Evaluates a condition (a comparison written as a single expression) and returns "true" or "false".

$checkContains[text;search]

Checks whether a string contains a substring and returns "true" or "false".

$continue

Skips the rest of the current iteration and goes to the next one.

$cooldown[duration;errorMessage]

Enforces a cooldown on command execution. Three variants: $cooldown (per user and server), $serve...

$defer[(ephemeral)]

Acknowledges the interaction (optionally ephemeral) when the script was not acknowledged beforeha...

$embedSuppressErrors[title;description;(color);(author);(footer);(footerIconURL)]

Replaces the error message shown when a function fails with a custom error embed built from its a...

$endAsync

Closes a block opened by $async[name].

$eval[bdfdCode]

Dynamically parses and executes a string of BDFD code at runtime. The code is treated as a sub-sc...

$for[iteratorName;value1;(value2);...] ... $endFor

Repeats a block, either once per listed value ($for[name;v1;v2;...]), a given number of times ($f...

$getCooldown[type]

Returns the remaining cooldown time in whole seconds (rounded up) for the current command, for th...

$i

Alias of $loopIndex. Returns the current zero-based iteration index of the innermost loop ($for, ...

$if[condition].. $elseIf[condition].. $else.. $endif

Conditional branching — executes blocks of code based on runtime condition evaluation.

$jumpToAction[n]

Continues the current block at a given action number, skipping the actions in between. It only ju...

$loopCount

Returns the one-based count of the current iteration of the innermost loop.

$loopIndex

Returns the zero-based index of the current iteration of the innermost loop.

$loopIteration

Alias of $loopIndex. Returns the zero-based index of the current iteration of the innermost loop.

$onlyIf[condition] or $onlyIf[condition;errorMessage]

Condition guard that stops the script if the condition is false. An optional message replaces the...

$onlyIfMessageContains[text;word1;(word2;...);errorMessage]

Stops command execution if the given text does not contain all the listed words (case-insensitive...

$or[condition1;(condition2;...)]

Logical OR — returns "true" if at least one of the provided conditions evaluates to true (1 to 10...

$skipActions[count]

Skips a specified number of subsequent actions in the current execution block.

$stop

Immediately ends the current script. What was written before it is still sent.

$suppressErrorLogging

Sets the "suppress error logging" flag of the script. The engine does not read this flag, so it h...

$suppressErrors[(message)]

Replaces the error response of the script with a text message (or with nothing when called withou...

$try.. $catch.. $endTry

Error handling block — catches runtime errors in the try body and allows graceful recovery or log...

$wait[duration]

Pauses the script for a duration (positive, at most 40 minutes) before continuing.

$while[condition] ... $endWhile

Repeats a block as long as a condition is true. The condition is checked before every iteration.

$workflowResponse[(property)]

Returns the status or a named result of the last workflow run with $callWorkflow.

Entity Info

(149)
$afkChannelID

Returns the ID of the AFK channel configured on the current Discord server. Raises an error if th...

$afkTimeout[(serverID)]

Returns the AFK timeout of the server in seconds, for the current server or for the server whose ...

$allMembersCount

Returns the total number of members summed over all the servers the bot is in (bots included). Fo...

$authorAvatar

Returns the URL of the global avatar of the author of the message that triggered the command.

$authorBanner

Returns the URL of the profile banner of the author of the message, or an empty string if there i...

$authorID

Returns the Discord ID of the author of the message that triggered the command.

$authorTag

Returns the tag of the author: username#discriminator when the account has a discriminator, other...

$authorUsername

Returns the username of the author of the command, as supplied by the command context.

$boostCount[(Guild ID)]

Returns the number of boosts (premium subscriptions) of the current server, or of the server whos...

$boostLevel

Returns the boost level (tier) of the current Discord server, as reported by Discord.

$botCommands[separator]

Returns the names of the commands registered on the bot, joined by the separator you provide.

$botCount[(ignored)]

Returns the number of bot accounts among the members of the current Discord server.

$botID

Returns the user ID of the bot.

$botListDescription[text]

Compatibility flag for the BDFD bot list description. It takes exactly one argument and has no ef...

$botListHide

Compatibility flag for the BDFD bot list. It takes no argument and has no effect in the engine.

$botName

Returns the username of the bot (`Bot` when the context does not provide it).

$botNode

Returns the node identifier supplied by the host in the context (`bot.node`), or `1` when none is...

$botOwnerID

Returns the Discord ID of the owner of the bot.

$byteCount[text]

Calculates and returns the number of bytes of a text string. Useful for checking the size of a me...

$categoryChannels[categoryID;separator;(option)]

Returns the channels belonging to a specific category (names by default, or IDs, mentions or the ...

$categoryCount[(serverID)]

Returns the number of categories of the current Discord server, or of the server whose ID is given.

$categoryID[categoryName]

Returns the ID of the category with the given name.

$channelCategoryID[(channelID)]

Returns the ID of the parent category of a Discord channel.

$channelCount

Returns the total number of channels on the server.

$channelExists[channelID]

Checks if a Discord channel with the given ID exists. Returns "true" or "false".

$channelID[(channelName)]

Without argument, returns the ID of the channel in which the command is executed (`none` in a DM)...

$channelIDFromName[name]

Returns the ID of a Discord channel from its name.

$channelNSFW[(channelID)]

Returns "true" if the channel is marked as NSFW, "false" otherwise.

$channelName[channelID]

Returns the name of a Discord channel from its ID.

$channelNames[separator;(guildID)]

Returns a list of all channel names on the server, joined by the separator you provide.

$channelPosition[(channelID)]

Returns the position of a channel in the Discord channel list.

$channelTopic[(Channel ID)]

Returns the topic of the current Discord channel, or of the channel whose ID is given.

$channelType[channelID]

Returns the type of a Discord channel from its ID (text, voice, category, dm, etc.).

$colorRole[color]

Sets the color of the first role mentioned in the message.

$commandFolder

Returns the name of the folder containing the command currently being executed.

$commandName

Returns the name of the command currently being executed.

$commandTrigger

Returns the trigger of the command currently being executed.

$commandType

Returns how the current command was invoked, taken from the execution context (chatInput, user or...

$commandsCount

Returns the number of commands stored for the bot (all trigger types).

$creationDate[entityID;(layout)]

Returns the creation date of a Discord entity (user, server, role, channel, message, etc.) from i...

$discriminator[userID]

Returns the discriminator of the given user, left-padded to 4 digits, for bot accounts; returns "...

$displayName[(userID)]

Returns the global display name of a user (the author by default), or the username if the user ha...

$emojiCount[(serverID)]

Returns the number of custom emojis of the current server, or of the server whose ID is given.

$executionTime

Returns the execution time of the current command in milliseconds. Helps measure BDFD code perfor...

$findChannel[query]

Searches for a channel of the current server by mention, ID or name (case-insensitive, exact name...

$findRole[query]

Searches for a role by ID, role mention or exact name and returns its ID. Case-sensitive on names.

$findUser[query;(returnAuthor)]

Searches the members of the current server for a user by mention, ID or username (case-insensitiv...

$getAttachments[index]

Returns the URL of one attachment, selected by a 0-based index, of the message that triggered the...

$getCustomStatus[(userID)]

Returns the custom status text supplied in the command context (user.customStatus); an empty stri...

$getEmbedData[channelID;messageID;embedIndex;property]

Extracts the data of a specific field of an embed in a message. Allows reading the title, descrip...

$getMembersCount

Returns the total number of members on the server (including bots). Possible alias of $membersCount.

$getRole[(userID);(index);(guildID)]

Returns the ID of a role of a user according to their index (position) in the member's list of ro...

$getSlowmode[(channelID)]

Gets the slowmode value of a channel in seconds. Returns the minimum delay between two messages.

$getUserStatus[(userID)]

Returns the presence status (online, idle, dnd, offline) of the specified user.

$guildBanner[guildID]

Returns the URL of the banner of the Discord server whose ID is given. $serverBanner is the equiv...

$guildCount

Alias of $serverCount. Returns the total number of servers the bot is present on.

$guildExists[guildId]

Checks if a server (guild) with the given ID exists and if the bot has access to it. Returns "tru...

$guildID[(Server name)]

Returns the unique identifier (Snowflake) of the current Discord server, or of a server of the bo...

$guildIcon[(guildID)]

Alias of $serverIcon. Returns the URL of the Discord server icon.

$guildName[(guildID)]

Alias of $serverName. Returns the name of the Discord server.

$highestRole[(userID)]

Returns the ID of the highest role of the server, or of the highest role of a given member.

$highestRoleWithPerms[permission1;permission2;...]

Returns the ID of the highest role of the server that possesses all the specified permissions.

$hostingExpireTime[(unused)]

Returns the hosting expiration value supplied by the host application, or an empty string.

$hypeSquad[(userID)]

Returns the HypeSquad value supplied by the host in the user.hypesquad context variable, or an em...

$isAdmin[userID]

Returns "true" if the given user has the Administrator permission on the server, and "false" othe...

$isBooster[(userID);(guildID)]

Returns "true" if the user is a server booster (Nitro Boost), and "false" otherwise.

$isBot[(User ID)]

Returns "true" if the user (the author by default) is a bot, and "false" otherwise.

$isHoisted[roleID]

Returns "true" if the role is displayed separately in the member list, "false" otherwise.

$isMentionable[roleID]

Checks if a role is mentionable. Returns "true" or "false".

$isMentioned[userID]

Returns "true" if the given user ID is among the users mentioned in the message, "false" otherwise.

$isMessageEdited[channelID;messageID]

Checks if a message was edited. Returns "true" or "false".

$isTimedOut[userID]

Returns "true" if the given user is currently timed out (temporarily muted) on the server, "false...

$lastMessageID

Returns the ID of the last message sent in the current channel.

$lastPinTimestamp

Returns the Unix timestamp (in seconds) of the last pinned message in the current channel.

$lowestRole[(userID)]

Returns the ID of the lowest role of the server, or of a given member. @everyone is the lowest ro...

$lowestRoleWithPerms[permission1;permission2;...]

Returns the ID of the lowest role of the server (in the role hierarchy) that possesses all the sp...

$memberCount

Returns the total number of members (users + bots) on the Discord server.

$memberExists[User ID;(Guild ID)]

Returns true when the user is a member of the current server (or of the given server), false othe...

$memberID

Returns the Discord ID of the member who triggered the command (member.id, else the author ID).

$memberNick[(userID)]

Returns the nickname of a member on the server, falling back to a display name or username when n...

$memberPerms[(unused;unused;unused)]

Returns the permissions of the triggering member as supplied by the host in the member.permission...

$membersCount[(Presence)]

Returns the total number of members on the Discord server, or only those with a given presence. W...

$mentioned[index;(returnSelf)]

Returns the ID of the user mentioned at the given position in the message (1, < for the first, > ...

$mentionedChannels[index;(returnCurrent)]

Returns the ID of the channel mentioned at the given position in the message (1, < for the first,...

$mentionedRoles[index]

Returns the ID of the role mentioned at the given position in the message (1, < for the first, > ...

$mentions[(unused)]

Returns the list of all user IDs mentioned in the message, separated by commas.

$message / $message[selector;(end)]

Returns the text that follows the command, or one of its words, or the value of a named slash-com...

$messageEditedTimestamp[channelID;messageID]

Returns the Unix timestamp (in seconds) of the last edit of a message, or an empty string if it h...

$messageID

Returns the ID (snowflake) of the message that triggered the command.

$messageTimestamp[(channelID;messageID)]

Returns the creation timestamp of the triggering message (host-supplied, milliseconds for message...

$messageType[(unused;unused)]

Returns the type of the triggering message as an integer (0 = normal message, 7 = member joined, ...

$messageURL[(channelID;messageID)]

Returns the jump URL (direct link) to the triggering message.

$nickname[(userID)]

Returns the server nickname of a user, or their display name (global name, else username) if they...

$nodeVersion

Returns the version string supplied by the host in bot.nodeVersion, or v20.0.0 when the host supp...

$onlineMembers[(unused)]

Returns the online member count supplied by the host in guild.onlineMembers or, when there is non...

$parentID[(channelID)]

Alias of $channelCategoryID. Returns the ID of a channel's parent category.

$premiumExpireTime[(unused)]

Returns the premium expiration value supplied by the host in premium.expireTime, or an empty string.

$repliedMessageID[Channel ID;Message ID]

Returns the ID of the message that a given message replies to. Without argument, uses the message...

$roleCount

Returns the total number of roles on the Discord server.

$roleExists[roleID]

Checks if a role exists on the server. Returns "true" or "false".

$roleID[name]

Returns the ID of a Discord role from its exact name in the current server.

$roleInfo[format]

Writes the information of the first role mentioned in the message into the embed description, usi...

$roleMembersList[Role ID;(Separator;Return)]

Lists the members of the current server who have a role, as IDs, mentions or usernames.

$roleName[roleID]

Returns the name of a Discord role from its ID.

$roleNames

Returns the list of all role names of the current server, separated by commas.

$rolePerms[guildID;roleID;(separator)]

Returns the permissions of a Discord role as a text list.

$rolePosition[roleID]

Returns the hierarchical position of a role in the server's role list.

$rulesChannelID[(guildID)]

Returns the ID of the rules channel of the server. Raises an error when the server has no rules c...

$scriptLanguage

Returns the scripting language of the interpreter running the script.

$serverBanner[(guildID)]

Returns the URL of the banner of the current server, or of the server whose ID is given. Empty st...

$serverBoostCount[(guildID)]

Returns the number of active Nitro boosts on the Discord server.

$serverChannelExists[nameOrID]

Checks if a channel (or active thread) with a given name or ID exists on the current server. Retu...

$serverCount

Returns the total number of servers the bot is present in.

$serverDescription[(Guild ID)]

Returns the description of the current Discord server, or of the server whose ID is given.

$serverEmojis[guildID;separator]

Returns the list of custom emojis of a Discord server, joined by a separator.

$serverExists[serverID]

Tells whether the bot can see the server with the given ID.

$serverFeatures[(unused)]

Returns the server features list supplied by the host in the guild.features context variable, or ...

$serverID

Returns the unique identifier (Snowflake) of the Discord server where the command was executed.

$serverIcon[(Guild ID)]

Returns the URL of the icon of the current Discord server, or of the server whose ID is given.

$serverInfo[(guildID);(field)]

Returns the runtime value `guild.info` of the current context, or an empty string when none is pr...

$serverName[(guildID)]

Returns the name of the server (guild) in which the command is executed.

$serverNames[(Amount;Separator)]

Returns the names of the servers in which the bot is present (10 by default, -1 for all), separat...

$serverOwner[(Guild ID)]

Returns the identifier (ID) of the owner of the current Discord server, or of the server whose ID...

$serverRegion[(unused)]

Returns the server region supplied by the host in the guild.region context variable, or an empty ...

$serverSplash[(unused)]

Returns the invite splash value supplied by the host in the guild.splash context variable, or an ...

$serverVanityURL[(unused)]

Returns the vanity URL code supplied by the host in the guild.vanityUrlCode context variable, or ...

$serverVerificationLevel[(guildID)]

Returns the verification level of the server as a label (None, Low, Medium, High, Very High).

$shardID[(Guild ID)]

Returns the shard of the bot, or the shard that serves the given server.

$slashCommandsCount

Returns the number of global slash (chat input) commands registered on Discord for the bot.

$slashID[(commandName)]

Returns the Discord ID of the slash command being executed, or of the global slash command with t...

$slowmode[channelID;time]

Sets the slowmode delay of a Discord channel (write function). To read the current value, use $ge...

$stickerCount[(unused)]

Returns the sticker count supplied by the host in the guild.stickerCount context variable, or 0.

$systemChannelID

Returns the identifier (ID) of the system messages channel configured on the Discord server (welc...

$userAvatar[userID]

Returns the global avatar URL of a user. For the author of the command, use $authorAvatar.

$userBadges[(User ID;Separator)]

Returns the badge names of a user (the author by default), separated by a space unless a separato...

$userBanner[userID]

Returns the URL of the profile banner of a user. For the author of the command, use $authorBanner.

$userBannerColor[userID]

Returns the banner color of a user in hexadecimal format (RRGGBB, without

$userExists[userID]

Checks if a user ID can be resolved by the bot and returns "true" or "false". Only numeric IDs ar...

$userID[(Username)]

Returns the Discord ID of the user of the execution context, or of the server member found by use...

$userInfo[message]

Formats the information of the first mentioned user (or of the author) into the description of th...

$userJoined[userID;(format)]

Returns the date when a user joined the current Discord server, formatted with a Go time layout.

$userJoinedDiscord[userID;(format)]

Returns the creation date of a Discord account (the registration date on the platform), derived f...

$userName[(userID)]

Returns the global Discord username of the user who triggered the command, or of the user whose I...

$userPerms[userID;amount;separator]

Returns the permissions granted to a user by their roles on the current server, as a list of names.

$userReacted[channelID;messageID;userID;emoji]

Checks if a specific user reacted with a given emoji on a message. Returns true or false.

$userRoles[userID]

Returns the names of the roles assigned to the user on the current server, one per line.

$userServerAvatar[userID]

Returns the URL of the member's server-specific avatar, or their global avatar if none is set. Th...

$userTag[(userID)]

Returns the username of a user (the author by default); for bot accounts, the tag in the form "us...

$usersWithRole[roleID;(separator);(guildID)]

Returns the IDs of the members of the current server who have a role, joined by a separator (defa...

Components & Interactions

(62)
Addactionrow

Starts a new action row for buttons.

Addbutton

Adds an interactive button to a message (legacy style).

Addbuttoncv2

Adds an interactive or link button to the response, in the current action row or a chosen one.

Addcategoryselect

Addchannelselect

Addmentionableselect

Addroleselect

Addselectmenuoption

Addseparator

Addstringselect

Adds a string select dropdown menu to a message.

Addstringselectoption

Addtextdisplay

Adduserselect

Addvoiceselect

Ephemeral

Makes the response visible only to the user who triggered the interaction.

Newselectmenu

$addCheckboxGroupOption[menuId;label;(value);(description);(default)]

Adds an option to a checkbox group of the modal being built. An empty menuId targets the last che...

$addContainer[(id);(accentColor);(spoiler)]

Starts a Components V2 container that groups the components added after it, with an optional acce...

$addMediaGallery[(id);(containerId)]

Starts a Components V2 media gallery. Images are added with $addMediaGalleryItem[].

$addMediaGalleryItem[url;(description);(spoiler);(galleryId)]

Adds an element (image) to a media gallery. If galleryId is omitted, the element is added to the ...

$addModalCheckbox[label;description;customId;(default)]

Adds an individual checkbox to the modal being built.

$addModalCheckboxGroup[label;description;customId;(minValues);(maxValues);(required)]

Creates a checkbox group in the modal being built. The individual options are added using $addChe...

$addModalFileUpload[label;description;customId;(minFiles);(maxFiles);(required)]

Adds a file upload component (Components V2) to the modal being built.

$addModalRadioGroup[label;description;customId;(required)]

Creates a group of radio buttons in the modal being built. Options are added using $addRadioGroup...

$addModalSelect[type;label;description;customId;(placeholder);(minValues);(maxValues);(required);(disabled)]

Adds a select menu (Components V2) to the modal being built. Options are added with $addSelectMen...

$addModalTextDisplay[content]

Displays a static informational text in a modal. This component is not interactive — it only serv...

$addModalTextInput[label;description;customId;(style);(minLength);(maxLength);(required);(default);(placeholder)]

Adds a Components V2 text input (wrapped in a label) to the modal being built. The style defaults...

$addRadioGroupOption[menuId;label;(value);(description);(default)]

Adds an option to a radio button group of the modal being built. An empty menuId targets the last...

$addSection[(id);(containerId)]

Starts a section: text displays that can have a thumbnail. The text displays and the thumbnail ad...

$addTextInput[customId;style;label;(minLength);(maxLength);(required);(default);(placeholder)]

Adds a classic text input to the modal being built with $newModal[]. The style must be "short" or...

$appendOptionSuggestion[label;value]

Adds one suggestion to the answer of an option autocomplete script. Only usable in that script.

$autoCompleteOptionName

Returns the name of the option being typed in an autocomplete script.

$autoCompleteOptionValue

Returns the text typed so far in the option, inside an autocomplete script.

$customID

Returns the custom ID (customId) of the interaction component that triggered the callback (button...

$editButton[idOrUrl;label;style;(disabled);(emoji);(messageID)]

Modifies an existing button on a message. Replaces the label, style, disabled state, and emoji of...

$editContainer[Index;(Color;Spoiler;Message ID)]

Changes the accent color and the spoiler state of the n-th container of a Components V2 message.

$editInCV2[Duration]

After a delay, replaces the components of the response of the command with the Components V2 layo...

$editMessageCV2[(Channel ID;Message ID)]

Replaces every component of a message sent by the bot with the Components V2 layout built before ...

$editSelectMenu[customId;minValues;maxValues;(placeholder);(messageID)]

Modifies the properties of an existing string select menu: placeholder text, minimum and maximum ...

$editSelectMenuOption[menuId;label;value;description;(default);(emoji);(messageID)]

Modifies an individual option in an existing string select menu.

$editTextDisplay[Position;Content;(Message ID)]

Replaces the content of the n-th text display of a Components V2 message, in the response being b...

$editThumbnail[Position;URL;(Description;Spoiler;Message ID)]

Replaces the n-th thumbnail of a Components V2 message (URL, description and spoiler).

$getChannelSelectChannelCount

Returns how many values were selected in a channel select menu.

$getChannelSelectChannelID[index]

Gets the ID of the channel selected by the user via a channel select menu. Allows getting the res...

$getChannelSelectChannelIDs[separator;(limit)]

Gets all channel IDs selected by the user via a channel select menu. Returns a list separated by ...

$getMentionableSelectUserCount

Returns how many values were selected in a mentionable select menu.

$getMentionableSelectUserID[index]

Gets one selected ID of the mentionable select menu that triggered the interaction. When users ar...

$getMentionableSelectUserIDs[separator;(limit)]

Gets all the IDs selected in a mentionable select menu, joined by a separator. When users are sel...

$getRoleSelectRoleCount

Returns how many values were selected in a role select menu.

$getRoleSelectRoleID[index]

Gets the ID of the role selected by the user via a role select menu.

$getRoleSelectRoleIDs[separator;(limit)]

Gets all role IDs selected by the user via a multi-select role menu.

$getStringSelectCount

Returns how many values were selected in a string select menu.

$getStringSelectValue[index]

Gets the value of the option selected by the user in a string select menu.

$getStringSelectValues[separator;(limit)]

Gets all option values selected in a multi-select string select menu.

$getUserSelectUserCount

Returns how many values were selected in a user select menu.

$getUserSelectUserID[index]

Gets the ID of the user selected via a user select menu.

$getUserSelectUserIDs[separator;(limit)]

Gets all user IDs selected via a multi-select user select menu.

$newModal[customId;title]

Creates a new modal (interactive pop-up window) with a title and a custom identifier to handle su...

$removeAllComponents[(messageID)]

Removes all components from the response being built, or from an existing message sent by the bot.

$removeButtons[(messageID)]

Removes all buttons from the response being built, or from an existing message sent by the bot. O...

$removeComponent[customId;(messageID)]

Removes a specific component from the response being built or from an existing message, using its...

$removeSelectMenuOption[Menu ID;Value;(Message ID)]

Removes one option, identified by its value, from a string select menu.

HTTP & JSON

(35)
$httpAddHeader[name;value]

Sets a header for the next HTTP request made with $httpGet, $httpPost, $httpPut, $httpPatch, $htt...

$httpDelete[url;(body)]

Sends an HTTP DELETE request (optionally with a body), stores the response for $httpStatus and $h...

$httpGet[url;(body)]

Sends an HTTP GET request to the URL, stores the response for $httpStatus and $httpResult and ret...

$httpGetHeader[Key]

Returns the value of a header of the response to the latest HTTP request.

$httpHead[url;(body)]

Sends an HTTP HEAD request to a URL and keeps the response for $httpStatus.

$httpPatch[url;(body)]

Sends an HTTP PATCH request with an optional body, stores the response for $httpStatus and $httpR...

$httpPost[url;(body)]

Sends an HTTP POST request with an optional body, stores the response for $httpStatus and $httpRe...

$httpPut[url;(body)]

Sends an HTTP PUT request with an optional body, stores the response for $httpStatus and $httpRes...

$httpRemoveHeader[Name]

Removes a header added with $httpAddHeader before the next HTTP request is sent.

$httpResult[(key1);(key2);(...)]

Returns the body of the last HTTP response, or the JSON value found by following the given keys; ...

$httpStatus[]

Returns the numeric HTTP status code of the most recent HTTP request (made with $httpGet, $httpPo...

$json[(key);(...)]

With one argument starting with { or [, replaces the current JSON document and returns an empty s...

$jsonArray[(key);(...);(separator)]

Converts the string stored at a path of the current JSON document into an array by splitting it o...

$jsonArrayAppend[key;(...);value]

Appends a value to the end of the JSON array at a path of the current document; creates the array...

$jsonArrayCount[(key);(...)]

Returns the number of items in the JSON array at a path of the current document, or 0 if the valu...

$jsonArrayIndex[key;(...);value]

Returns the position (zero-based) of a value in the JSON array at a path of the current document,...

$jsonArrayPop[(key);(...)]

Removes and returns the last item of the JSON array at a path of the current document; a missing ...

$jsonArrayReverse[(key);(...)]

Reverses, in place, the JSON array at a path of the current document; a missing or non-array valu...

$jsonArrayShift[(key);(...)]

Removes and returns the first item of the JSON array at a path of the current document; a missing...

$jsonArraySort[key;(...);(order)]

Sorts, in place, the JSON array at a path of the current document, ascending by default or descen...

$jsonArrayUnshift[key;(...);value]

Adds a value to the beginning of the JSON array at a path of the current document; creates the ar...

$jsonClear[]

Empties the current JSON document, back to the state before any $jsonParse or $jsonSet, and retur...

$jsonExists[(key);(...)]

Checks whether a path exists in the current JSON document and returns true or false (a key whose ...

$jsonForEach[(key)] ... $endJsonForEach

Iterates over each key-value pair of the object, or each element of the array, found at a path of...

$jsonIndex[]

Returns the zero-based index of the current element during a $jsonForEach loop; an empty string o...

$jsonJoinArray[key;(...);separator]

Joins the elements of the JSON array at a path of the current document into a string with the giv...

$jsonKey[]

Returns the key of the current element during a $jsonForEach loop (the index for an array); an em...

$jsonKeys[(key);(...);(separator)]

Returns the keys of the JSON object at a path of the current document, joined by a separator (def...

$jsonParse[json]

Parses a JSON string into the current JSON document, replacing it; invalid JSON or a scalar gives...

$jsonPretty[(indent)]

Returns the current JSON document as indented, multi-line JSON text; the indent defaults to 2 spa...

$jsonSet[key;(...);value]

Sets the value at a path of the current JSON document, creating missing levels; numbers, booleans...

$jsonSetString[key;(...);value]

Sets the value at a path of the current JSON document as a string, without converting numbers, bo...

$jsonStringify[]

Returns the current JSON document as compact JSON text; empty if no JSON document exists yet.

$jsonUnset[(key);(...)]

Removes a key (or array element) and its value from the current JSON document. With no argument, ...

$jsonValue[(key);(...)]

Returns the value at a path of the current JSON document (one argument per level); inside $jsonFo...

Image & Canvas

(15)
$attachImage[(canvasName)]

Renders a canvas created with $canvasCreate and attaches the PNG to the response; the canvas name...

$attachImage[(canvasName)]

Renders a canvas created with $canvasCreate[] and attaches it to the response as a PNG image name...

$canvasCompositeImage[url;x;y;width;height;(shape);(blend);(container)]

Draws an image from a URL, data URL or base64 text on the current canvas, optionally resized, cli...

$canvasContainer[name;x;y;width;height;(color)]

Defines a named container: later canvas functions that name it in their container argument have t...

$canvasCreate[name;width;height;(color)]

Creates a canvas with the given name, size and optional background color; the following canvas fu...

$canvasDrawCircle[x;y;radius;color;fill;(blend);(container)]

Draws a circle (filled or 1-pixel outline) on the current canvas, with an optional blend mode and...

$canvasDrawLine[x1;y1;x2;y2;color;thickness;(blend);(container)]

Draws a line between two points on the current canvas, with a thickness, an optional blend mode a...

$canvasDrawRect[x;y;width;height;color;fill;(blend);(container)]

Draws a rectangle (filled or 1-pixel outline) on the current canvas, with an optional blend mode ...

$canvasDrawText[text;x;y;fontSize;color;(textAlign);(maxWidth);(container)]

Draws text on the current canvas at a position, with a font size, color and optional alignment in...

$canvasGrayscale[(unused)]

Converts the current canvas to grayscale. One optional argument is accepted and ignored.

$canvasInvert[(unused)]

Inverts the colors of the current canvas (negative). One optional argument is accepted and ignored.

$canvasLoadImage[url;(x);(y);(width);(height);(container)]

Loads an image from a URL, data URL or base64 text; it replaces the canvas when placed at 0,0 wit...

$canvasProgressBar[x;y;width;height;percentage;barColor;trackColor;(textColor);(borderWidth);(orientation);(fontSize);(container);(borderRadius)]

Draws a progress bar (horizontal or vertical) with a track, a fill, a centered percentage label a...

$canvasRotate[degrees;(unused)]

Rotates the current canvas clockwise by an angle in degrees; the canvas grows to hold the result....

$canvasSetPixel[x;y;color;(container)]

Sets the color of one pixel of the current canvas. Coordinates outside the canvas are ignored.

Moderation

(89)
$addCmdReactions[emoji1;(emoji2);(...)]

Adds one or more reactions to the user's command message (the message that triggered the command).

$addEmoji[name;url;returnEmoji]

Adds a new custom emoji to the server from an image URL. The third argument (yes/no) chooses whet...

$addMessageReactions[channelID;messageID;emoji1;...]

Adds one or more reactions to a specific message identified by its channel and message IDs.

$addReactions[emoji1;(emoji2);(...)]

Adds one or more reactions to the bot's response message (the message sent by the current command...

$authorPerms

Returns the list of permissions of the command's author as supplied by the execution context (low...

$ban[(reason)]

Bans the first mentioned user with an optional reason.

$banID[(reason);(userID)]

Bans a user ID, with the reason as the first argument. In a prefix command, an omitted ID falls b...

$blacklistIDs[userID1;userID2;...;errorMessage]

Guard function that blacklists users by ID. If the triggering user ID is in the list, the command...

$blacklistRoles[roleName1;roleName2;...;errorMessage]

Guard function that blacklists roles by name. If the user has any of the roles, the command is in...

$blacklistRolesIDs[roleID1;roleID2;...;errorMessage]

Guard function that blacklists roles by ID. If the user has any of the roles, the command is inte...

$blacklistRolesIDs[roleID1;roleID2;...;errorMessage]

Guard function that blacklists roles by ID. If the user has any of the roles, the command is inte...

$blacklistServers[guildID1;guildID2;...;errorMessage]

Guard function that blacklists servers. If the command is executed on a blacklisted server, it is...

$blacklistUsers[username1;username2;...;errorMessage]

Guard function that blacklists users by username. The command is interrupted if the username of t...

$botLeave[(guildID)]

Makes the bot leave a server. If no ID is provided, the bot leaves the server where the command w...

$botTyping

Triggers the typing indicator in the current channel, showing users that the bot is typing.

$changeUsername[newName]

Changes the server nickname of the first user mentioned in the message (the command author if nob...

$changeUsernameWithID[userID;newName]

Changes the server nickname of the user whose ID is given.

$channelSendMessage[channelID;content;(replyMessageID)]

Sends a text message in a specific channel. Unlike $sendMessage which responds in the current cha...

$checkUserPerms[userID;permission1;permission2;...]

Checks if a user has all the specified permissions. Alias of $hasPerms. Returns "true" or "false".

$clear[(amount);(userID);(removePinned)]

Deletes a specified number of messages in the channel.

$clearReactions[channelID;messageID;emoji]

Removes all reactions, or all reactions of one emoji, from a specific message.

$closeTicket[(errorMessage)]

Deletes the current channel if its name contains "ticket"; otherwise returns the error message an...

$createChannel[name;type;(categoryID)]

Creates a new channel on the server. Supports text, voice, category, stage and forum channels.

$createRole[name;color;(hoist);(mentionable)]

Creates a new role on the Discord server.

$customEmoji[name]

Returns the markup of a custom emoji in the format <:name:ID> for display in a message. The emoji...

$deleteChannels[channelID1;channelID2;...]

Deletes one or multiple channels by their ID (at least one ID required). $deleteChannelsByName is...

$deleteCommand

Deletes the user's command message (the message that triggered the command). Useful for keeping c...

$deleteRole[roleID]

Deletes a role from the Discord server.

$editChannelPerms[channelID;roleOrUserID;permission1;(permission2);...]

Modifies the permissions of a role or a user on a specific channel using permission names prefixe...

$editThread[threadID;(name);(archived);(autoArchiveDuration);(locked);(slowmode)]

Modifies the properties of an existing thread: name, archive status, auto-archive duration, lock,...

$emojiCount[(guildID)] / $emoteCount

Returns the number of custom emojis of a server. $emojiCount accepts an optional server ID; $emot...

$emojiExists[emojiID]

Checks if a custom emoji with a given ID exists on the current server or on another server of the...

$emojiName[emojiID]

Gets the name of a custom emoji from its ID.

$getBanReason[userID;(guildID)]

Gets the ban reason of a banned user on the server. Returns the reason stored in the server's ban...

$getBotInvite

Returns the bot's invite link (scopes bot and applications.commands, with the configured permissi...

$getInviteInfo[code;property]

Gets a property of a Discord invite from its code (channel, creation date, inviter, temporary sta...

$getMessage[channelID;messageID;(property)]

Gets the content, author ID, author username or author avatar URL of a message specified by its c...

$getReactions[channelID;messageID;separator;emoji]

Returns the list of the users who reacted to a message with a given emoji, separated by the chose...

$getRoleColor[roleID]

Gets the hexadecimal color of a Discord role. Returns the color as six uppercase hexadecimal digi...

$getServerInvite[(guildID)]

Returns the server invite link supplied by the host in the context (guild.invite); it does not cr...

$giveRole[(userID);roleID]

Assigns a role to a user on the server.

$giveRoles[userID;role1;role2;...]

Assigns several roles to a user in a single operation.

$hasPerms[userID;permission1;permission2;...]

Checks if a user has all specified permissions. Returns "true" or "false". Inline check, does not...

$ignoreChannels[channelID1;channelID2;...;errorMessage]

Guard function that stops command execution if it is triggered in one of the listed channels.

$ignoreLinks

Accepted for compatibility with BDFD scripts; in this engine it does nothing and returns an empty...

$isTicket[(channelID)]

Returns true if the name of a channel (the current one by default) contains "ticket", false other...

$kick[userID;(reason)]

Kicks a specific user from the Discord server.

$kickMention[reason]

Kicks the first user mentioned in a prefix command.

$modifyChannel[channelID;(name);(topic);(nsfw);(position);(categoryID)]

Modifies the properties of an existing channel, such as its name, topic, NSFW status, position, a...

$modifyChannelPerms[channelID;permission;roleOrUserID]

Deprecated variant of $editChannelPerms that takes one or several permissions (+ allow, - deny, /...

$modifyRole[roleID;(name);(color);(hoist);(mentionable);(position)]

Modifies the properties of an existing role.

$modifyRolePerms[roleID;permission1;(permission2);...]

Toggles the listed permissions of an existing role.

$mute[roleName]

Grants a role, identified by its name, to the user(s) mentioned in the message (role-based mute).

$newTicket[categoryIDorName;noSubjectMessage;inTicketMessage;messageToUser;errorMessage;(ticketNumber);(returnMessageID)]

Creates a private ticket channel for the command author, sends an optional message in it, and ans...

$onlyAdmin[errorMessage]

A guard function that stops command execution if the author is not an administrator of the server...

$onlyBotChannelPerms[channelID;permission1;permission2;...;errorMessage]

A guard function that stops execution if the bot does not have the specified permissions in a giv...

$onlyBotPerms[permission1;permission2;...;errorMessage]

A guard function that stops execution if the bot does not have all specified permissions on the s...

$onlyForCategories[categoryID1;categoryID2;...;errorMessage]

A guard function that stops execution if the current channel does not belong to one of the specif...

$onlyForChannels[channelID1;channelID2;...;errorMessage]

A guard function that stops execution if the command is not executed in one of the specified chan...

$onlyForIDs[userID1;userID2;...;errorMessage]

A guard function that stops execution if the user's ID is not in the list of allowed IDs.

$onlyForRoleIDs[roleID1;roleID2;...;errorMessage]

A guard function that stops execution if the user does not possess any of the specified roles, co...

$onlyForRoles[roleName1;roleName2;...;errorMessage]

A guard function that stops execution if the user does not possess any of the specified roles (co...

$onlyForServers[guildID1;guildID2;...;errorMessage]

Guard function that stops execution if the command is not used in one of the specified servers.

$onlyForUsers[username1;username2;...;errorMessage]

Guard function that stops execution if the username of the user is not in the list.

$onlyNSFW[errorMessage]

Guard function that stops execution if the current channel is not marked as NSFW, optionally send...

$onlyPerms[permission1;permission2;...;errorMessage]

Guard function that stops command execution if the user does not have all the specified permissions.

$pinMessage[Channel ID;Message ID]

Pins a message from its channel and message ID. Without argument, pins the message sent by the cu...

$publishMessage[channelID;messageID]

Publishes a message of an announcement channel to the servers that follow it.

$registerGuildCommands[name]

Registers the bot's local-only slash commands on the current server, all of them or only those na...

$removeEmoji[emojiID]

Removes a custom emoji from the current server by its ID.

$removeReaction[channelID;messageID;userID;emoji]

Removes all reactions of a given emoji from a given message. Useful for removing control reaction...

$roleGrant[userID;+roleID1;-roleID2;...]

Adds and removes several roles of a user in one call, each role ID being prefixed by + (add) or -...

$setNickname[nickname;(userID)]

Modifies the nickname of a user on the server.

$setUserRoles[userID;role1;(role2;...)]

Sets the exact list of roles for a user, replacing all of their current roles.

$startThread[name;channelID;messageID;(autoArchiveDuration);(returnID)]

Creates a discussion thread from the current message or a specified message. Threads allow organi...

$takeRole[userID;roleID] or $takeRole[roleID]

Removes a role from a user on the server.

$takeRoles[userID;role1;role2;...]

Removes several roles from a user in a single operation.

$threadAddMember[threadID;userID]

Adds a member to a thread. Useful for private threads where members must be added manually.

$threadMessageCount

Returns the total number of messages in a thread. Includes messages within the thread only, not t...

$threadRemoveMember[threadID;userID]

Removes a member from a thread. The user will no longer be able to view or participate in the pri...

$threadUserCount

Returns the number of members in a thread. Useful for tracking participation in discussions.

$timeout[duration;(userID)]

Temporarily times out a user (temporary silence).

$unBan

Unbans the banned user whose username matches the text of the message. The user will be able to r...

$unBanID[(userID)]

Unbans a user from the server using their ID. If no ID is given, the last word of the message is ...

$unTimeout[(userID)]

Removes the timeout of a user before its expiration.

$unmute[roleName]

Removes a role, identified by its name, from the user(s) mentioned in the message (role-based unm...

$unpinMessage[channelID;messageID]

Removes a pinned message from the pinned messages list of the channel.

$unregisterGuildCommands[name]

Deletes the slash commands of the bot on the current server, all of them or only those named. Glo...

$voiceUserLimit[(channelID)]

Returns the user limit recorded for the channel of the current command (0 when there is none). Th...

Math & Text

(57)
$c[expression]

Comment: the text between the brackets is never evaluated and the function returns an empty strin...

$calculate[expression]

Evaluates an arithmetic expression with + - * / % ^ and parentheses. Not supported: functions (si...

$ceil[value]

Rounds a number up to the next integer.

$charCount[text]

Counts the number of characters in the given text.

$cropText[text;maxLength;suffix]

Truncates text to a maximum length and appends a suffix when truncation occurs.

$divide[a;(b;...)]

Divides the first value by the following ones, from left to right. A divisor equal to 0 raises an...

$editSplitText[index;newValue]

Replaces the element at the given 1-based position of the current split text (made by $textSplit)...

$floor[value]

Rounds a number down to the nearest integer.

$getTextSplitIndex[value]

Returns the position (starting at 1) of a value in the elements produced by the last $textSplit, ...

$getTextSplitLength

Returns the total number of elements in the current split text, as produced by the last $textSplit.

$getTimestampMs

Returns the current Unix timestamp in milliseconds.

$hasRole[userID;roleID]

Checks if a user has a specific role on the server.

$isBanned[userID]

Checks if a user is banned from the current server.

$isBoolean[value]

Checks if a value is one of the boolean words true, false, yes, no, on, off, enable or disable (l...

$isEmojiAnimated[emojiID]

Checks if a custom emoji, given by its ID, is animated.

$isInteger[value]

Checks if a value is an integer (positive, negative or zero) that fits in a 64-bit signed integer.

$isNSFW[channelID]

Checks if a channel is marked as NSFW.

$isNumber[value]

Checks if a value is a finite number (decimal, scientific notation, or 0x/0b/0o prefixed integer).

$isSlash

Checks if the command was triggered via a slash command.

$isUserDmEnabled[(userID)]

Returns the DM-enabled flag of the user in the execution context ("true" by default).

$isValidHex[value]

Checks if a string consists only of hexadecimal digits, with an optional leading

$joinSplitText[separator]

Joins all elements from the current split text back into a single string, separated by the given ...

$linesCount[text]

Counts the lines of a text, i.e. the number of line breaks (LF) plus one. An empty text is an error.

$log[message;level]

Records a message in the execution log, with an optional level (success, info, warning or error)....

$max[value1;value2;(value3;...)]

Returns the largest value among the provided arguments.

$min[value1;value2;(value3;...)]

Returns the smallest value among the provided arguments.

$modulo[a;b]

Calculates the remainder of the integer division of a by b (a % b). Dividing by 0 is an error.

$multi[value1;(value2;...)]

Multiplies two or more values.

$numberSeparator[number;(separator)]

Formats an integer by inserting a separator (comma by default) between groups of three digits.

$random[(min;max)]

Generates a random number between min (inclusive) and max (exclusive); without arguments, a rando...

$randomCategoryID[(guildID)]

Returns the ID of a random category of the current server, or of the server given as an argument.

$randomChannelID

Returns the ID of a random channel of the current server.

$randomGuildID

Returns the ID of a random server among the servers where the bot is present.

$randomMention

Returns the mention (format <@id>) of a random member of the server.

$randomRoleID[(guildID)]

Returns the ID of a random role of the current server, or of the server given as an argument.

$randomString[length]

Generates a random alphanumeric string of the specified length.

$randomText[option1;(option2;...)]

Randomly chooses and returns an option from a list of provided text options.

$randomUser

Returns the username of a random member of the server.

$randomUserID

Returns the ID of a random member of the server.

$removeContains[text;toRemove]

Removes all occurrences of a string in a given text. Searches and replaces with an empty string.

$removeLinks[Text]

Returns a text without its http:// and https:// links. Without argument, it is a flag that remove...

$removeSplitTextElement[index]

Removes the element at the given 1-based index from the current split text. An index out of range...

$repeatMessage[count;message]

Returns the given text repeated count times (0 to 10), with nothing between the copies. It does n...

$replaceText[input;search;replacement;(amount)]

Replaces occurrences of a search string with a replacement string in the given input text. By def...

$round[value;(decimals)]

Rounds a number to the nearest integer, or to a given number of decimal places. Values ending exa...

$sort[number1;(number2;...);direction;amount;separator]

Sorts the given numbers in ascending or descending order and returns them joined by a separator.

$splitText[index]

Retrieves the element at the given 1-based index (or < for the first, > for the last) from the mo...

$sqrt[value]

Calculates the square root of a number.

$sub[value1;(value2;...)]

Subtracts the following values from the first one (a - b - c ...).

$sum[value1;(value2;...)]

Calculates the sum of all provided values.

$textSplit[text;separator]

Splits a text at every occurrence of a separator and stores the pieces for later access with $spl...

$toLowercase[text]

Converts all characters in the given text to lowercase.

$toTitlecase[text]

Converts the first letter of each word to uppercase and the rest to lowercase.

$toUppercase[text]

Converts all characters in the given text to uppercase.

$trimContent[text]

Removes leading and trailing whitespace from a text and collapses repeated spaces into one. Witho...

$trimSpace[text]

Removes leading and trailing whitespace (spaces, tabs, newlines) from the given text.

$unEscape[text]

Returns its text unchanged. Its only effect is inside $randomText, where semicolons in the text b...

Date & Time

(10)

Music

(18)

Webhooks & Integrations

(10)

Cooldown

(3)

Permission

(2)

Flags & Debug

(8)

Meta

(8)

Misc

(11)