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

Public API

Manage a bot from your own code with API keys. Premium only.

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

Guides

(7)

Embed & Message

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

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

$addFile[file;(spoiler);(containerId)]

Shows a file attached to the message as a component (Components V2), optionally inside a container.

$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 ...

$allowMention

Accepted for compatibility. In the engine it does nothing.

$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...

$autocompleteFromList[list;(separator);(filter)]

In an autocomplete script, suggests every item of a list in one call (replaces one `$appendOption...

$color[hexColor;(embedIndex)]

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

$deleteField[fieldindex;(index)]

Deletes an embed field

$deleteIn[duration;(reason)]

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

$deleteMessage[channelId;messageId;(reason)]

Deletes a specific message, identified by its channel ID and message ID.

$description[text;(embedIndex)]

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

$disableEveryoneMention

Disables everyone mention

$disableRoleMentions

Disables all role mentions

$disableUserMentions

Disables all user mentions

$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...

$editField[fieldindex;(name);(value);(inline);(index)]

Edits an embed field

$editIn[duration;content]

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

$editMessage[channelId;messageId;newContent;(title;description;color;footer)]

Edits an existing message sent by the bot, or the message of the button or select menu that was j...

$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...

$linkButton[label;url;(newRow);(messageID)]

A link button in one call (shortcut of `$addButton` with the `link` style).

$noMention

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

$reply[(channelId;messageId)]

Sends the command's main response as a reply to an existing message.

$replyEmbed[title;description;(color);(footer)]

An embed in one call, instead of `$title`, `$description`, `$color` and `$footer`.

$replyFail[text;(ephemeral)]

A failure message as a styled embed (❌, color `#ED4245`). `$error` is already used by the engine,...

$replyIn[duration]

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

$replyInfo[text;(ephemeral)]

A information message as a styled embed (ℹ️, color `#5865F2`). `$error` is already used by the en...

$replySuccess[text;(ephemeral)]

A success message as a styled embed (✅, color `#57F287`). `$error` is already used by the engine,...

$replyWarn[text;(ephemeral)]

A warning message as a styled embed (⚠️, color `#FEE75C`). `$error` is already used by the engine...

$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...

$sendToSetting[variable;text;(scope);(target);(guildID)]

Sends a message to the channel stored in a setting. Does nothing while the setting is empty or is...

$thumbnail[url;(embedIndex)]

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

$timestamp[(ms);(index)]

Adds an embed timestamp

$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

(63)
$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...

$compareAndSetVar[variable;expected;new;(scope);(target);(guildID)]

Writes a value only while the variable still equals the expected one, and returns `true` or `fals...

$decrement[variable;(amount);(scope);(target);(guildID)]

Subtracts from a number variable and returns the new value.

$delete[name]

Deletes a local variable.

$deleteRoleVar[name;roleID]

Deletes the value stored for a role (it reads as the default again).

$enabled[yes/no;(errorMessage)]

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

$env[name;(key)]

Reads a local variable, or a key of its JSON value.

$get[name]

Reads a local variable set by $let.

$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...

$getRoleVar[name;roleID;(default)]

Value of a variable stored for a role (one value per role of the bot). The default is returned wh...

$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...

$has[name]

Tells whether a local variable exists.

$increment[variable;(amount);(scope);(target);(guildID)]

Adds to a number variable and returns the new value. An empty variable counts as 0.

$input[inputID]

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

$inputValues[inputID;(separator)]

Returns every value submitted for a modal field: all checked options, all selected entries or the...

$let[name;value]

Stores a value in a local variable of the script run.

$letDivide[name;value]

Divides a local variable by a number (error when dividing by zero).

$letMulti[name;value]

Multiplies a local variable by a number.

$letSub[name;value]

Subtracts a number from a local variable.

$letSum[name;value]

Adds a number to a local variable (0 when unset).

$listVar[(separator)]

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

$listVars[prefix;(separator);(limit)]

Lists the names of the global variables that start with a prefix.

$noMentionMessage[n]

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

$onlyIfSet[variable;message;(scope);(target);(guildID)]

Stops the script with a message while a setting is empty. A setting (log channel, role…) is empty...

$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 ...

$setRoleVar[name;value;roleID]

Stores a value in a variable of a role.

$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.

$toggleVar[variable;(scope);(target);(guildID)]

Flips a variable between `true` and `false` and returns the new value. An empty variable counts a...

$tryLock[name;(duration)]

Takes a named lock and returns `true`, or returns `false` while another script holds it. The lock...

$unlock[name]

Releases a lock taken with `$tryLock`.

$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

(45)
$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[...

$auditLogReason[(reason)]

Sets the reason shown in the server's audit log for every Discord action the script runs after it...

$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.

$callLocalFunction[name;(args...)]

Calls a local function

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

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

$case[value;code]

Adds a switch case

$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].

$endsWith[text;suffix;(suffix2;...);errorMessage]

Stops command execution if the given text does not end with one of the listed suffixes (case-inse...

$escapeCode[code]

Code inside this function will not be executed

$eval[bdfdCode]

Dynamically parses and executes a string of BibiScript code at runtime. The code is treated as a ...

$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...

$localFunction[name;code;(params...)]

Defines a new local function

$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.

$onlyForGuilds[code;guilds...]

Only executes code if given ids match the guild

$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...

$return[value]

Returns a value

$scope[code;(syncvars)]

Runs functions in a cloned context

$skipActions[count]

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

$startsWith[text;prefix;(prefix2;...);errorMessage]

Stops command execution if the given text does not start with one of the listed prefixes (case-in...

$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...

$switch[value;cases]

Switch-case statement for javascript

$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

(388)
$activeThreads[(guildID);(separator);(property)]

Lists the active threads of the server.

$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...

$appEmoji[(property);(separator)]

Another name of $getApplicationEmojis: same arguments, same result.

$archivedThreads[channelID;(type);(separator);(property);(limit)]

Lists the archived threads of a text channel.

$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 server tag the author displays next to their name (for example "BCS"), or an empty st...

$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[(guildID)]

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

$botCustomInvite

Returns the client's custom invite link

$botDescription

Returns the description of the bot

$botID

Returns the user ID of the bot.

$botListDescription[text]

Compatibility flag for the BibiScript bot list description. It takes exactly one argument and has...

$botListHide

Compatibility flag for the BibiScript bot list. It takes no argument and has no effect in the eng...

$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.

$botTags[(separator)]

Returns the client tags

$botTeamCreatedAt

Returns the client's team creation timestamp

$botTeamID

Returns the ID of the Discord team that owns the bot application.

$botTeamIcon[(size);(extension)]

Returns the client's team icon

$botTeamMembers[property;(separator)]

Returns the client's team members

$botTeamName

Returns the client's team name

$botUserAuthorizationCount

Returns the user authorization count of the bot

$botUserInstallCount

Returns the user install count of the bot

$botWebhookEvents[(separator)]

Returns the client webhook event types

$botWebhookStatus

Returns the client webhook event status

$botWebhookURL

Returns the client webhook event url

$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.

$channelBitrate[channelID]

Returns the bitrate of the voice channel.

$channelCategoryID[(channelID)]

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

$channelChildrenCount[channelID]

Returns the amount of children this category has.

$channelChildrenIDs[channelID;(separator)]

Returns the children ids this category has.

$channelCount

Returns the total number of channels on the server.

$channelCreatedAt[channelID]

Returns the channel timestamp.

$channelData[(channelID);(field)]

Reads a channel from Discord: the whole object as JSON, or one field.

$channelExists[channelID]

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

$channelFlags[channelID;(separator)]

Returns the flags of a channel.

$channelFull[(channelID)]

Whether a voice channel has reached its user limit.

$channelGuildID[channelID]

Returns the channel guild id.

$channelHasAnyPerms[channelID;id;permissions...]

Returns whether role or member has any of the perms in a channel

$channelHasPerms[channelID;id;permissions...]

Returns whether role or member has perms in a channel

$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.

$channelIDs[(separator)]

Returns every channel id.

$channelInvites[channelID;(separator);(property)]

Lists the invitations of a channel.

$channelIsChildrenOf[channelID;categoryID]

Checks whether given channel is a children of a category.

$channelMemberCount[(channelID)]

Alias of $channelVoiceMemberCount.

$channelMemberIDs[(channelID);(separator)]

Alias of $channelVoiceMemberIDs.

$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.

$channelPermissionsOf[channelID;id;state;(separator)]

Returns specific permissions of a role or member in a channel

$channelPinnedMessages[channelID;(separator)]

Returns the pinned messages of a channel.

$channelPosition[(channelID)]

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

$channelTags[channelID;(separator)]

Retrieves tags from a forum thread.

$channelThreadIDs[channelID;(separator)]

Returns the thread ids of a channel.

$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.).

$channelURL[channelID]

Returns the url of a channel.

$channelUserLimit[channelID]

Returns the user limit of the voice channel.

$channelVoiceMemberCount[(channelID)]

Number of members connected to a voice channel.

$channelVoiceMemberIDs[(channelID);(separator)]

IDs of the members connected to a voice channel.

$channelVoiceRegion[channelID]

Returns the region of a voice channel.

$colorRole[color;(reason)]

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

$commandEventDescription

Returns the description of the command that triggered a Command Created, Command Updated or Comma...

$commandEventID

Returns the ID of the command that triggered a Command Created, Command Updated or Command Delete...

$commandEventMode

Returns the way the command is built (`workflow`, `bdfd_script` or `javascript`) that triggered a...

$commandEventName

Returns the name of the command (for a deletion, the name it had) that triggered a Command Create...

$commandEventPreviousName

Returns the previous name of the command after a rename, empty otherwise that triggered a Command...

$commandEventType

Returns the type of the command (`chatInput`, `user` or `message`) that triggered a Command Creat...

$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...

$customStatus[(guildID);(userID);(type)]

Alias of $memberCustomStatus.

$disableAllMentions

Disables every possible mention.

$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.

$emojiData[emojiID;(field);(guildID)]

Reads a custom emoji of the server from Discord: the whole object as JSON, or one field.

$enableAllMentions

Enables every possible mention.

$executionTime

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

$fetchApplication

Fetches the application of the client.

$fetchChannels[guildID;(channelID)]

Caches all channels of a guild.

$fetchMembers[guildID;(userID)]

Caches all members of a guild.

$fetchRoles[guildID;(roleID)]

Caches all roles of a guild.

$fetchThreads[channelID;(archived);(private)]

Caches all threads of a channel

$findApplicationEmoji[query]

Finds an application emoji of the client

$findChannel[query]

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

$findEmoji[query]

Finds an emoji

$findGuild[query;(returnguild)]

Finds a guild

$findGuildChannel[guildID;query;(returnchannel)]

Finds a channel of a guild

$findGuildEmoji[guildID;query]

Finds an emoji of a guild

$findMembers[guildID;query;(limit);(enumvalue);(separator)]

Finds member of a guild using a query

$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...

$firstMessageID[channelID]

Returns the first message sent in a channel.

$forumDefaultLayout[channelID]

Returns the default layout of a forum.

$forumDefaultReactionEmoji[channelID]

Returns the default reaction emoji of a forum.

$forumDefaultSortOrder[channelID]

Returns the default sort order of a forum.

$forumDefaultThreadArchiveDuration[channelID]

Returns the default auto archive duration for threads of a forum.

$forumDefaultThreadSlowmode[channelID]

Returns the default slowmode for threads of a forum.

$getApplicationEmojis[(property);(separator)]

Gets all application emojis

$getAttachments[index]

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

$getAutomodRule[guildID;ruleID;(property);(separator)]

Returns an automod rule of a guild

$getAutomodRuleActions[guildID;ruleID;(property);(separator)]

Returns the actions of an automod rule from a guild

$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...

$getEmbeds[channelID;messageID;(embedindex);(property);(fieldindex)]

Retrieves data of an embed, not providing any property returns embed json

$getGuildPreview[guildID;(property);(separator)]

Returns the preview of a guild.

$getGuildTemplate[templatecode;(property)]

Gets the data of a guild template.

$getMembersCount

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

$getMessageReactionCount[channelID;messageID;emoji;(type)]

Gets the amount of users that have reacted to a specific emoji

$getMessageReactionUsers[channelID;messageID;emoji;(separator)]

Gets the user ids that have reacted to a specific emoji

$getPoll[channelID;messageID;property]

Retrieves data of a poll from a message

$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.

$getSnapshots[channelID;messageID;(index);(property);(separator)]

Retrieves data of snapshots from a message

$getStageInstance[stageID;(property)]

Returns a stage instance of a guild.

$getThreadMembers[channelID;(separator)]

Returns all members from a thread.

$getUserStatus[(userID)]

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

$getWebhook[webhookID;(property)]

Returns a webhook from a channel

$guildApproximateMemberCount[guildID]

Returns the approximated member count.

$guildApproximatePresenceCount[guildID]

Returns the approximated presence count.

$guildAutomodRules[guildID;(property);(separator)]

Returns all automod rules of a guild.

$guildAvailable[guildID]

Returns whether the server is available.

$guildBannedMembers[guildID;(separator)]

Returns banned member ids of a guild.

$guildBanner[guildID]

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

$guildBoostProgressBarEnabled[guildID]

Returns whether a guild has the boost progress bar enabled.

$guildBoostRoleID[guildID]

Returns the server boost role id.

$guildBoosterIDs[guildID;(separator)]

Returns all current boosters of a guild.

$guildBotIDs[(guildID);(separator)]

Lists the IDs of the bot accounts of a server.

$guildChannelIDs[guildID;(separator)]

Returns every channel id of the guild.

$guildCount

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

$guildDefaultMessageNotifications[guildID]

Returns the default message notifications for this guild.

$guildDiscoverySplash[guildID;(size);(extension)]

Returns the guild discovery splash.

$guildDmSpamDetectedAt[guildID]

Returns when a direct message spam was detected on a guild.

$guildDmsDisabledUntil[guildID]

Returns the direct messages disabled timestamp of a guild.

$guildEmojiExists[guildID;emojiID]

Returns whether an emoji id exists on a guild.

$guildEmojiIDs[guildID;(separator)]

Returns every emoji id of the guild.

$guildEmojiLimit[guildID]

Returns the emoji limit of a guild.

$guildExists[guildId]

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

$guildExplicitContentFilter[guildID]

Returns the explicit content filter level for this guild.

$guildFeatures[(guildID)]

Returns the features of the current server, as a comma-separated list of Discord feature codes (a...

$guildHasAnyFeatures[guildID;features]

Returns whether this guild has any of the given features.

$guildHasFeatures[guildID;features]

Returns whether this guild has all the given features.

$guildHasTemplate[guildID]

Returns whether this guild has a template.

$guildHighestRoleID[guildID]

Returns the highest role id of a guild.

$guildID[(Server name)]

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

$guildIDs[(Amount;Separator;Offset)]

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

$guildIcon[(guildID)]

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

$guildInviteExists[guildID;code]

Returns whether a guild invite code exists.

$guildInvitesDisabledUntil[guildID]

Returns the invites disabled timestamp of a guild.

$guildLarge[guildID]

Returns whether a guild is considered as large.

$guildLowestRoleID[guildID]

Returns the lowest role id of a guild.

$guildMFALevel[guildID]

Returns the mfa level for this guild.

$guildMaxStageVideoChannelUsers[guildID]

Returns the maximum video channel users for stage channels of this guild.

$guildMaxVideoChannelUsers[guildID]

Returns the maximum video channel users for this guild.

$guildMaximumBitrate[guildID]

Returns the maximum bitrate for voice channels of this guild.

$guildMaximumMembers[guildID]

Returns the maximum members for this guild.

$guildMaximumPresences[guildID]

Returns the maximum presences for this guild.

$guildMaximumStageBitrate[guildID]

Returns the maximum bitrate for stage channels of this guild.

$guildMemberIDs[guildID;(separator)]

Returns all cached member ids of a guild.

$guildNSFWLevel[guildID]

Returns the nsfw level for this guild.

$guildName[(guildID)]

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

$guildNameAcronym[guildID]

Returns the server name acronym.

$guildPartnered[guildID]

Returns whether the server is partnered.

$guildPublicUpdatesChannelID[guildID]

Returns the server's public updates channel ID.

$guildRaidDetectedAt[guildID]

Returns when a raid was detected on a guild.

$guildRoleIDs[guildID;(separator);(everyone)]

Returns every role id of the guild.

$guildSafetyAlertsChannelID[guildID]

Returns the server's safety alerts channel ID.

$guildShardID[guildID]

Returns the server shard ID

$guildSoundboardLimit[guildID]

Returns the soundboard sound limit of a guild.

$guildSoundboardSounds[guildID;(property);(separator)]

Returns all soundboard sounds of a guild.

$guildSplashURL[guildID;(size);(extension)]

Returns the guild splash url.

$guildStickerExists[guildID;stickerID]

Returns whether a sticker id exists on a guild.

$guildStickerIDs[guildID;(separator)]

Returns every sticker id of the guild.

$guildStickerLimit[guildID]

Returns the sticker limit of a guild.

$guildSystemChannelFlags[guildID;(separator)]

Returns the system channel flags of a guild.

$guildTemplateCode[guildID]

Returns the template code of a guild.

$guildTimedOutMembers[guildID;(separator)]

Returns all current timed out members of a guild.

$guildVanityUses[guildID]

Returns the guilds vanity uses.

$guildVerified[guildID]

Returns whether the server is verified.

$guildWidgetChannelEnabled[guildID]

Returns whether widget channel is enabled for this guild.

$guildWidgetChannelID[guildID]

Returns the widget channel for this guild.

$hasComponents[channelID;messageID]

Checks whether given message has components

$hasEmbeds[channelID;messageID]

Checks whether given message has embeds

$hasPoll[channelID;messageID]

Checks whether given message holds a poll

$hasSnapshots[channelID;messageID]

Checks whether given message has snapshots

$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...

$integrations[(guildID);(separator);(property)]

Lists the integrations of the server (bots, Twitch, YouTube…).

$isAdmin[userID]

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

$isBannable[guildID;userID]

Returns whether a member is bannable

$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.

$isBotVerified[userID]

Returns whether the bot is verified.

$isChannelMentioned[channelID;messageID;channelID]

Returns whether a channel was mentioned in this message

$isDeaf[guildID;userID]

Returns whether a member is deafened.

$isGuildDeaf[guildID;userID]

Returns whether a member is server deafened.

$isGuildMuted[guildID;userID]

Returns whether a member is server muted.

$isHoisted[roleID]

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

$isKickable[guildID;userID]

Returns whether a member is kickable

$isManageable[guildID;userID]

Returns whether a member is manageable

$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".

$isModeratable[guildID;userID]

Returns whether a member is moderatable

$isMuted[guildID;userID]

Returns whether a member is muted.

$isRoleMentioned[channelID;messageID;roleID]

Returns whether a role was mentioned in this message

$isSelfDeaf[guildID;userID]

Returns whether a member is self deafened.

$isSelfMuted[guildID;userID]

Returns whether a member is self muted.

$isThread[channelID]

Returns whether the channel is a thread.

$isThreadOnly[channelID]

Returns whether the channel is a thread-only channel.

$isTimedOut[userID]

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

$isUserMentioned[channelID;messageID;userID]

Returns whether a user was mentioned in this message

$isVerified[guildID;userID]

Returns whether a member is verified.

$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...

$math[expr]

Runs math expression, returns nothing if incorrect expression.

$memberAvatarDecoration[guildID;userID]

Returns the member's avatar decoration.

$memberBoostingSince[guildID;userID]

Returns when the member started boosting the guild.

$memberBotRoleID[guildID;userID]

Returns the managed bot role of a member, only available for bots.

$memberCount

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

$memberCustomStatus[(guildID);(userID);(type)]

Custom status text of the user who ran the command. Empty for another user.

$memberData[(userID);(field);(guildID)]

Reads a member from Discord: the whole object as JSON, or one field.

$memberDisplayColor[guildID;userID]

Returns the display color of a member.

$memberExists[User ID;(Guild ID)]

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

$memberFlags[guildID;userID;(separator)]

Returns the flags of a member.

$memberHighestRoleID[guildID;userID]

Returns the highest role id of a member.

$memberID

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

$memberJoinPosition[guildID;userID]

Returns the position at which the member joined the guild

$memberLowestRoleID[guildID;userID]

Returns the lowest role id of a member.

$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...

$memberStatus[(guildID);(userID)]

Alias of $status.

$memberStatuses[(guildID);(userID)]

Alias of $status.

$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, > ...

$mentionedChannelCount

Returns the mentioned channel count

$mentionedChannels[index;(returnCurrent)]

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

$mentionedRoleCount

Returns the mentioned role count

$mentionedRoles[index]

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

$mentionedUserCount

Returns the mentioned user count

$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...

$messageAttachment[channelID;messageID;index]

Retrieves an attachment from this message

$messageAttachmentCount[channelID;messageID]

Retrieve the amount of attachments in this message

$messageAttachmentFlags[channelID;messageID;index;(separator)]

Returns the flags of an attachment from this message

$messageAttachments[channelID;messageID;(separator)]

Retrieves all attachments of this message

$messageData[channelID;messageID;(field)]

Reads a message: the whole object as JSON, or one field.

$messageEditedTimestamp[channelID;messageID]

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

$messageEmojis[channelID;messageID;(separator);(returnids)]

Retrieves all emojis of this message

$messageExists[channelID;messageID]

Returns whether given message id exists

$messageFlags[channelID;messageID;(separator)]

Returns the flags of a message

$messageID

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

$messageReferenceID[channelID;messageID]

Returns the message id that this message replies to

$messageSticker[channelID;messageID;index]

Retrieves a sticker url of this message

$messageStickerCount[channelID;messageID]

Retrieves sticker count of this message

$messageStickers[channelID;messageID;(separator);(type)]

Retrieves all stickers of this message

$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.

$messageWebhookID[channelID;messageID]

Returns the message's webhook id

$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...

$onboarding[(guildID);(field)]

Reads the onboarding settings of the server.

$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.

$pinnedMessages[channelID;(separator)]

Another name of $channelPinnedMessages: same arguments, same result.

$pollResult[channelID;messageID;property]

Another name of $getPoll: same arguments, same result.

$premiumExpireTime[(unused)]

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

$randomApplicationEmojiID

Returns a random emoji ID of the application

$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.

$roleCreatedAt[guildID;roleID]

Returns the role creation date.

$roleData[roleID;(field);(guildID)]

Reads a role from Discord: the whole object as JSON, or one field.

$roleEditable[guildID;roleID]

Returns whether the role is editable by the bot

$roleExists[roleID]

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

$roleFlags[guildID;roleID;(separator)]

Returns the role flags.

$roleHasAnyPerms[guildID;roleID;perms]

Returns whether the role has any of the specified perms.

$roleHasPerms[guildID;roleID;perms]

Returns whether the role has all specified perms.

$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...

$roleIntColor[guildID;roleID;(color)]

Returns the role color as int.

$roleManageable[guildID;roleID]

Returns whether the role is managed by discord

$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.

$roleRawPosition[guildID;roleID]

Returns the role raw position.

$roleTags[guildID;roleID;(separator)]

Returns all role tags.

$roleUnicodeEmoji[guildID;roleID]

Returns the unicode emoji used by the role.

$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.

$searchMembers[guildID;query;(limit);(enumvalue);(separator)]

Another name of $findMembers: same arguments, same result.

$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.

$serverData[(guildID);(field)]

Reads a server from Discord: the whole object as JSON, or one field.

$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.

$serverIDs[(Amount;Separator;Offset)]

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

$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...

$serverInvites[(guildID);(separator);(property)]

Lists the invitations of the server.

$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 ...

$serverRestore[json;(dryRun);(serverID)]

Recreates the roles and channels of a $serverSnapshot that are missing, and returns a JSON report...

$serverSnapshot[(serverID)]

Returns the structure of a server as JSON (roles, categories, channels and their permissions). No...

$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;(reason)]

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

$soundGuildID

ID of the server of the sound of the current soundboard event.

$soundboardSounds[guildID;(property);(separator)]

Another name of $guildSoundboardSounds: same arguments, same result.

$status[(guildID);(userID)]

Presence status (online, idle, dnd, offline) of the user who ran the command. Empty for another u...

$statuses[(guildID);(userID)]

Alias of $status.

$stickerCount[(unused)]

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

$stickerData[stickerID;(field)]

Reads a sticker from Discord: the whole object as JSON, or one field.

$stickerID

ID of the sticker of the current sticker event.

$systemChannelID

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

$threadIsArchived[channelID]

Returns whether a thread is archived.

$threadIsLocked[channelID]

Returns whether a thread is locked.

$threadMembers[channelID;(separator)]

Another name of $getThreadMembers: same arguments, same result.

$threadOwnerID[channelID]

Returns the owner of the thread.

$threadStarterMessageID[channelID]

Returns the id of the message that started this thread.

$useGuild[serverID]

Chooses the server the rest of the run acts on, even when it starts from a private message. Not i...

$userAccentColor[userID]

Returns the accent color of a user.

$userAvatar[userID;(size);(format)]

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

$userAvatarDecoration[userID;(format)]

Returns the URL of the avatar decoration of a user, or an empty string if they have none. Bot Cre...

$userBadges[(User ID;Separator)]

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

$userBanner[userID;(size);(format)]

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

$userCustomStatus[(guildID);(userID);(type)]

Alias of $memberCustomStatus.

$userData[(userID);(field)]

Reads a user from Discord: the whole object as JSON, or one field.

$userDefaultAvatar[userID]

Returns the default user avatar.

$userExists[userID]

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

$userGuildBadge[userID;(size);(extension)]

Returns the primary guild tag badge of a user.

$userGuildEnabled[userID]

Returns whether the primary guild of a user is enabled.

$userGuildID[userID]

Returns the primary guild id of a user.

$userGuildTag[userID]

Returns the primary guild tag name of a user.

$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.

$userReferenceID[channelID;messageID]

Returns the id of the user this message replies to

$userRoles[userID]

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

$userServerAvatar[userID;(size);(format)]

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

$userServerAvatarDecoration[userID;(format)]

Returns the URL of the avatar decoration of the member's server profile, or an empty string if th...

$userServerBanner[userID;(size);(format)]

Returns the URL of the member's server profile banner, or an empty string if they have none. Bot ...

$userTag[(userID)]

Returns the server tag a user displays next to their name (for example "BCS"), or an empty string...

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

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

$voiceMembers[(channelID);(separator)]

Another name of $channelVoiceMemberIDs: same arguments, same result.

$voiceUserCount[(channelID)]

Another name of $channelVoiceMemberCount: same arguments, same result.

$webhookExists[webhookID]

Checks whether given webhook id exists

$webhookIsUserCreated[webhookID]

Checks whether given webhook is user created

$webhookType[webhookID]

Returns the type of a webhook

$welcomeScreen[(guildID);(field)]

Reads the welcome screen of a community server.

Components & Interactions

(125)
$addActionRow[(id);(containerId)]

Starts a new action row for buttons.

$addActionRowTo[channelID;messageID;components;(keepexistingrows)]

Adds an action row (or rows) to a message

$addButton[newRow;customIdOrURL;label;style;(disabled);(emoji);(messageId)]

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

$addButtonCV2[customIdOrURL;label;(style);(disabled);(emoji);(rowId)]

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

$addCategorySelect[customId;(placeholder);(minValues);(maxValues);(disabled);(messageID)]

$addChannelSelect[customId;(placeholder);(minValues);(maxValues);(disabled);(messageID);(channelTypes)]

$addChannelSelectMenu[customID;(placeholder);(minvalues);(maxvalues);(disabled);(required)]

Creates a channel select menu

$addChannelSelectMenuTo[channelID;messageID;customID;(placeholder);(minvalues);(maxvalues);(disabled);(defaultchannels...)]

Creates a channel select menu on a message

$addChannelType[types...]

Adds channel types to the last select menu

$addCheckbox[customID;(default)]

Adds a new checkbox component to the newest modal label

$addCheckboxGroup[customID;(minoptions);(maxoptions);(required)]

Adds a new checkbox group component to the newest modal label

$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...

$addCheckboxOption[name;value;(description);(default)]

Adds a new option to the newest checkbox group component

$addChoice[choicename;choicevalue]

Adds an autocomplete choice

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

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

$addDefaultChannelOption[channelIDs...]

Adds default channel options to the last select menu

$addDefaultRoleOption[roleIDs...]

Adds default role options to the last select menu

$addDefaultUserOption[userIDs...]

Adds default user options to the last select menu

$addFileUpload[customID;(minvalues);(maxvalues);(required)]

Adds a new file upload component to the newest modal label

$addImageUpload[fieldID;label;(description);(required)]

Adds a field to the modal that lets the user upload one image.

$addLabel[name;(description);component]

Adds a new label component to the modal

$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 ...

$addMediaItem[url;(description);(spoiler)]

Adds a new media gallery item

$addMentionableSelect[customId;(placeholder);(minValues);(maxValues);(disabled);(messageID)]

$addMentionableSelectMenu[customID;(placeholder);(minvalues);(maxvalues);(disabled);(required)]

Creates a mentionable select menu

$addMentionableSelectMenuTo[channelID;messageID;customID;(placeholder);(minvalues);(maxvalues);(disabled);(defaultroles/users...)]

Creates a mentionable select menu on a message

$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...

$addOption[name;(description);value;(emoji);(default)]

Adds a select menu option

$addRadioGroup[customID;(required)]

Adds a new radio group component to the newest modal label

$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...

$addRadioOption[name;value;(description);(default)]

Adds a new option to the newest radio group component

$addRoleSelect[customId;(placeholder);(minValues);(maxValues);(disabled);(messageID)]

$addRoleSelectMenu[customID;(placeholder);(minvalues);(maxvalues);(disabled);(required)]

Creates a role select menu

$addRoleSelectMenuTo[channelID;messageID;customID;(placeholder);(minvalues);(maxvalues);(disabled);(defaultroles...)]

Creates a role select menu on a message

$addSection[(id);(containerId)]

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

$addSectionButton[customId;label;(style);(disabled);(emoji);(sectionId)]

Adds a button as the accessory of the open section (Components V2): the button sits on the side o...

$addSelectDefaultValue[menuID;id;(type)]

Preselects a user, a role or a channel in a select menu added earlier in the script.

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

$addSeparator[(divider);(spacing);(containerId)]

$addStringSelect[customId;(placeholder);(minValues);(maxValues);(disabled);(messageID)]

Adds a string select dropdown menu to a message.

$addStringSelectMenu[customID;(placeholder);(disabled);(minvalues);(maxvalues);(required)]

Creates a string select menu

$addStringSelectMenuTo[channelID;messageID;customID;(placeholder);(disabled);(minvalues);(maxvalues)]

Creates a string select menu on a message

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

$addTextDisplay[content;(containerId)]

$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...

$addUserSelect[customId;(placeholder);(minValues);(maxValues);(disabled);(messageID)]

$addUserSelectMenu[customID;(placeholder);(minvalues);(maxvalues);(disabled);(required)]

Creates a user select menu

$addUserSelectMenuTo[channelID;messageID;customID;(placeholder);(minvalues);(maxvalues);(disabled);(defaultusers...)]

Creates a user select menu on a message

$addVoiceSelect[customId;(placeholder);(minValues);(maxValues);(disabled);(messageID)]

$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...

$deleteActionRow[index]

Deletes an action row or top level component at given index

$deleteComponent[customID]

Deletes a message component with given custom id

$disableButtons[index]

Disables all buttons on the current message

$disableComponents

Disables all components on the current message

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

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

$editChannelSelectMenu[oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues);(defaultchannels...)]

Edits a channel select menu

$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...

$editMentionableSelectMenu[oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues);(defaultroles/users...)]

Edits a mentionable select menu

$editMessageCV2[(Channel ID;Message ID)]

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

$editOption[name;newname;(description);(value);(emoji);(default)]

Edits a select menu option

$editRoleSelectMenu[oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues);(defaultroles...)]

Edits a role select menu

$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.

$editStringSelectMenu[oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues)]

Edits a 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).

$editUserSelectMenu[oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues);(defaultusers...)]

Edits a user select menu

$enableButtons[index]

Enables all buttons on the current message

$enableComponents

Enables all components on the current message

$endSection

Closes the open section (Components V2): the next text display is a sibling of the section instea...

$ephemeral

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

$focusedOptionName

Returns the focused option of the command

$focusedOptionValue

Returns the focused option value of the command

$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.

$isActivityCommand

Returns whether the interaction is an activity command

$isAnySelectMenu

Returns whether the context is a select menu

$isAutocomplete

Returns whether the interaction is autocomplete

$isButton

Returns whether the interaction is a button

$isChannelSelectMenu

Returns whether the context is a channel select menu

$isCommand

Returns whether the interaction is a command

$isContextMenu

Returns whether the interaction is a context menu

$isMentionableSelectMenu

Returns whether the context is a mentionable select menu

$isMessageComponent

Returns whether the interaction is a message component

$isMessageContextMenu

Returns whether the interaction is a message context menu

$isRepliable

Returns whether this interaction can be replied to

$isRoleSelectMenu

Returns whether the context is a role select menu

$isSlashCommand

Returns whether the interaction is a slash command

$isStringSelectMenu

Returns whether the context is a string select menu

$isUserContextMenu

Returns whether the interaction is a user context menu

$isUserSelectMenu

Returns whether the context is a user select menu

$modal[customID;title]

Creates a modal

$newModal[customId;title]

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

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

$option[optionname]

Returns an option value with given name (interaction command)

$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.

$selectMenuValues[(index);(separator)]

Returns select menu values

$setChannelType[types...]

Sets channel types for the last select menu

HTTP & JSON

(45)
$createQueryParams[name;value]

Builds a query string from name and value pairs.

$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...

$inboundHeader[name]

Reads an HTTP header received by an inbound webhook

$inboundPayload[(path)]

Reads a field of the JSON body received by an inbound webhook

$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...

$jsonFromEntries[variable]

Converts an array of entries into an object

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

Builds a JSON object without any quote to escape.

$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...

$jsonLoad[variable;json]

Loads JSON to an env variable

$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...

$wsClose[source]

Closes a WebSocket source. Returns an empty string

$wsJoin[source;(context)]

Opens a WebSocket source declared on the bot's WebSocket page and plays its join sequence. Return...

$wsSend[source;message]

Sends a text message on an open WebSocket source. Returns an empty string

$wsStatus[source]

Returns closed, connecting, open or error for a WebSocket source

Image & Canvas

(166)
$GIFDecoder[gif;src;(options)]

Decodes a GIF from an image URL or data URL (at most 200 frames are kept). (alias of $newGIFDecoder)

$GIFDecoderOption[gif;option]

Returns an option of a GIF decoder: bgColor, bufferSize, globalPalette, lineLength, loops.

$GIFDecoderProperty[gif;option]

Returns an option of a GIF decoder: bgColor, bufferSize, globalPalette, lineLength, loops. (alias...

$GIFDecoderSize[gif;(property)]

Returns the size of a GIF decoder: width, height or JSON.

$GIFEncoderGlobalPalette[(gif)]

Returns a global palette (red, green, blue values, JSON) computed from the first frame.

$GIFEncoderSize[(gif);(property)]

Returns the size of a GIF encoder: width, height or JSON.

$NQcolorMapRgb[name]

Returns the RGB color map of the sample (JSON). (alias of $colorMapRgb)

$NQcolorMapRgba[name]

Returns the RGBA color map of the sample (JSON). (alias of $colorMapRgba)

$NQindexOf[name;r;g;b;a]

Finds the index of the closest color of the color map.

$NQlookup[name;idx]

Returns the color [r, g, b, a] at an index of the color map.

$NQmapPixel[name;r;g;b;a]

Returns the pixel mapped to the closest color of the color map, as [r, g, b, a] (nothing is chang...

$NeuQuant[name;sample;maxColors;pixels]

Creates a NeuQuant color quantizer from RGBA pixels (sample 1 to 30, 2 to 256 colors). (alias of ...

$addColorStop[(name);offset;color]

Adds a color stop (offset 0 to 100) to a gradient; with an empty name, to the next gradient created.

$addFrame[(gif);frame;(options);(speed)]

Adds a frame (a created frame, or a source) to the GIF encoder.

$alignImage[(canvas);(align)]

Sets or returns the horizontal alignment (left, center, right) of the rectangles and images drawn...

$alignRect[(canvas);(align)]

Sets or returns the horizontal alignment (left, center, right) of the rectangles and images drawn...

$arc[(canvas);x;y;radius;startAngle;endAngle;(counterclockwise)]

Adds a circular arc to the current path (angles in radians).

$arcTo[(canvas);x1;y1;x2;y2;radius]

Adds a circular arc between two tangents to the current path.

$attachCanvas[canvas;(filename);(format)]

Attaches the canvas to the reply as a PNG.

$attachGIF[(gif);(name)]

Attaches the GIF of an encoder to the response, as name.gif.

$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...

$barData[value;style]

Adds a data segment (value 0 to 100 and style) to the next progress bar or pie chart.

$barOptions[options]

Sets progress bar options as key:value: type (normal, pie), draw-type (fill, stroke), background-...

$beginPath[(canvas)]

Starts a new, empty path.

$bezierCurveTo[(canvas);cx1;cy1;cx2;cy2;x;y]

Adds a cubic Bézier curve to the current path.

$canvasBuffer[(canvas);variable;(format)]

Stores the canvas as base64 in a variable read with $env[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...

$canvasCrop[(canvas);(top);(left);(right);(bottom)]

Crops the transparent borders of a canvas (each side can be kept with false). (alias of $cropCanvas)

$canvasDataUrl[(canvas);(format)]

Returns the canvas as a data URL (png, jpeg or gif).

$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...

$canvasDrawGradient[x;y;width;height;colors;(angle);(blend);(container)]

Fills a rectangle of the current canvas with a gradient of two to four colors.

$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);(font)]

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.

$canvasSize[(canvas);(property)]

Returns the size of a canvas, or its width or height.

$canvasTileGrid[x;y;columns;rows;tileSize;colors;(gap);(separator)]

Fills a grid of square tiles in one call, for a mini-map.

$canvasTrim[(canvas);(top);(left);(right);(bottom)]

Crops the transparent borders of a canvas (each side can be kept with false). (alias of $cropCanvas)

$canvasVersion[(napi)]

Returns the name of the canvas engine.

$checkFrame[name;boolean]

Accepted for compatibility (kept in the options). (alias of $checkFrameConsistency)

$checkFrameConsistency[name;boolean]

Accepted for compatibility (kept in the options).

$checkLZWEndCode[name;boolean]

Accepted for compatibility (kept in the options).

$clearCanvasCache

Forgets the images named by $loadImage.

$clip[(canvas);(fillRule)]

Limits what is drawn next to the inside of the current path (up to 8 nested clips; save/restore k...

$closePath[(canvas)]

Closes the current subpath with a straight line to its start.

$colorMapRgb[name]

Returns the RGB color map of the sample (JSON).

$colorMapRgba[name]

Returns the RGBA color map of the sample (JSON).

$compositeOperation[(canvas);(operation)]

Sets or returns how what is drawn next blends: source-over, multiply, screen, overlay, darken, li...

$createCanvas[name;width;height;(code)]

Creates a canvas and makes it the current one; the optional code runs right away.

$createDecoder[gif;src;(options)]

Decodes a GIF from an image URL or data URL (at most 200 frames are kept). (alias of $newGIFDecoder)

$createFrame[frame;src;(options);(speed)]

Creates a named GIF frame from a canvas name, an image URL or a data URL. Options JSON: delay (hu...

$createGIFDecoder[gif;src;(options)]

Decodes a GIF from an image URL or data URL (at most 200 frames are kept). (alias of $newGIFDecoder)

$createGIFFrame[frame;src;(options);(speed)]

Creates a named GIF frame from a canvas name, an image URL or a data URL. Options JSON: delay (hu...

$createNeuQuant[name;sample;maxColors;pixels]

Creates a NeuQuant color quantizer from RGBA pixels (sample 1 to 30, 2 to 256 colors). (alias of ...

$cropCanvas[(canvas);(top);(left);(right);(bottom)]

Crops the transparent borders of a canvas (each side can be kept with false).

$decimalToHex[decimal]

Converts a decimal color (0 to 16777215) into a six-digit uppercase hexadecimal code, without #.

$decodeOptions[name;(options)]

Creates a named set of GIF decode options.

$decoderOption[gif;option]

Returns an option of a GIF decoder: bgColor, bufferSize, globalPalette, lineLength, loops. (alias...

$decoderOptions[name;(options)]

Creates a named set of GIF decode options. (alias of $decodeOptions)

$decoderProperty[gif;option]

Returns an option of a GIF decoder: bgColor, bufferSize, globalPalette, lineLength, loops. (alias...

$decoderSize[gif;(property)]

Returns the size of a GIF decoder: width, height or JSON. (alias of $GIFDecoderSize)

$deleteCanvas[name]

Deletes a canvas.

$deleteDecoder[name]

Deletes a GIF decoder.

$deleteEncoder[name]

Deletes a GIF encoder.

$deleteFrame[name]

Deletes a created frame.

$deleteImage[name]

Forgets an image loaded with $loadImage (or, with preload://name, one of $preloadImage).

$drawImage[(canvas);src;x;y;(width);(height);(radius)]

Draws an image (a name from $loadImage or a source) on a canvas, with an optional corner radius.

$drawImageArea[(canvas);src;srcX;srcY;(srcWidth);(srcHeight);x;y;(width);(height);(radius)]

Draws one area of an image (crop) on the canvas; not available after a transform.

$drawImageRect[(canvas);src;srcX;srcY;(srcWidth);(srcHeight);x;y;(width);(height);(radius)]

Draws one area of an image (crop) on the canvas; not available after a transform. (alias of $draw...

$drawProgressBar[(canvas);x;y;width;height;(config)]

Draws a progress bar (or a pie chart with type:pie) from $barData and $barOptions.

$drawRect[(canvas);type;(style);x;y;width;height;(radius)]

Draws a rectangle (type fill or stroke) with an optional corner radius.

$ellipse[(canvas);x;y;radiusX;radiusY;rotation;startAngle;endAngle;(counterclockwise)]

Adds an elliptical arc to the current path (angles in radians).

$encoderGlobalPalette[(gif)]

Returns a global palette (red, green, blue values, JSON) computed from the first frame. (alias of...

$encoderSize[(gif);(property)]

Returns the size of a GIF encoder: width, height or JSON. (alias of $GIFEncoderSize)

$fill[(canvas);style;(fillRule)]

Fills the current path (each subpath on its own; holes are not handled).

$filter[(canvas);method;(filter);(value)]

Filters applied to what is drawn next: methods add, set, remove, clear, get, json, setRaw. Filter...

$fontFamilies[(separator)]

Lists the fonts the canvas can draw (Geist, Geist-Medium, Geist-Bold).

$fontVariantCaps[(canvas);(type)]

Sets or returns the capitals of the text drawn next: normal, or small-caps, all-small-caps, petit...

$frameConsistency[name;boolean]

Accepted for compatibility (kept in the options). (alias of $checkFrameConsistency)

$frameOpt[frame;option]

Returns an option of a created frame: delay, dispose, transparent, needsUserInput, top, left, wid...

$frameOption[frame;option]

Returns an option of a created frame: delay, dispose, transparent, needsUserInput, top, left, wid...

$frameProp[frame;option]

Returns an option of a created frame: delay, dispose, transparent, needsUserInput, top, left, wid...

$frameProperty[frame;option]

Returns an option of a created frame: delay, dispose, transparent, needsUserInput, top, left, wid...

$getImageData[(canvas);x;y;width;height;(type)]

Returns the pixels of an area (at most 40000) as a JSON array: Rgba (default, four numbers per pi...

$getPixels[(canvas);x;y;width;height;(type)]

Returns the pixels of an area (at most 40000) as a JSON array: Rgba (default, four numbers per pi...

$getTransform[(canvas)]

Returns the transform of a canvas as [a, b, c, d, e, f].

$gifFrameOption[frame;option]

Returns an option of a created frame: delay, dispose, transparent, needsUserInput, top, left, wid...

$globalPalette[(gif)]

Returns a global palette (red, green, blue values, JSON) computed from the first frame. (alias of...

$hexBlue[hex]

Returns the blue component (0 to 255) of a six-digit hexadecimal color.

$hexGreen[hex]

Returns the green component (0 to 255) of a six-digit hexadecimal color.

$hexRed[hex]

Returns the red component (0 to 255) of a six-digit hexadecimal color.

$hexToDecimal[hex]

Converts a six-digit hexadecimal color, with or without #, into a decimal integer.

$imageAlign[(canvas);(align)]

Sets or returns the horizontal alignment (left, center, right) of the rectangles and images drawn...

$imageBaseline[(canvas);(baseline)]

Sets or returns the vertical alignment (top, center, bottom) of the rectangles and images drawn n...

$imageBuffer[variable;path]

Stores an image as base64 in a variable read with $env[name].

$imageDimensions[path;(property)]

Returns the size of an image (URL, data URL, images://name or preload://name): width, height or J...

$imageSize[path;(property)]

Returns the size of an image (URL, data URL, images://name or preload://name): width, height or J...

$imageSmooth[(canvas);(enabled)]

Sets or returns whether scaled images are smoothed (true) or drawn pixel by pixel (false). (alias...

$imageSmoothing[(canvas);(enabled)]

Sets or returns whether scaled images are smoothed (true) or drawn pixel by pixel (false).

$imgSize[path;(property)]

Returns the size of an image (URL, data URL, images://name or preload://name): width, height or J...

$indexedToHex[palette;(transparent);(alwaysAlpha);(allowShort);pixels]

Converts palette indexes to hex colors (JSON array).

$indexedToRgba[palette;(transparent);pixels]

Converts palette indexes to red, green, blue, alpha values (JSON array).

$letterSpacing[(canvas);(spacing)]

Sets or returns the spacing in pixels between letters of the text drawn next.

$lineDash[(canvas);(segments)]

Sets or returns the dash segments of a canvas, as a JSON list like [5, 3].

$lineDashOffset[(canvas);(offset)]

Sets or returns the dash offset of a canvas.

$lineJoin[(canvas);(shape)]

Sets or returns the line join of a canvas (round, bevel, miter).

$lineTo[(canvas);x;y]

Adds a straight line to the current path.

$lineWidth[(canvas);(width)]

Sets or returns the line width of a canvas.

$loadImage[name;src]

Gives a name to an image source (URL or data URL) for $drawImage; 32 names at most.

$loadImageOptions[(global);(alt);(maxRedirects);(requestOptions)]

Sets or returns the image load options (alt, maxRedirects); kept for compatibility, the loader ig...

$mapPixel[name;r;g;b;a]

Returns the pixel mapped to the closest color of the color map, as [r, g, b, a] (nothing is chang...

$moveTo[(canvas);x;y]

Starts a new subpath at a point.

$newConicGradient[name;start;x;y;(stops)]

Creates a conic gradient around a point, to use by name as the style of $fill or $drawRect.

$newDecoder[gif;src;(options)]

Decodes a GIF from an image URL or data URL (at most 200 frames are kept). (alias of $newGIFDecoder)

$newFrame[frame;src;(options);(speed)]

Creates a named GIF frame from a canvas name, an image URL or a data URL. Options JSON: delay (hu...

$newGIFDecoder[gif;src;(options)]

Decodes a GIF from an image URL or data URL (at most 200 frames are kept).

$newGIFEncoder[gif;width;height]

Creates a GIF encoder (at most 4, 512x512, 60 frames). Palette and functions are accepted by Forg...

$newGIFFrame[frame;src;(options);(speed)]

Creates a named GIF frame from a canvas name, an image URL or a data URL. Options JSON: delay (hu...

$newLinearGradient[name;x1;y1;x2;y2;(stops)]

Creates a linear gradient, to use by name as the style of $fill or $drawRect (shapes only).

$newNeuQuant[name;sample;maxColors;pixels]

Creates a NeuQuant color quantizer from RGBA pixels (sample 1 to 30, 2 to 256 colors).

$newRadialGradient[name;x1;y1;r1;x2;y2;r2;(stops)]

Creates a radial gradient between two circles, to use by name as the style of $fill or $drawRect.

$nextFrameInfo[gif;name]

Reads the next frame without its pixels: returns its info as JSON and keeps it in $env[name].

$opacity[(canvas);(opacity)]

Sets or returns the opacity (0 to 1) applied to what is drawn next (not to images).

$placeImageArea[(canvas);src;srcX;srcY;(srcWidth);(srcHeight);x;y;(width);(height);(radius)]

Draws one area of an image (crop) on the canvas; not available after a transform. (alias of $draw...

$preloadImage[name;src]

Names an image source for the whole execution; draw it with preload://name (at most 32).

$putImageData[(canvas);pixels;x;y;width;height;(type)]

Places pixels (JSON array, Rgba or Hex) in an area of the canvas without blending. (alias of $put...

$putPixels[(canvas);pixels;x;y;width;height;(type)]

Places pixels (JSON array, Rgba or Hex) in an area of the canvas without blending.

$quadraticCurveTo[(canvas);cx;cy;x;y]

Adds a quadratic Bézier curve to the current path.

$readNextFrame[gif;name]

Reads the next frame with its pixels into $env[name] (an object with delay, dispose, width, heigh...

$rectAlign[(canvas);(align)]

Sets or returns the horizontal alignment (left, center, right) of the rectangles and images drawn...

$rectBaseline[(canvas);(baseline)]

Sets or returns the vertical alignment (top, center, bottom) of the rectangles and images drawn n...

$removeDecoder[name]

Deletes a GIF decoder. (alias of $deleteDecoder)

$removeEncoder[name]

Deletes a GIF encoder. (alias of $deleteEncoder)

$removeFrame[name]

Deletes a created frame. (alias of $deleteFrame)

$removeImage[name]

Forgets an image loaded with $loadImage (or, with preload://name, one of $preloadImage). (alias o...

$resetTransform[(canvas)]

Resets the transform of a canvas.

$resizeCanvas[(canvas);width;height]

Resizes a canvas; as in ForgeCanvas, the canvas is emptied (transparent).

$restore[(canvas)]

Restores the last saved transform and line settings.

$rotate[(canvas);angle]

Adds a rotation (radians) to the transform of a canvas.

$save[(canvas)]

Saves the transform and line settings of a canvas (64 states at most).

$scale[(canvas);x;y]

Adds a scaling to the transform of a canvas.

$setColorOutput[name;output]

Sets the colors of the frames read: Rgba, IndexedPixels (read as Rgba) or Hex.

$setEncoderLoops[(gif);loops]

Sets how many times the GIF loops (0: forever).

$setMemoryLimit[name;limit]

Sets the memory limit of a set of decode options (kept, the decoder has its own limits).

$setOutputColor[name;output]

Sets the colors of the frames read: Rgba, IndexedPixels (read as Rgba) or Hex. (alias of $setColo...

$setPixels[(canvas);pixels;x;y;width;height;(type)]

Places pixels (JSON array, Rgba or Hex) in an area of the canvas without blending. (alias of $put...

$setRAMLimit[name;limit]

Sets the memory limit of a set of decode options (kept, the decoder has its own limits). (alias o...

$setTransform[(canvas);a;b;c;d;e;f]

Sets the transform of a canvas.

$shadowConfig[(canvas);options]

Sets or returns the shadow of what is drawn next (color, blur 0 to 100, offsetX, offsetY); pass a...

$shadowOptions[(canvas);options]

Sets or returns the shadow of what is drawn next (color, blur 0 to 100, offsetX, offsetY); pass a...

$skipFrameDecode[name;boolean]

Reads frames without their pixels. (alias of $skipFrameDecoding)

$skipFrameDecoding[name;boolean]

Reads frames without their pixels.

$stroke[(canvas);style]

Strokes the current path with the line width, dash and transform of the canvas.

$textAlign[(canvas);(align)]

Sets or returns the text alignment of a canvas (left, right, center, start, end).

$textBaseline[(canvas);(baseline)]

Sets or returns the text baseline of a canvas (top, hanging, middle, alphabetic, ideographic, bot...

$transform[(canvas);a;b;c;d;e;f]

Multiplies the transform of a canvas by a matrix.

$trimCanvas[(canvas);(top);(left);(right);(bottom)]

Crops the transparent borders of a canvas (each side can be kept with false). (alias of $cropCanvas)

$wordSpacing[(canvas);(spacing)]

Sets or returns the spacing in pixels between words of the text drawn next.

Moderation

(250)
$addAppEmoji[name;url;(returnEmojiID)]

Another name of $addApplicationEmoji: same arguments, same result.

$addApplicationEmoji[name;url;(returnemojiID)]

Adds an application emoji, returns the emoji id

$addButtonTo[channelID;messageID;customID;label;style;(emoji);(disabled)]

Adds a button component to the newest row in a message

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

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

$addEmoji[name;url;returnEmoji;(reason)]

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

$addForumTag[forumID;name;(emoji);(moderated);(reason);(returnID)]

Adds a tag to a forum or media channel (20 tags at most).

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

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

$addPostTags[channelID;(reason);tags]

Adds tags to a forum post, returns bool.

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

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

$addSuperReaction[channelID;messageID;emoji]

Adds a super reaction from the bot to a specific message.

$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.

$banCount[(guildID)]

Returns the number of users banned from a server. Bot Creator function, not in BibiScript.

$banID[(reason);(userID);(deleteDays)]

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.

$bulkBan[userIDs;(deleteSeconds);(reason);(guildID)]

Bans up to 200 users at once, even if they are not in the server.

$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.

$channelMessageCount[channelID;(minutes);(humansOnly)]

Counts the messages sent in a channel recently, without reading their text.

$channelSendMessage[channelID;content;(replyMessageID);(returnID)]

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);(reason)]

Deletes a specified number of messages in the channel.

$clearChannelPerms[channelID;(id)]

Deletes all permission overwrites from the channel or given id, returns bool

$clearMessages[channelID;amount;(deletePinned);(deleteBots)]

Deletes recent messages of a channel (1000 at most, in batches of 100) and returns how many were ...

$clearReactions[channelID;messageID;emoji]

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

$clearUserMessages[channelID;userID;amount;(deletePinned)]

Deletes recent messages of one user in a channel (1000 at most) and returns how many were removed.

$cloneChannelPerms[channelID;channelID]

Clones the given channel's perms to another channel, returns bool

$cloneRole[guildID;roleID;(name)]

Clones an existing role of a guild, returns role id if success.

$closeTicket[(errorMessage);(reason)]

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

$createChannel[name;type;(categoryID);(reason);(returnID)]

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

$createForumPost[forumID;title;message;(tags);(autoArchiveDuration);(returnID);(reason)]

Creates a post (a thread with a first message and tags) in a forum or media channel.

$createGuildTemplate[guildID;name;(description)]

Creates template for a guild, returns template code

$createInvite[channelID;maxAgeSeconds;maxUses;temporary;(reason)]

Creates an invite to a channel and returns its code.

$createRole[name;color;(hoist);(mentionable);(reason);(returnID);(icon);(permissions);(secondaryColor);(tertiaryColor)]

Creates a new role on the Discord server.

$createStageInstance[channelID;topic;(privacylevel);(notify);(eventID)]

Creates a new stage instance, returns instance id.

$customEmoji[name]

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

$deleteActionRowFrom[channelID;messageID;index]

Deletes an action row or top level component at given index

$deleteAllMessageReactions[channelID;messageID]

Deletes all reactions from a message, returns bool

$deleteAppEmoji[emojis;...]

Another name of $deleteApplicationEmojis: same arguments, same result.

$deleteApplicationEmojis[emojis...]

Deletes application emojis, returns the count of emojis deleted

$deleteChannelPerms[channelID;id;perms...]

Deletes some permission overwrites from a channel, returns bool

$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...

$deleteComponentFrom[channelID;messageID;customID]

Deletes a message component with given custom id from a message

$deleteEmojiMessageReactions[channelID;messageID;emojis...]

Deletes all emoji reactions from a message, returns amount of reaction emojis successfully deleted

$deleteEmojis[guildID;emojis]

Deletes given emojis from a guild, returns the count of emotes deleted.

$deleteForumTag[channelID;tags;...]

Another name of $deleteForumTags: same arguments, same result.

$deleteForumTags[channelID;tags...]

Deletes tags from a forum, returns bool

$deleteGuildTemplate[templatecode]

Deletes template from a guild, returns bool

$deleteIntegration[integrationID;(guildID);(reason)]

Removes an integration from the server.

$deleteInvite[inviteCode;(reason)]

Revokes an invite.

$deleteMessages[channelID;amount;(deletePinned);(deleteBots)]

Another name of $clearMessages: same arguments, same result.

$deleteRole[roleID;(reason)]

Deletes a role from the Discord server.

$deleteStageInstance[stageID]

Deletes a stage instance, returns bool.

$deleteStickers[guildID;stickers]

Deletes given stickers, returns the count of stickers deleted.

$deleteUserMessageReaction[channelID;messageID;emoji;userID]

Deletes user emoji reaction from a message, returns bool

$disableButtonsOf[channelID;messageID;(index)]

Disables all buttons of a message, returns bool

$disableComponentsOf[channelID;messageID]

Disables all components of a message, returns bool

$disconnectMember[userID;(reason)]

Disconnects a member from their voice channel.

$editApplicationEmoji[emojiID;name]

Edits an application emoji, returns bool

$editAutomodRule[guildID;ruleID;(name);(event);(enabled);(reason)]

Edits an automod rule on a guild, returns bool

$editButtonOf[channelID;messageID;customID;newcustomID;(label);(style);(emoji);(disabled)]

Edits a button component of a message

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

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

$editChannelSelectMenuOf[channelID;messageID;oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues);(defaultchannels...)]

Edits a channel select menu of a message, returns bool

$editForumTag[channelID;tagID;(name);(emoji);(moderated)]

Edits an existing forum tag, returns bool

$editGuildTemplate[templatecode;(name);(description)]

Edits template on a guild, returns bool

$editMentionableSelectMenuOf[channelID;messageID;oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues);(defaultroles/users...)]

Edits a mentionable select menu of a message, returns bool

$editRoleName[guildID;roleID;name]

Edits a role's name, returns boolean.

$editRolePosition[guildID;roleID;position]

Edits a role's position, returns boolean.

$editRoleSelectMenuOf[channelID;messageID;oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues);(defaultroles...)]

Edits a role select menu of a message, returns bool

$editRoleUnicodeEmoji[guildID;roleID;(emoji)]

Edits a role's unicode emoji, returns boolean.

$editStageInstance[stageID;(topic);(privacylevel)]

Edits a stage instance, returns bool.

$editStringSelectMenuOf[channelID;messageID;oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues)]

Edits a string select menu of a message

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

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

$editUserSelectMenuOf[channelID;messageID;oldcustomID;newcustomID;(placeholder);(disabled);(minvalues);(maxvalues);(defaultusers...)]

Edits a user select menu of a message, returns bool

$emoji[emojiID]

Formats given emoji.

$emojiAuthorID[emojiID]

Returns the author id of an emoji.

$emojiCount[(guildID)] / $emoteCount

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

$emojiCreatedAt[emojiID]

Returns the emoji creation timestamp.

$emojiExists[emojiID]

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

$emojiGuildID[emojiID]

Returns the emoji guild id.

$emojiID[emojiname]

Returns the emoji id.

$emojiIdentifier[emojiID]

Returns the emoji identifier.

$emojiName[emojiID]

Gets the name of a custom emoji from its ID.

$emojiRequiresColons[emojiID]

Returns whether the emoji requires colons.

$emojiRoles[emojiID;(separator)]

Returns the role ids that can use this emote.

$emojiURL[emojiID]

Returns the emoji url.

$enableButtonsOf[channelID;messageID;(index)]

Enables all buttons of a message, returns bool

$enableComponentsOf[channelID;messageID]

Enables all components of a message, returns bool

$endStage[stageID]

Another name of $deleteStageInstance: same arguments, same result.

$fetchApplicationEmojis

Caches all application emojis of the client.

$followChannel[channelID;channelID;(reason)]

Follows given announcement channel, returns webhook id

$formatEmoji[emojiID]

Returns a custom emoji ready to send in a message, from its ID.

$forumTags[forumID;(separator)]

Lists the tags of a forum or media channel as `id:name`.

$forwardMessage[channelID;messageID;(channelID)]

Forwards a message to another channel, returns bool

$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[codeOrLink;property]

Gets a property of a Discord invite from its code or link (channel, server, inviter, member count...

$getMessage[channelID;messageID;(property)]

Gets the content, author, link, type, flags, counts… of a message specified by its channel and me...

$getMessages[channelID;(limit);(separator);(property);(beforeID);(afterID)]

Lists the latest messages of a channel and returns one value per message (its ID by default).

$getReactions[channelID;messageID;separator;emoji;(type)]

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

$getRoleIcon[roleID;(size);(format)]

Gets the icon of a role, as an image URL or a Unicode emoji. Empty when the role has no icon. Bot...

$getRoleSecondaryColor[roleID]

Gets the secondary color of a Discord role (six uppercase hexadecimal digits), or an empty string...

$getRoleTertiaryColor[roleID]

Gets the tertiary color of a Discord role (six uppercase hexadecimal digits), or an empty string ...

$getServerInvite[(guildID)]

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

$getSuperReactions[channelID;messageID;separator;emoji]

Returns the users who super-reacted to a message with a given emoji, joined by the chosen separator.

$giveRole[(userID);roleID;(reason);(serverID)]

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 BibiScript scripts; in this engine it does nothing and returns an...

$inviteInfo[codeOrLink;(property)]

Reads an invitation from Discord by code or link.

$inviteToSpeak[channelID;(userID);(invite)]

Lets a member speak on a stage channel (or `no` to make them a listener again). Without a user, a...

$isTicket[(channelID)]

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

$joinThread[threadID]

Makes the bot join a thread.

$kick[userID;(reason)]

Kicks a specific user from the Discord server.

$kickMention[reason]

Kicks the first user mentioned in a prefix command.

$leaveThread[threadID]

Makes the bot leave a thread.

$modifyBotMember[(nick);(avatar);(banner);(bio);(reason);(guildID)]

Changes the profile of the bot in this server: nickname, avatar, banner and bio.

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

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, /...

$modifyForum[channelID;(name);(topic);(layout);(sortOrder);(slowmode);(archiveMinutes);(requireTag);(reason)]

Changes several settings of a forum channel in one call.

$modifyPostTags[channelID;(reason);tags]

Modifies tags of a forum post, returns bool.

$modifyRole[roleID;(name);(color);(hoist);(mentionable);(position);(reason);(icon);(secondaryColor);(tertiaryColor)]

Modifies the properties of an existing role.

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

Toggles the listed permissions of an existing role.

$modifyVoiceChannel[channelID;(name);(userLimit);(bitrate);(region);(videoQuality);(reason)]

Changes several settings of a voice channel in one call.

$moveMember[userID;channelID;(reason)]

Moves a member who is in a voice channel to another voice channel.

$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);(reason)]

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.

$pauseDMs[guildID;(duration)]

Another name of $setGuildDmsDisabled: same arguments, same result.

$pauseInvites[guildID;disabled]

Another name of $setGuildPausedInvites: same arguments, same result.

$pinMessage[Channel ID;Message ID;(reason)]

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

$prune[(days);(guildID);(includeRoles);(reason);(returnCount)]

Removes the members who were inactive for the given days. The bot needs Kick Members.

$pruneCount[(days);(guildID);(includeRoles)]

Counts the members who would be removed by `$prune` (inactive for the given days).

$publishMessage[channelID;messageID]

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

$randomEmojiID

Returns a random emoji ID.

$randomGuildEmojiID[guildID]

Returns a random emoji ID of a guild.

$reactionCount[channelID;messageID;emoji;(type)]

Returns how many reactions a message has for an emoji, normal, super or both, without listing the...

$registerGuildCommands[name]

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

$removeAttachments[channelID;messageID]

Removes all attachments from a message, returns bool

$removeEmoji[emojiID;(reason)]

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

$removeSuperReaction[channelID;messageID;emoji]

Removes the bot's own super reaction from a message.

$removeUserReaction[channelID;messageID;emoji;userID]

Another name of $deleteUserMessageReaction: same arguments, same result.

$roleGradient[roleID;color;(secondaryColor);(tertiaryColor);(reason)]

Another name of $setRoleColors: same arguments, same result.

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

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

$roleIcon[roleID;(icon);(reason)]

Another name of $setRoleIcon: same arguments, same result.

$searchMessages[guildID;query;(limit);(separator);(property);(channelID);(authorID)]

Searches the messages of the server for a text and returns one value per message found.

$serverDeafen[userID;deaf;(reason)]

Server-deafens or undeafens a member in voice.

$serverMute[userID;mute;(reason)]

Server-mutes or unmutes a member in voice.

$setAuditLogReason[reason]

Sets the reason for audit log entries.

$setBotGuildAvatar[guildID;(url)]

Sets the bot avatar on a guild

$setBotGuildBanner[guildID;(url)]

Sets the bot banner on a guild

$setBotGuildDescription[guildID;(description)]

Sets the bot description on a guild

$setBotName[name]

Sets the bot name.

$setChannelArchiveDuration[channelID;duration;(reason)]

Modifies a channel's archive duration.

$setDefaultForumLayout[channelID;layout;(reason)]

Sets a forum's default layout of posts.

$setDefaultReactionEmoji[channelID;(emoji);(reason)]

Sets a forum's default reaction emoji for posts.

$setDefaultSortOrder[channelID;(layout);(reason)]

Sets a forum's default sort order of posts.

$setDefaultThreadArchiveDuration[channelID;duration;(reason)]

Sets a forum's default auto archive duration of posts.

$setDefaultThreadSlowmode[channelID;seconds;(reason)]

Sets a forum's default slowmode for posts.

$setGuildAFKChannel[guildID;(channelID);(reason)]

Sets the AFK channel for a guild, returns bool.

$setGuildAFKTimeout[guildID;seconds;(reason)]

Sets the AFK timeout for a guild, returns bool.

$setGuildBanner[guildID;(url);(reason)]

Sets a guild banner, returns boolean.

$setGuildBoostProgressBar[guildID;enabled;(reason)]

Sets a guild boost progress bar, returns bool.

$setGuildDefaultMessageNotifications[guildID;(setting);(reason)]

Sets the default message notifications setting for a guild, returns bool.

$setGuildDiscoverySplash[guildID;(url);(reason)]

Sets the discovery splash for a guild, returns bool.

$setGuildDmsDisabled[guildID;(duration)]

Sets the guild's DMs activity disabled for a specific duration, returns bool

$setGuildExplicitContentFilter[guildID;(filter);(reason)]

Sets the explicit content filter for a guild, returns bool.

$setGuildIcon[guildID;(url);(reason)]

Sets a guild icon, returns boolean.

$setGuildInvitesDisabled[guildID;(duration)]

Sets the guild's invites disabled for a specific duration, returns bool

$setGuildMFALevel[guildID;level;(reason)]

Sets the MFA level for a guild, returns bool

$setGuildName[guildID;name;(reason)]

Sets a guild name, returns boolean.

$setGuildPausedInvites[guildID;disabled]

Sets a guild paused invite status, returns bool

$setGuildPreferredLocale[guildID;(locale);(reason)]

Sets the preferred locale of a guild, returns bool.

$setGuildPublicUpdatesChannel[guildID;(channelID);(reason)]

Sets the public updates channel for a guild, returns bool.

$setGuildRulesChannel[guildID;(channelID);(reason)]

Sets the rules channel for a guild, returns bool.

$setGuildSafetyAlertsChannel[guildID;(channelID);(reason)]

Sets the safety alerts channel for a guild, returns bool.

$setGuildSplash[guildID;(url);(reason)]

Sets a guild splash, returns boolean.

$setGuildSystemChannel[guildID;(channelID);(reason)]

Sets the system channel for a guild, returns bool.

$setGuildVerificationLevel[guildID;(level);(reason)]

Sets the verification level of a guild, returns bool.

$setGuildWidgetSettings[guildID;(channelID);(enabled);(reason)]

Sets the widget settings of a guild, returns bool

$setMemberFlags[userID;flags;(guildID);(reason)]

Sets the flags of a member. Discord only lets bots change `BypassesVerification`.

$setNickname[nickname;(userID);(reason)]

Modifies the nickname of a user on the server.

$setPostTags[channelID;(reason);(tags)]

Sets tags to a forum post, returns bool.

$setRoleColors[roleID;color;(secondaryColor);(tertiaryColor);(reason)]

Sets the colors of a role, including the gradient and holographic styles of servers with 3 boosts...

$setRoleIcon[roleID;(icon);(reason)]

Sets or removes the icon of a role (servers with boost level 2). Bot Creator function, not in Bib...

$setRolePosition[guildID;roleID;position]

Another name of $editRolePosition: same arguments, same result.

$setStickerDescription[stickerID;description]

Sets a sticker's description, returns bool.

$setStickerName[stickerID;name]

Sets a sticker's name, returns bool.

$setStickerTags[stickerID;tags]

Sets a sticker's tags, returns bool.

$setThreadArchiveDuration[channelID;duration;(reason)]

Sets a thread's auto archive duration.

$setThreadTags[threadID;tags;(reason)]

Replaces the tags of a forum post.

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

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

$setVoiceBitrate[channelID;bitrate;(reason)]

Sets the bitrate quality of a voice channel, returns bool.

$setVoiceDeaf[guildID;userID;(reason)]

Deafens a member from voice channel.

$setVoiceMute[guildID;userID;(reason)]

Mutes a member from voice channel.

$setVoiceRegion[channelID;(region);(reason)]

Sets the region of a voice channel, returns bool.

$setVoiceStatus[channelID;(status)]

Sets the status text shown under a voice channel name. An empty status clears it.

$setVoiceUndeaf[guildID;userID;(reason)]

Undeafens a member from voice channel.

$setVoiceUnmute[guildID;userID;(reason)]

Unmutes a member from voice channel.

$setVoiceVideoQuality[channelID;quality;(reason)]

Sets the video quality of a voice channel, returns bool.

$stageTopic[channelID;(topic)]

Reads the topic of a stage, or changes it when a new topic is given.

$startForumPost[forumID;title;message;(tags);(autoArchiveDuration);(returnID);(reason)]

Another name of $createForumPost: same arguments, same result.

$startStage[channelID;topic;(privacyLevel);(notify);(eventID)]

Another name of $createStageInstance: same arguments, same result.

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

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

$startTyping[channelID]

Starts typing in a channel.

$suppressEmbeds[channelID;messageID]

Suppresses embeds on a message, returns bool

$syncGuildTemplate[templatecode]

Syncs this template to the current state of the guild, returns bool

$takeRole[userID;roleID;(reason);(serverID)] 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);(reason)]

Temporarily times out a user (temporary silence).

$unBan[(reason)]

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

$unBanID[(userID);(reason)]

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

$unTimeout[(userID);(reason)]

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;(reason)]

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

$unsuppressEmbeds[channelID;messageID]

Unsuppresses embeds on a message, returns bool

$userSuperReacted[channelID;messageID;userID;emoji]

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

$voiceChannelID[guildID;userID]

Another name of $voiceID: same arguments, same result.

$voiceID[guildID;userID]

Returns the voice channel id a member is connected to.

$voiceKick[guildID;userID;(reason)]

Kicks a member from a voice channel, returns bool.

$voiceMove[guildID;userID;(channelID);(reason)]

Moves a member from a voice channel, returns bool.

$voiceUserLimit[(channelID)]

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

$webhookEditMessage[url;messageID;(content);(threadID)]

Edits a webhook message, returns bool

Math & Text

(127)
$abs[number]

Absolute value of a number.

$advancedReplace[text;match;replacement]

Replaces several texts in one call.

$advancedTextSplit[text;split...]

Split and get all at the same time multiple times

$average[number;...]

Average of the given numbers, as a real decimal whatever `$enableDecimals` says.

$base[number;to;(from)]

Converts a number between bases 2 and 36.

$bigintDivide[numbers]

Divides integers of any size (integer division).

$bigintMulti[numbers]

Multiplies integers of any size.

$bigintSub[numbers]

Subtracts integers of any size.

$bigintSum[numbers]

Adds integers of any size.

$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...

$capitalize[text]

First letter in upper case, the rest in lower case.

$ceil[value]

Rounds a number up to the next integer.

$charCodeAt[text;index]

Returns the UTF-16 code of the character at an index (NaN when out of range).

$charCount[text]

Counts the number of characters in the given text.

$clamp[number;min;max]

Keeps a number between a minimum and a maximum.

$cos[radians]

Cosine of an angle in radians, as a real decimal.

$cropText[text;maxLength;suffix]

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

$decodeURI[text]

Decodes a full URL.

$decodeURIComponent[text]

Decodes a URL part.

$deflate[input;(encoding)]

Compresses given input

$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)...

$emojisFromMessage[text;(separator)]

Returns every emoji found in a text, in order: Unicode emojis and custom emojis.

$encodeURI[text]

Encodes a full URL (keeps `:/?#&=`).

$encodeURIComponent[text]

Encodes a URL part (also encodes `:/?#&=`).

$escapeMarkdown[text]

Adds a backslash before `* _ ~ ` | > \` so a user text is shown as typed and not formatted.

$findNumbers[text;(separator)]

Returns every number found in a text, in order, negative and decimal numbers included.

$floor[value]

Rounds a number down to the nearest integer.

$floorDiv[a;b]

Integer division rounded down (towards negative infinity).

$fromCharCode[codes]

Builds text from UTF-16 character codes.

$gcd[a;b;...]

Greatest common divisor of two or more whole numbers.

$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.

$hash[text;(algorithm);(modulo)]

Deterministic digest of a text: the same text always gives the same result.

$hexToInt[hex]

Converts a hexadecimal value to a number.

$hexToRgb[hex]

Converts HEX colors to a list of RGB values.

$hexToRgba[hex]

Converts HEX colors to a list of RGBA values.

$inflate[input;(encoding)]

Decompresses given input

$intToHex[number]

Converts a number to hexadecimal.

$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.

$isFloat[number]

Tells whether a number has a decimal part.

$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

$isEven[integer]

`true` when a whole number is even.

$isOdd[integer]

`true` when a whole number is odd.

$joinSplitText[separator]

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

$lcm[a;b;...]

Least common multiple of two or more whole numbers.

$linesCount[text]

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

$localeCompare[first;second]

Compares two texts: -1, 0 or 1.

$log[message;level]

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

$logarithm[number;(base)]

Logarithm of a positive number, natural by default. (`$log` is already used for logs.)

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

Returns the largest value among the provided arguments.

$maxSafeInteger

Largest integer a double represents exactly.

$md5[text;(encoding)]

MD5 digest of a text.

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

Returns the smallest value among the provided arguments.

$minSafeInteger

Smallest integer a double represents exactly.

$mod[a;b]

Remainder that is never negative for a positive divisor.

$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.

$pad[text;length;(character);(side)]

Completes a text up to a length, for example `7` → `007`.

$parseFloat[value;(fallback)]

Reads the decimal number at the start of a text, ignoring what follows.

$parseInt[value;(fallback)]

Reads the whole number at the start of a text, ignoring what follows.

$percent[part;total;(decimals)]

Percentage that `part` makes of `total`.

$pi

The number pi (3.141592653589793). No brackets.

$pow[base;exponent]

Raises a number to a power.

$random[(min;max)]

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

$randomBytes[length]

Random bytes as hexadecimal (0 to 1024 bytes).

$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...

$replaceRegex[text;regex;flags;replacement;(amount)]

Replaces text matching a regular expression.

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

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

$reverseText[text]

Writes the text backwards.

$rgbToHex[(allowShort);rgb]

Converts groups of three RGB values to a list of HEX colors.

$rgbaToHex[(alwaysIncludeAlpha);(allowShort);rgba]

Converts groups of four RGBA values to a list of HEX colors.

$round[value;(decimals)]

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

$seededRandom[seed;min;max]

Random integer that is the same for the same seed (procedural generation).

$segmentTextSplit[text]

Creates an array on given text using segmenter

$separateBigint[number;(separator)]

Groups the thousands of an integer of any size.

$sha256[text;(encoding)]

SHA-256 digest of a text.

$sha512[text;(encoding)]

SHA-512 digest of a text.

$sign[number]

Sign of a number: `1`, `-1` or `0`.

$sin[radians]

Sine of an angle in radians, as a real decimal.

$slug[text]

Turns a text into a link or name safe form: lower case, no accent, words joined by `-`.

$snowflake

Generates a unique Discord snowflake.

$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...

$splitTextJoin[separator]

Joins all elements from array with given separator

$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.

$tan[radians]

Tangent of an angle in radians, as a real decimal.

$textSplit[text;separator]

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

$toCamelCase[text]

Converts text to camelCase.

$toKebabCase[text]

Converts text to kebab-case.

$toLowercase[text]

Converts all characters in the given text to lowercase.

$toSnakeCase[text]

Converts text to snake_case.

$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.

$toNumber[value;(fallback)]

Converts a text such as `416`, ` 416 ` or `"416"` into a number.

$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.

$trunc[number]

Removes the decimal part without rounding (`-3.9` becomes `-3`). The text version is `$truncate`.

$truncate[text;max;(suffix)]

Shortens a text so that it never exceeds a length, suffix included. `$cropText` is the older equi...

$typeof[value]

Returns the type of a value: string, number, boolean, bigint, object or undefined.

$unEscape[text]

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

$wordCount[text]

Number of words (blocks of text separated by spaces or new lines).

Lists & Helpers

(76)
$arrayAdvancedSort[array;a;b;code;(other)]

Sorts with code that compares two items `a` and `b` and returns a number.

$arrayAt[array;index]

Item at an index (negative counts from the end).

$arrayClear[array]

Empties an array.

$arrayConcat[other;arrays]

Joins several arrays; stores the result in another array, or returns JSON when the first argument...

$arrayCreate[name;(length)]

Creates an array (up to 100000 items), empty or filled with blanks.

$arrayEvery[array;variable;condition]

Tells whether a condition is true for every item.

$arrayFill[array;value]

Sets every item of an array to a value.

$arrayFilter[array;variable;condition;(other)]

Keeps the items for which a condition is true.

$arrayFind[array;variable;condition]

First item for which a condition is true.

$arrayFindIndex[array;variable;condition]

Index of the first item for which a condition is true (-1 if none).

$arrayFindLast[array;variable;condition]

Last item for which a condition is true.

$arrayFindLastIndex[array;variable;condition]

Index of the last item for which a condition is true (-1 if none).

$arrayForEach[array;variable;code]

Runs code once per item; `$env[variable]` holds the current item.

$arrayIncludes[array;value]

Tells whether an array contains a value.

$arrayIndexOf[array;value]

Index of the first item equal to a value (-1 when absent).

$arrayJoin[array;(separator)]

Joins the items with a separator (default `, `).

$arrayLastIndexOf[array;value]

Index of the last item equal to a value (-1 when absent).

$arrayLength[array]

Number of items of an array.

$arrayLoad[name;(separator);(values)]

Loads an array from text split by a separator.

$arrayMap[array;variable;code;(other)]

Builds an array from the result of code run on each item.

$arrayPop[array]

Removes and returns the last item.

$arrayPush[array;values]

Appends items to an array.

$arrayPushJSON[array;values]

Appends JSON values (numbers, objects, lists) to an array.

$arrayRandomIndex[array]

A random valid index (-1 for an empty array).

$arrayRandomValue[array]

A random item.

$arrayReduce[array;accumulator;item;code;(start)]

Folds an array to one value: the code returns the new accumulator.

$arrayReverse[array;(other)]

Reverses an array; stores the result in another array or returns JSON.

$arrayShift[array]

Removes and returns the first item.

$arrayShuffle[array]

Shuffles an array in place.

$arraySlice[array;other;start;(end)]

A part of an array; stores it in another array or returns JSON.

$arraySome[array;variable;condition]

Tells whether a condition is true for at least one item.

$arraySort[array;(other);(order)]

Sorts an array in place (text by default, `asc` or `desc` for numbers) and returns JSON, or store...

$arraySplice[array;index;deleteCount;(elements)]

Removes items from an index and optionally inserts others; returns the removed items as JSON.

$arrayUnique[array;(other)]

Removes duplicates; stores the result in another array or returns JSON.

$arrayUnload[array]

Deletes an array.

$arrayUnshift[array;values]

Adds items at the start of an array.

$arrayUnshiftJSON[array;values]

Adds JSON values at the start of an array.

$chance[percent]

Returns `true` with the given probability. `$chance[25]` is true one time out of four.

$containsAll[text;wordList;(separator);(caseSensitive)]

Tells whether the text contains every word of a list.

$containsAny[text;wordList;(separator);(caseSensitive)]

Tells whether the text contains at least one word of a list. Replaces many `$checkContains` calls.

$default[value;fallback]

Gives the value, or the fallback when the value is empty. Also available as `$ifEmpty`.

$discordTime[timestamp;(format)]

Builds a Discord dynamic timestamp (``) that each member sees in their own language and time...

$duration[seconds;(style)]

Writes a number of seconds in a readable way.

$ifEmpty[value;fallback]

Alias of `$default`: the value, or the fallback when it is empty.

$ifThen[condition;ifTrue;(ifFalse)]

Inline condition: returns one of two values. Only the chosen one is evaluated.

$inRange[number;min;max]

Tells whether a number is between two bounds (both included).

$isArray[value]

Tells whether a name or a JSON text is an array.

$levelFromXp[xp;(formula)]

Level reached with a given amount of XP. Reverse of `$xpForLevel` and the same formulas.

$listAdd[list;item;(separator)]

Adds an item at the end of a list and returns the new list.

$listAvg[list;(separator)]

The average of a list of numbers. An empty list gives an empty text.

$listCount[list;(separator)]

Counts the items of a list. An empty list has 0 items.

$listFirst[list;(separator)]

First item of a list, or empty.

$listGet[list;position;(separator)]

Gets one item of a list. Position 1 is the first item, -1 the last.

$listHas[list;item;(separator)]

Tells whether a list contains an item (exact match).

$listIndexOf[list;item;(separator)]

Position of an item in a list (1 is the first), or 0 when it is absent.

$listJoin[list;sourceSeparator;outputSeparator]

Changes the separator of a list. This keeps IDs from getting mixed up: turn `1,2,3` into one item...

$listLast[list;(separator)]

Last item of a list, or empty.

$listMap[list;template;(separator);(outputSeparator)]

Applies a template to each item. `{item}` is the item and `{index}` its position (starting at 1).

$listMax[list;(separator)]

The largest number of a list of numbers. An empty list gives an empty text.

$listMin[list;(separator)]

The smallest number of a list of numbers. An empty list gives an empty text.

$listNatural[list;(separator);(lastSeparator);(outputSeparator)]

Writes a list as a sentence: `a, b and c`.

$listRemove[list;item;(separator)]

Removes every occurrence of an item and returns the new list.

$listReverse[list;(separator)]

Reverses the order of a list.

$listSlice[list;from;(to);(separator)]

Keeps the items between two positions (both included).

$listSort[list;(order);(numeric);(separator)]

Sorts a list alphabetically (not case sensitive) or by number.

$listSum[list;(separator)]

The sum of a list of numbers. An empty list gives an empty text.

$listUnique[list;(separator)]

Removes duplicates and keeps the first occurrence of each item.

$mentionChannel[channelID]

Builds the mention of a channel from its ID (`<#ID>`).

$mentionRole[roleID]

Builds the mention of a role from its ID, so you do not have to type `<@&ID>`.

$mentionUser[userID]

Builds the mention of a user from their ID (`<@ID>`).

$oneOf[value;option1;option2;...]

Tells whether a value equals one of the options.

$parseDuration[text;(unit)]

Turns a written duration (`1h30m`, `2d`, `45s`) into a number of seconds.

$plural[count;singular;plural;(includeNumber)]

Picks the singular or the plural form for a number.

$progressBar[value;max;(length);(filled);(empty)]

Draws a progress bar with text characters, with no image.

$weightedChoice[items;weights;(separator)]

Picks one item at random, the heavier the weight the likelier it is (drops, lotteries).

$xpForLevel[level;(formula)]

Total XP needed to reach a level.

Server Helpers

(23)
$accountAge[userID;(unit)]

Age of a Discord account, computed from the user ID (no request is made).

$botCanManageRole[roleID]

Tells whether the bot can give or take a role: it must have Manage Roles (or Administrator) and i...

$canModerate[targetID;(actorID)]

Tells whether a sanction on a member is possible by the role hierarchy: the actor AND the bot mus...

$cloneChannel[channelID;(name);(reason)]

Creates a copy of a channel and returns the ID of the new one: same type, topic, age restriction,...

$copyRolePerms[sourceRoleID;targetRoleID;(reason)]

Makes the permissions of a role identical to those of another role. Only the differing permission...

$getRolesWithPerm[permission;(separator);(guildID);(includeAdmin)]

Lists the IDs of the roles that have a permission, from the highest role to the lowest. Gives an ...

$getRolesWithoutPerm[permission;(separator);(guildID);(includeAdmin)]

Lists the IDs of the roles that do NOT have a permission. The opposite of `$getRolesWithPerm`.

$giveRoleByName[userID;roleName;(reason)]

Gives a role to a member, found by its name (not case sensitive).

$hasAllRoles[userID;roleIDs;(separator)]

Tells whether a member has every role of a list.

$hasAnyRole[userID;roleIDs;(separator)]

Tells whether a member has at least one of several roles. `$hasRole` only tests one.

$hasRoleNamed[userID;roleName]

Tells whether a member has a role, found by its name (not case sensitive).

$hideChannel[(channelID);(roleOrUserID);(reason)]

Denies viewing the channel for a role, a member or `@everyone`.

$isNewAccount[userID;(days)]

Tells whether an account is younger than a number of days. Anti-raid guard.

$isOwner[(userID)]

Tells whether a user owns the server.

$lockChannel[(channelID);(roleOrUserID);(reason)]

Denies sending messages (and messages in threads) for a role, a member or `@everyone`.

$roleMemberCount[roleID]

Number of members that have a role, without listing their IDs.

$showChannel[(channelID);(roleOrUserID);(reason)]

Removes that denial for a role, a member or `@everyone`.

$takeRoleByName[userID;roleName;(reason)]

Takes a role from a member, found by its name.

$timeoutFor[userID;duration;(reason)]

Times out a member for a written duration, with an optional reason in the audit log.

$toggleRole[userID;roleID;(reason)]

Gives the role if the member does not have it, takes it away otherwise. Handy for role menus and ...

$unlockChannel[(channelID);(roleOrUserID);(reason)]

Removes that denial (the channel goes back to its category / server settings) for a role, a membe...

$userRoleMentions[userID;(separator)]

Mentions (`<@&ID>`) of the roles a member holds, ready to display in an embed.

$userRoleNames[userID;(separator)]

Names of the roles a member holds, from the highest to the lowest, without `@everyone`.

Date & Time

(17)

Music

(64)
$clearQueue

Removes the upcoming tracks and returns how many were removed

$clearQueueHistory

Forgets the tracks already played.

$currentTrackTotalDuration

Total duration of the current track, in milliseconds.

$deleteQueue

Clears the queue and stops the music.

$disableAllFilters

Disables every audio filter.

$enableAllFilters

Enables every audio filter (Bassboost_low, Bassboost, Bassboost_high, Subboost, Treble, 8d, Vapor...

$getAvailableProviders

Sources that $playMusic and $searchMusic understand: YouTube, YouTubeMusic, SoundCloud and Spotify.

$getDisabledFilters

Disabled audio filters, separated by commas.

$getEnabledFilters

Enabled audio filters, separated by commas.

$getLoopMode

Loop mode of the queue: OFF, TRACK or QUEUE.

$getVolume

Get the current volume of the music player.

$hasMusicNode

Whether the server has a track playing or queued.

$isFilterEnabled[filter]

Whether an audio filter is enabled.

$isPaused

Returns true when the music player of the server is paused.

$isPlaying

Whether a track is playing (not paused).

$isQueueHistoryDisabled

Always false: the history is kept.

$isQueueHistoryEmpty

Whether no track was played yet.

$joinVoice[channelID?]

Joins a voice channel; if no channel ID is given, joins the user's current voice channel

$lavalinkAuthor[]

Returns the author/artist of the currently playing track

$lavalinkDuration[]

Returns the total duration of the currently playing track in milliseconds

$lavalinkIsLooping[]

Returns "true" if looping is currently enabled, "false" otherwise

$lavalinkIsPaused[]

Returns "true" if playback is currently paused, "false" otherwise

$lavalinkPlaying[]

Returns the title of the currently playing track

$lavalinkPosition[]

Returns the current playback position in milliseconds

$lavalinkQueueSize[]

Returns the number of tracks currently in the music queue

$lavalinkVolume[]

Returns the current playback volume level (0–200, default 100)

$leaveVoice[]

Leaves the current voice channel

$leaveVoiceChannel

Destroys the current voice connection.

$moveInQueue[from;to]

Moves an upcoming track to another position and returns its title

$moveTrack[position;newPosition]

Moves a queued track to a new position (0 is the next track).

$pauseMusic[]

Pauses the current music playback

$pauseTrack

Pauses the current track (alias of $pauseMusic).

$playMusic[query;channelID?;userId?]

Plays a track from a search query or URL, auto-joining a voice channel if needed

$playNext

Moves on to the next track in the queue (same as $skipMusic).

$playPrevious

Plays the previous track again (the last one of the history); the current track goes back to the ...

$playTrack[channelID;query]

Plays a track by query in a voice channel (the other ForgeMusic arguments are ignored).

$playerElapsedTime

Elapsed time of the current track, in milliseconds.

$queue[(start);(end);(text);(separator)]

Lists the queued tracks, one line each.

$queueEstimatedDuration

Time left to play the current track and the queue, in milliseconds.

$queueHistory[(start);(end);(text);(separator)]

Lists the tracks already played, oldest first.

$queueHistoryLength

Number of tracks already played.

$queueLength

Returns the length of the current guild queue.

$removeFromQueue[position]

Removes an upcoming track and returns its title

$removeTrack[position]

Removes the queued track at a position (0 is the next track).

$resumeMusic[]

Resumes music playback if it was previously paused

$resumeTrack

Resumes a paused track (alias of $resumeMusic).

$searchMusic[query;limit?]

Searches for tracks without playing them and returns a JSON list

$searchTrack[query;(limit)]

Searches tracks without queuing them: JSON list of title, author and url.

$seekMusic[position]

Seeks to a specific position in the currently playing track

$seekTrack[duration]

Seeks the current track: a time in milliseconds (15000) or with a unit (15s).

$setLoopMode[mode]

Sets the loop mode: off, track or queue.

$setMusicLoop[mode]

Sets the looping mode for music playback

$setMusicVolume[volume]

Sets the music playback volume to a level between 0 and 200

$setVolume[amount]

Sets the volume (0 to 200).

$shuffleQueue

Shuffles the tracks still waiting in the queue

$shuffleTracks

Shuffle the current guild queue.

$skipMusic[]

Skips the currently playing track and plays the next track in the queue

$skipTo[position]

Jumps to the queued track at a position (0 is the next track): the tracks before it are dropped.

$skipTrack

Skips the current track (alias of $skipMusic).

$stopMusic[]

Stops music playback and clears the entire queue

$stopTrack

Stops playback (alias of $stopMusic).

$toggleFilters[filters]

Toggles audio filters: Bassboost_low, Bassboost, Bassboost_high, Subboost, Treble, 8d, Vaporwave,...

$trackInfo[property]

Information of the current track: title, author, duration (ms), position (ms) or volume.

$unshuffleQueue

Puts the upcoming tracks back in the order they had before the last $shuffleQueue.

Webhooks & Integrations

(11)

AI

(8)

Cooldown

(5)

Permission

(4)

Flags & Debug

(8)

Meta

(2)

Misc

(11)