Foreword

✨ Imagine An App...

...That makes building Discord Bots easy, with beginner-friendly functions. That's capable of developing nearly all types of bots - from simple echo bots, to advanced multi-purpose administration ones. Where simplicity meets functionality and scalability, that's Bot Designer for Discord.

What are you waiting for? Create the bot of your dreams today!
Start with Bot Designer for Discord


πŸ““ Wiki

Welcome to our humble abode. The thing you're seeing is Bot Designer for Discord's wiki.

πŸ“‚ Wiki Index

Changelog

Note that we often forget to update this article, so some stuff is missing.

2022

January

  • Added $unescape[]
  • Added a neutral permission (/<perm>) to $modifyChannelPerms[]
  • Added stop bot button in the app
  • Added restart bot button in the app
  • Added $editChannelPerms[] (replacement for the deprecated $modifyChannelPerms[])
  • Added $roleGrant[] (replacement for the deprecated $giveRole[] and $takeRole[])
  • Fixed component functions inside $async[] scope
  • Increased the limit of http functions in one command to 5
  • Fixed $userPerms[]
  • Fixed some bugs regarding math commands
  • Added public BDFD API
  • Added $serverDescription[]

2021

December

  • Saving a command no longer causes the bot to restart
  • Fixed $noMentionMessage[] in BDScript 2
  • Added $timeout[] and $untimeout[]
  • $mute[] and $unmute[] has been marked as deprecated
  • Added guildID argument to $getUserVar[] and $setUserVar[]
  • Fixed the issue with some bots not starting with invalid intents enabled
  • Fixed the role cache
  • Slash command's option description is now required
  • Added $shardID[]
  • Added sharding
  • Improved interaction handling
  • Added $defer
  • Fixed getting invites
  • Added debug information inside the app for translators
  • Fixed $serverNames
  • Added % (modulo) to $calculate[]
  • Fixed removing custom images
  • Added missing permissions
  • Fixed unintentional server restarts
  • The last argument in $replaceText[] is now optional

November

  • Added $reply[]
  • Added $trimSpace[]
  • Added $url[]
  • Upgraded the database
  • Sped up the node starting time
  • Added $botCommands[]
  • Added $unpinMessage[]
  • Added $pinMessage[]
  • Fixed $isUserDMEnabled[] not returning false in some cases
  • $addReactions[] now works in slash commands
  • $dm[] now can dm to more than one mention and can be used multiple times
  • $dm now can be used with $dm[]
  • $random[] now can use decimals
  • Added $'randomChannelID (BDScript Unstable only)
  • Fixed $textSplit[] removing space

October

  • Added $deleteMessage[]
  • Added $hostingExpireTime[]
  • Added timestamp option to $premiumExpireTime
  • Fixed $isUserDMEnabled[]
  • Fixed image parameter in $sendEmbedMessage[] and $webhookSend[]
  • Fixed caching issue for $serverIcon
  • Made it possible to use empty labels in the buttons
  • New UI
  • Added search bar in the variables section
  • Made it possible to use https://youtu.be/ URL in the streaming statuses
  • Added $getTextSplitIndex[]
  • Added $serverChannelExists[]
  • Fixed $changeUsername[] $changeUsernameWithID[] not working on the current bot
  • Made $ephemeral work with the buttons
  • Fixed global variables not getting saved
  • Fixed $deletecommand not getting catched by $try block
  • Made it possible to open function's wiki article from the functions list

September

  • Updated ToS
  • Fixed $executionTime not working in embeds
  • Added $botNode
  • Added $isBanned[]
  • Fixed a problem with $charCount[] having problems with unicode
  • Added $channelType[]
  • Added $async[] block function and $endasync
  • Added $await[]
  • Added $sort[]
  • Added $userPerms[]
  • Added $serverNames[]
  • Improved variables lookup time

August

  • Added $webhookTitle[]
  • Added $webhookDescription[]
  • Added $webhookFooter[]
  • Added $webhookContent[]
  • Added $webhookUsername[]
  • Added $webhookAvatarURL[]
  • Added $webhookCreate[]
  • Removed permission check from $deleteChannelsByName[]
  • Removed permission check from $deleteChannels[]
  • Removed permission check from $createChannel[]
  • Fixed the issue with bots not working in threads
  • Added $startThread[]
  • Added $webhookColor[]
  • Fixed optional field in $getServerVar[]
  • Fixed floating points in $onlyIf[] conditions
  • Added $webhookDelete[]
  • Added $webhookSend[]
  • Removed permission check from $modifyChannelPerms[]
  • Made it possible to use multiple $onInteraction[]s
  • Added $onInteraction callback (without [])
  • Added $customID
  • Made it possible to use different scripting languages in callbacks
  • Added $editThread[]
  • Added $threadAddMember[]
  • Added $threadRemoveMember[]
  • Added $getEmbedData[]
  • Made it possible to use block functions ($if[], $try, etc.) inside function arguments in BDScript 2
  • Fixed preprocessor failures in some corner cases in BDScript 2
  • Fixed a bug with block-functions adding extra new line in BDScript 2
  • Fixed and optimised $setVar[]
  • Added $sendEmbedMessage[]
  • Fixed condition parsing in $if[] for the normal BDScript and BDScript Unstable (BDScript 2 didn't have any issues)
  • Made command saving faster

July

  • Added $getTimestamp
  • Added support for decimals in the math functions
  • Added $newSelectMenu[]
  • Added $addSelectMenuOption[]
  • Added $editSelectMenu[]
  • Added $editSelectMenuOption[]
  • Added $removeComponent[]
  • Added $calculate[]
  • Added $round[]
  • Added $enableDecimals[]
  • Added $nickname
  • Added row and column information in BDScript 2 errors
  • Fixed the issue with BDScript 2 not requiring ]
  • Adjusted the optimizer in BDScript 2
  • Added $onlyForRoleIDs[]
  • Added $getCooldown[]
  • Fixed problems with ] in some functions
  • Fixed component functions inside $eval[] function
  • Fixed minor bugs inside BDScript 2 parser
  • Fixed author ID not showing up in $mentioned[..;yes]
  • Fixed $serverNames which removed two last characters
  • Fixed $addTimestamp[] when used for multiple embeds
  • Added limits for the $round[] function (max decimal place)
  • Added $and[]
  • Added $or[]
  • Added $allowRoleMentions[]
  • Added $allowUserMentions[]
  • Added $guildExists[]
  • Fixed $serverVerificationLvl

June

  • Fixed $sendMessage[] not working in normal BDScript
  • Fixed $checkUserPerms[]
  • Added BDScript 2
  • Added $try, $catch and $error
  • Added $eval[] (can be only used in BDScript 2)
  • Added $optOff[] (can be only used in BDScript 2)
  • Added $stop[] (can be only used in BDScript 2)
  • Added $var[] (can be only used in BDScript 2)
  • Added customizable code highlighting
  • Fixed $lowestRole and $highestRole
  • Added $isBoolean[]
  • Made it possible to add 5 buttons per row
  • Added optional field return type to $getLeaderboardValue[]
  • Added $deleteRole[]
  • Added $ephemeral
  • Added $elseif[] (can be only used in BDScript 2)
  • Fixed URL in buttons
  • Fixed buttons in DMs
  • Fixed problems with custom prefixes
  • Added $getUserStatus[]
  • Added $min[]
  • Added $max[]
  • Fixed $customEmoji[]
  • Made it possible to edit embeds in $editMessage[]
  • Added support for multiple embeds
  • Added $httpAddHeader[]
  • Added $httpRemoveHeader[]

May

  • Fixed a bug which allowed executing certain types of callbacks as normal commands
  • Fixed member caching issue
  • Fixed caching bots
  • Fixed changing tokens in the webapp
  • Fixed $isUserDMEnabled[]
  • Added $addButton[]
  • Added $editButton[]
  • Added $removeButtons and $removeButtons[]
  • Added $onInteraction[] callback
  • Fixed some issues with slash commands
  • Added $c[] which can be used for commenting your code

April

  • Added $httpGet[], $httpPost[], $httpPut[], $httpDelete[] and $httpPatch[]
  • Improved overall caching
  • Added $httpResult[]
  • Made command execution faster

March

  • Added $cropText[]
  • Added userID field to $awaitFunc[]
  • Fixed removing normal commands and slash commands
  • Added $removeLinks[]
  • Made returning authorID optional in $findUser[]
  • Added $slowmode[]
  • Added $checkUserPerms[]
  • Added $isNSFW[]
  • Fixed setting NSFW in $modifyChannel[]
  • Fixed $userJoined[] and $userJoinedDiscord[]
  • Added $editMessage[]
  • Fixed caching for new members.
  • Added $slashCommandsCount
  • Added $botID
  • Added more permissions - AttachFiles, TTS, ManageWebhooks, EmbedLinks, ExternalEmojis
  • Added $serverCooldown[]
  • Fixed the issue with not expiring app bans
  • Fixed some issues with [ and ]
  • Fixed problems with slash commands and cooldowns

February

  • Added $sendMessage[]
  • Added $reply
  • Added slash commands
  • Fixed mentions in $findChannel[]
  • Improved performance in the command interpreter
  • Optimized reaction handlers
  • Added $isSlash
  • Added new optional field to $message[]
  • Fixed semicolons in $channelSendMessage[]

January

  • Fixed the problem with statuses not showing up
  • Fixed the issue with mentions not working
  • Fixed loading bots from database
  • Increased duration to 40 minutes for $deleteIn[], $editIn[], $editEmbedIn[], $replyIn[]
  • Added if statements ($if[], $else, $endif)
  • GuildID instead of everyone is now returned in $lowestRole[] and $highestRole[]
  • Space commands have been removed (you can still use $alwaysReply)
  • Added $channelTopic[]
  • Fixed issues with streaming status
  • Fixed the issue with tags/discriminators not working for $userID[] and $findUser[]
  • Added $findChannel[] and $channelExists[]
  • Added $userJoined[] and $userJoinedDiscord[]

2020

December

  • Timezones in $time[] has been fixed
  • Updated discord API version
  • Added Competing presence
  • Added $botLeave[]
  • Fix for $getLeaderboardValue[]
  • Added userID option to reset user var
  • Added serverID option to $serverOwner
  • Added $premiumExpireTime

November

  • Fixed disappearing bot status
  • Fixed $serverCount in bot status
  • Improved caching
  • Functions that require privileged intents are now marked accordingly
  • Added $getLeaderboardValue[]
  • Added $awaitReactions[]
  • Awaited commands are now available for everyone
  • Added awaited reactions
  • Fixed problems with DMs

October

  • Optimized memory usage
  • Added member and presence intents
  • Added $editEmbedIn[]
  • Added serverID field to server variables
  • Allowed using awaited functions in awaited commands
  • Fixed leaderboards
  • Fixed $randomMention, $randomUser and $randomUserID
  • Added $awaitReactions[] for premium bots
  • Added $usedEmoji
  • $deletecommand sends an error now
  • Fixed $serverVerificationLvl not working on very high verification servers
  • Fixed reconnecting bots to gateway

September

  • Added $ignoreTriggerCase for premium bots
  • Fixed caching guilds
  • $findUser[] & $findRole[] are no longer case sensitive
  • $findUser[] returns authorID if no user found
  • Added awaited commands for premium bots
  • Fixed weird brackets in embeds
  • Added trigger list in the app

August

  • Migrated to the new infrastructure (new database and API)
  • Premium released
  • Fixed $isMentionable[]
  • Fixed $isHoisted[]
  • Added $removeSplitTextElement[]
  • $userAvatar[] no longer stops code execution
  • Fixed $argCount[]
  • Added $findUser[]
  • Added $findRole[]
  • Added $disableSpecialEscaping

July

  • Renamed $splitText[] to $getSplitText[] to avoid confusion ($splitText[] still works)
  • Added $joinSplitText[]
  • Added $getInviteInfo[]
  • Added $guildID[]
  • Fixed $numberSeparator[] in the bot's status
  • $roleID[] and $channelID[] no longer stop code execution
  • Enabled BDScript Unstable for callbacks
  • Added $getTextSplitLength

June

  • Fixed $getReactions[] in BDScript Unstable
  • Fixed bracket escaping for some commands in BDScript Unstable
  • Fixed $modifyChannel[] (random slowmodes added on channels)

May

  • Fixed $onlyBotPerms[]
  • Bot Designer List Open Beta
  • Added $botListDescription[] and $botListHide
  • Fixed brackets issue in $serverNames
  • Other bug fixing for Bot Designer and Bot Designer List

April

  • Fixed $serverIcon
  • Added $changeCooldownTime[]
  • Disabled $randomUserID, $'randomUserID, $deleteIn and $dm in $onMessageDelete
  • Fixed $addField[]
  • Added error message in $getServerVar[] when provided variable does not exist
  • $userID[] does not stop code execution if user is not found
  • Added $botLeave
  • Removed permission check from $clear command.
  • Fixed $isAdmin[]

March

  • Added $getReactions[] and $userReacted[]
  • New command interpreter
  • Added to new parser:
    • $'random[] and $'random
    • $'randomText[]
    • $'randomUser
    • $'randomMention
    • $'randomUserID
    • $'randomString[]
  • Fixed brackets in $getMessage[]
  • Changed behaviour of $onlyPerms[] command
  • Added $charCount[]
  • Added $clearReactions[]
  • Added new options to $getMessage[]
  • Fixed adding slowmode when using $modifyChannel[]
  • Added $checkContains[]
  • Added $addEmoji[]
  • Fixed the bug with $ command prefix and $noMentionMessage
  • Added $unbanID[]
  • Added $hasRole[]
  • Optimized the leaderboard commands
  • Fixed permissions in some commands
  • Fixed $onlyPerms[]
  • Fixed the bug with $ command prefix and $message

February

  • Fixed errors in $addField
  • Added $serverRegion
  • Added $serverOwner
  • Added $emoteCount
  • Added $isMentionable[]
  • Added $isHoisted[]
  • Added $serverIcon[]
  • Fixed suppressing errors in some variable commands
  • Fixed bug with $replaceText[]() inside $description
  • Added $isValidHex[]
  • Added $isAdmin[]
  • $userID[] does not require discriminator now
  • Added $serverVerificationLvl
  • Fixed stopping command when $changeUsernameWithID[] or $changeUsername[] throws an exception
  • Added $modifyRolePerms[]
  • Added $isUserDMEnabled[]
  • Added new option to $mentioned[]
  • When userID is not provided in $discriminator[], the author's ID will be used
  • Added $argCount[]
  • Added $roleExists[] and $roleExists[]
  • Added $varExistError[]
  • Removed permissions check for $kick[] function
  • Fixed brackets issue in $message and $noMentionMessage
  • Fixed $globalUserLeaderboard[]
  • $repeatMessage[] won't send an error when there is 0 provided

January

  • Final premium preparations
  • Space commands for premium bots
  • Added sendChannelMessage() to JS
  • Added $isNumber[]
  • Better description for $replaceText[]
  • Removed # from $getRoleColor[]
  • Added possibility of adding custom error message to $suppressErrors[]
  • Added $embedSuppressErrors[]
  • Added $getServerVar[] in command's name for premium bots
  • Added custom separators to $numberSeparator[]
  • Fixed issue with + and - in $numberSeparator[]
  • iOS release
  • Added $isBot[]
  • Added userID option to $takeRole[]
  • Fixed problems with timezones
  • @everyone role shows up now when it's a highest/lowest role in $highestRole/$lowestRole
  • @everyone role now works in $rolePosition[]
  • Multiline for $replaceText[]
  • Fixed no errors in $roleID[]
  • Added $toUppercase[] and $toLowercase[]
  • Added roleID and userID to $modifyChannelPerms[]
  • Added $authorOfMessage[]
  • Added $userID[]
  • Improved servers response time by over 10x
  • Fixed issues with $setServerVar[] and $setUserVar[]
  • Added multiline support for $textSplit[]
  • Fixed brackets in $username

2019

December

  • Fixed high ping issues
  • Fixed whole bunch of other issues
  • To JS added:
    • authorId,
    • channelId,
    • userMentions,
    • roleMentions,
    • unban(),
    • takeRole(),
    • giveRole(),
    • channelTyping(),
    • createChannel(),
    • removeChannel(),
    • unpinMessage(),
    • banWithReason(),
    • kickWithReason(),
    • removeRole(),
    • createRole()
  • Created status website https://status.botdesignerdiscord.com
  • Web version of Bot Designer for Discord has been moved to new address https://botdesignerdiscord.com
  • Fixed some issues in web version
  • Fixed $banID[]
  • Preparations for premium points

November

  • Added $rolePosition[]
  • Released translation strings to volunteers
  • Added kick() and ban() to JS
  • Released new stable version

Async

Runs functions in the background. Using async features properly can optimize your code and make it faster!

Warning: Async features only work in BDScript 2.

Breakdown

  • Use $async[name] to start an async block. The name must be unique to the block. Functions inside async blocks run in the background without blocking the command's thread.
  • Use $endasync to end async block.
  • Use $await[name] to wait for the async block's result.

Examples

Example #1

$async[test]
  $setVar[money;0]
  $addReactions[πŸ‘Œ]
$endasync

Money set to 0

Example #2

$async[test1]
  $setVar[banned;1]
$endasync

$async[test2]
  $banID[some reason;246604909451935745]
$endasync

$await[test1]
$await[test2]

Done

Async

Runs functions in the background. Using async features properly can optimize your code and make it faster!

Warning: Async features only work in BDScript 2.

Breakdown

  • Use $async[name] to start an async block. The name must be unique to the block. Functions inside async blocks run in the background without blocking the command's thread.
  • Use $endasync to end async block.
  • Use $await[name] to wait for the async block's result.

Examples

Example #1

$async[test]
  $setVar[money;0]
  $addReactions[πŸ‘Œ]
$endasync

Money set to 0

Example #2

$async[test1]
  $setVar[banned;1]
$endasync

$async[test2]
  $banID[some reason;246604909451935745]
$endasync

$await[test1]
$await[test2]

Done

Awaited Commands and Functions

This feature lets your bot to await for user's answer.
Here's how the end result looks like:

end result

As you can see, the bot asks us to provide a number and then checks
if provided value is a number.

is-number command

That's how is-number command looks like: is-number command

$awaitFunc[test2] launches await command which is called test2.

Awaited command

Here you can see the test2 awaited command:

awaited command

Have you noticed what's in the command's trigger?
$awaitedCommand[test2;<numeric>] - the first argument is the command's name.
In this case it's test2. The second argument is a filter.
<numeric> means that the awaited command expects only numbers.

Here are currently available filters:

  • <numeric> - only numbers are accepted
  • <this/is/a/choice/filter> - one of the words separated by / is expected
  • an empty filter - every word is accepted

What happens if the filter doesn't match?
Well, you can create a command which will be used instead.

Awaited error command

error command

As you can see, we are using $awaitedCommandError[test2] in the trigger.
The first argument specifies the command's name.
This command will only be used when the filter in
the awaited command does not match user's response.

BDScript 2

The new edition of BDScript.

Introduction

As you probably know, the default scripting language in the app is BDScript, there is also an alternative edition called BDScript Unstable.
BDScript 2 has been created with intention of enhancing its capabilities and fixing some of the problems the other versions had.
The default edition of BDScript has one big issue, commands like $sum[$sum[3;2];1] don't work. The reason it doesn't work is because BDScript has a predefined order for executing functions. I won't go into the nitty-gritty details how exactly it works so, just so you know there are certain function combinations that don't work together.
In order to fix the issue, we've created a new BDScript edition called BDScript Unstable. It executes function in a command from bottom to top, from right to left. It fixed the issue but the new edtition had its own quirks which for some commands could be problematic. That's were BDScript 2 comes in. This edition executes commands from top to bottom, from left to right (basically just the way you read most of the books). Besides that, BDScript 2 has new features like $eval[], $try and $catch and more.
This edition is still rough on edges but we intend to polish it and make it the default choice in the app.

Features

$eval[]

Warning: It should be used with caution. Remember to restrict the command with $onlyForIDs[] or similar function! If you programmed in JavaScript, you probably know what it does. It basically executes every function that is provided as an argument. For example:

$eval[$message]

This will execute every function that has been provided by a user.

$try, $catch and $error[]

This works in a very similar way to the equivalents available in other programming languages.
You can read more about it here.

$async

Runs functions asynchronously. Read this for more information.

$elseif

Read this for more information.

$var[]

It can be used to temporarily store a value. After the command executes, all of the vars are removed.\ For this specific variable function you don't need to create a coresponding variable in the app.
To store a value you simply use $var[VARIABLE NAME;VALUE]. To retrieve it you just do $var[VARIABLE NAME].

$stop

It stops the command execution. It may seem like a useless function but it can come in handy with $ifs or $trys.

$optOff[]

It should be used only by more advanced users.
The full function's name is optimizations off. Sometimes BDScript 2 doesn't execute the same function twice and it uses the previous result instead. $optOff[] allows disabling that behaviour for provided functions. Here's a small example:

$random // returns 3
$random // returns 3
$random // returns 3
$optOff[$random] // returns 1
$random // returns 1
$random // returns 1

Buttons

In this section you'll learn how to use the button components.

demonstration

Button Style

Buttons can have different styles (background colors etc.) Here are all possible values for style function argument.

  • primary
  • secondary
  • success
  • danger
  • link

Note: if link style is used, the button won't send any interactions!

Style examples

button styles
The image was taken from Discord Docs

Button types

There are 2 types of buttons: interactive and link.

When an interactive button is pressed it sends an interaction which can be used together with $onInteraction[ID]. Every interactive button has an ID. If you create $onInteraction[ID] callback, it will get triggered when the button with the same ID is pressed. Interactive buttons can use every style except link.

Link buttons don't send any interactions. When they're pressed they forward the user to a website. Link buttons have to set their style argument value to link.

Adding a button

Buttons can be added to a new message or already existing message.
$addButton[new row (yes/no);interaction ID or url;label;style;disabled (yes/no);emoji (leave empty if not needed);messageID(optional)]

Function arguments breakdown

  • new row - if set to yes the button will appear in a new row. If it's set to no the button will appear in the same row as a previous button. Check examples below.
  • interaction ID or url - depending on a button type, you either set it to interactionID which is then used in $onInteraction[ID] callback or URL if it's link button.
  • label - it's the text value visible on a button
  • style - it's used to specify the button's background color. If the button has a link/url you have to set this to link. Check this section for more details.
  • disabled - if set to yes the button can't be pressed
  • emoji - this can be left empty (it has to be provided but it can be empty) if you don't want emoji inside the button. Emojis have to be either pasted as unicode or be in this format <:emoji name:emoji ID>
  • messageID - this field is optional which means it doesn't has to be provided. When it's provided the buttons will be added to a provided message and not to the current one. It's important to note that the message author has to be the bot.

Note: Interactive buttons can't have duplicated IDs in the same message. So for example you can't have two buttons with the ID set to test
Note: if url is used in interaction ID or url argument, it has to start with http:// or https://

Editing a button

$editButton[buttonID or URL;label;style;disabled (yes/no);emoji (leave empty if not needed);messageID(optional)]
Arguments work exactly the same way as in $addButton function. buttonID or URL is used for finding the button.

Removing buttons

There are two functions for this.

  • $removeButtons - removes buttons from the current message
  • $removeButtons[messageID] - removed button from the provided message

Code Examples

Creating a simple interactive button

code example

Note: the last argument in $addButton is empty because we don't want emojis for this example

Creating $onInteraction[] callback

callback code example

Note: ID provided in $onInteraction[] is the same as the one provided in $addButton[] from this section

Note: In the $addButton[] I used yes for the new row argument so the button would appear in the next row. Check the results below.

Usage

Command execution

demonstration

After pressing the button

demonstration pressed button

Character Escaping

(for advanced users)

What Are Escape Characters?

Escape characters are used to indicate that the character should not be interpeted as a modifaction of the code, rather just text that appears in the code or bot's response. Basically, escape characters let your bot return the function-triggering characters (e.g ;, $, [, ]) without any changes to the code.

Escapable Characters

CharacterEscaped
;%{-SEMICOL-}%
$%{DOL}%
[\[
]%ESCAPED%

Example

$sendMessage[\[ Hi, this is pretty cool%{-SEMICOL-}% right? %ESCAPED%]

example

πŸ§™β€β™‚οΈ It's recommended that you use unstable mode when using character escaping.

Commands Anatomy

There are 3 main components to commands, these are: Name, Trigger, and Code.

Command Names

Think of this like a note. Command names don't impact your command at all, but they can help you find commands within the app. You can leave this field empty if you choose.

image

Command Triggers

What the user types to run the command. Triggers should contain both a prefix (e.g !) and the actual command name (like help). This combines to !help. Do not include any spaces at the end of the trigger. Triggers are case sensitive (unless the premium function: $ignoreTriggerCase is used in the command code). You can use callbacks in this field.

image

Command Code

The soul of your command. This is what the bot responds with/does when the command is executed, you can use functions like $ping and $message here.

image

Example

image

Output

image

$try, $catch and $error

Allows handling errors in BDScript 2

Breakdown

  • Use $try to specify functions to execute
  • Optionally use $catch to specify what functions should be executed if one of the functions in $try fails.
  • Use $error[] inside $catch to retrieve information about the error.
  • Use $endtry to end $try

$error[]

It can be used inside $catch to retrieve information about the error.
Possible arguments:

  • command - retrieves the name of a function that failed.
  • source - retrieves the whole function together with arguments.
  • message - retrieves the error message.

Examples

1

Hi!
$try
  Sum: $sum[$message[1];$message[2]]
  Sub: $sub[$message[1];$message[2]]
$catch
  Error occured: $error[message]
$endtry

Output for $message[1] equal to 10 and $message[2] equal to 5:

Hi!
Sum: 15
Sub: 5

Output for $message[1] equal to abc and $message[2] equal to 5:

Error occured: Invalid arguments!

2

In this example we won't use $catch

$try
$time[$message]
$endtry
Time zone has been set!

Output for $message equal to Europe/Warsaw (correct timezone):

Time zone has been set!

Output for $message equal to Mars (wrong timezone):

Time zone has been set!

As you can see the output is the same because we don't handle the errors here (there is no $catch). We just simply ignore them.

HTTP Requests

A HTTP request is an action to be performed on a resource identified by a URL.

Before reading this guide, please note that this feature is not intended for new BDFD users, as it is pretty advanced.

HTTP Request Types

  • This is a list of all HTTP request types available.

GET

Description: Retrieves data from a resource.

Function: $httpGet[URL]

POST

Description: The data sent to the server with POST is stored in the request body of the HTTP request.

Function: $httpPost[url;(optional) request's body]

PUT

Description: The PUT method replaces all current representations of the target resource with the request payload.

Function: $httpPut[url;(optional) request's body]

DELETE

Description: The DELETE method deletes the specified resource.

Function: $httpDelete[url;(optional) request's body]

PATCH

Description: The PATCH method applies partial modifications to a resource.

Function: $httpPatch[url;(optional) request's body]

HTTP Headers

HTTP Headers is used to add more information. Most of the time, this is used to send an API Key to the API.

To add headers, use $httpAddHeader[header name;header value]

HTTP Results

To return the result of a HTTP method function, you can use $httpResult/$httpResult[].

Usage #1: $httpResult - Retrieves text value from HTTP request.

Usage #2: $httpResult[jsonKey1;jsonKey2;etc...] - Retrieves JSON from HTTP request. All arguments after jsonKey1 are optional.

Example

$image[$httpResult[url]]
$httpGet[https://nekos.best/nekos]

Hyperlinks

A hyperlink is clickable-text. When the user clicks on the text, it directs them to a certain URL.

You can use this method inside of $description[] and the $addField[] value field.

Sytnax

[text](link)

Note: If you are using BDScript 2 or get a error while using hyperlinks, add a \ to the left bracket of the hyperlink: [text\](link).

Example

$nomention
$description[This bot is made with [Bot Designer For Discord\](https://botdesignerdiscord.com)]

example

Use the $embeddedURL function to add a hyperlink in $title.

Use the $authorURL function to add a hyperlink in $author.

If Statements

Interprets commands conditionally. Every if statement starts with $if[condition] and has to end with $endif. $else is optional.

Breakdown

  • Use $if[] to specify a block of code to be executed, if a specified condition is true.
  • Use $else to specify a block of code to be executed, if the same condition is false.
  • Use $elseif[] to specify a new condition to check, if the first condition is false (can be only used in BDScript 2)
  • Use $else and $if[] to specify a new condition to check, if the first condition is false.
  • Use $endif to end a if statement.

Examples:

$if[$username==kubastick]
  Hi Kuba!
$else
  Hi $username!
$endif
$if[$getUserVar[money]>0]
  You're not broke
$endif
$if[$username==noituri]
  $if[$message[<]==nice]
    Noit said nice
  $endif
$endif

Only for BDScript 2:

$if[$message==test]
  You said test
$elseif[$message==BDFD]
  Bot Designer for Discord
$elseif[$username==noituri]
  Hi Noituri!
$else
  I don't know what to say
$endif

Note: You can use multiple $elseifs

Explaination

$if[] uses the format of: if x is related accordingly (based on the "sign") with y then the code below runs.

Signs

== - Equal

!= - Not Equal

< - Less Than

> - Greater Than

>= - Greater Than Or Equal To

<= - Less Than Or Equal To

  • These signs could vary in meaning based on the order or intent of the if statement.
  • If you are using text as your x and/or y, you can not use any other signs besides == and !=. However for numbers, you can use any sign shown in the above list.

Base Usage

$if[valuex(sign)valuey]

Else If

$elseif can be only used in BDScript 2. If you use different BDScript edition please read the note below.

Note: Normal BDScript and BDScript Unstable don't have a specific function for else if blocks, but you can still do them by using $else and $if[]. The difference between $else and $else/$if[] is that else doesn't need a condition. Where as else if is still an if so it needs a condition. The main purpose for else if is to make it so only one if statement runs. Unlike regular if statements, the else if blocks should end with $else then start with another $if[]. Once you are done with your else if statements, close all of them with x number of $endifs (x = number of else if statements) at the bottom of the last else if statement.

Example Else If for Normal BDScript and BDScript Unstable

$if[$checkContains[$message;hi]==true]
Hello

$else
$if[$checkContains[$message;yes]==true]
Sure!

$endif
$endif

Select Menu

In this section you'll learn how to use the select menu component.
demonstration demonstration with options

Creating a new select menu

$newSelectMenu[interaction ID;min values to select;max values to select;placeholder;messageID(optional)]

  • interaction ID - it's used for $onInteraction[ID] callback. It works the same way as buttons
  • min values to select - minimum amount of values that can be selected
  • max values to select - maximum amount of values that can be selected
  • placeholder - it's a text that appears if no value is selected
  • messageID(optional) - ID of a message that should have select menu added to it. By default it's the bot's response.

Adding an option to select menu

$addSelectMenuOption[select menu's interaction ID;label;value;description;default (yes/no);emoji (can be left empty);messageID (optional)]

  • select menu's interaction ID - it has to be the same as the ID used in $newSelectMenu[]
  • label - the name of the option
  • description - it shows up under the label
  • value - it's the data that gets passed to $onInteraction[] callback. The value has to be unique in the select menu!
  • default (yes/no) - should the option be selected by default. There can be only one default option!
  • emoji - it shows up next to the label
  • messageID (optional) - same as in $newSelectMenu[]

Example

Select Menu code:
select menu code

Interaction code:
interaction code

Usage:
before using after using

Slash Commands

Slash commands is a new feature added by Discord. It let's users interact with your bot by typing /<command name>.

preview

General information

  • Discord allows up to 50 slash commands.
  • Before using slash commands you need to reinvite the bot with applications.commands scope.
  • Creating/modifying/deleting slash command might take up to 1hr.

Getting started

Before we start, you need 1.18.8 version of the app or later.

Reinviting the bot

  • Open the app
  • Pick your bot
  • Open navigation drawer and then press "Server invites"
  • Press the button with eye icon.
  • Select Slash commands
  • Go back
  • Press "Add your bot to your server"
  • Invite the bot to your server invite scopes

Creating a slash command

  • Create or modify existing command
  • Press the top-right icon
  • Press "Enable slash command trigger"
  • Fill in necessary data
  • Save it slash command page

Retriving value from options

You can retrive a value from an option by simply using $message[<option name>].
If you want this function to work in a normal and slash command
then you can use $message[<arg number>;<option name>].

Example

message example code
message example usage

Checking if a command has been executed by a slash trigger

You can use $isSlash which returns true if a command
was executed by slash trigger, otherwise it returns false.

Text Splitting

Text splitting functions are useful for advanced codes that deal with multiple user arguments, or even adjusting function outputs (for advanced users). This wiki includes information on how to use these functions.

Functions

$textSplit[]

$textSplit[text;splitter]

Splits the text into sections by a splitter.

$splitText[]

$splitText[index]

Retrieves a value from $textSplit.

πŸ§™β€β™‚οΈ You can also use $splitText[>] to retrieve the last value of the split.

$getTextSplitLength

$getTextSplitLength

Returns how many splits there are in $textSplit. Here's a example:

$textSplit[hello world | hello planet | hello earth;|]
$getTextSplitLength

example

$removeSplitTextElement[]

$removeSplitTextElement[index]

Removes a element from $splitText. Here's a example:

$textSplit[hello world | hello planet | hello earth;|]
$removeSplitTextElement[1]
1: $splitText[1]
2: $splitText[2]

example

$joinSplitText

$joinSplitText[splitter]

Joins $textSplit values with provided 'splitter'. Here's a example:

$textSplit[hello world | hello planet | hello earth;|]
$joinSplitText[+]

example

Examples

Example #1

$textSplit[hello world | hello planet | hello earth;|]
1: $splitText[1]
2: $splitText[2]
3: $splitText[3]

example

Example #2

$textSplit[text1-text2-text3-text4;-]
1: $splitText[1]
2: $splitText[2]
3: $splitText[3]
4: $splitText[4]
Length: $getTextSplitLength

example

Advanced

Splitting via Spaces

In $textSplit, BDFD reads spaces differently. Here's a example:

$textSplit[this is some text; ]

Instead of splitting the text by each space, it splits the text by each character.

To prevent this from happening, you can use the code below:

$textSplit[$replaceText[text; ;,;-1];,]
$c[Replace 'text' with your text.]

Example using this method:

$textSplit[$replaceText[hello hey hi; ;,;-1];,]
1: $splitText[1]
2: $splitText[2]
3: $splitText[3]

example

Threads

example

Threads are a new Discord feature which allows for subset-channels within a channel. Threads are great for separating different conversations in one channel. This wiki will explain how you can integrate threads in your bot.

Creating a Thread

$startThread[name;channelID;messageID (canBeLeftEmpty);archiveDuration (60/1440/4320/10080);returnThreadID (yes/no)]

Starts a thread (learn more)

Editing a Thread

$editThread[threadID;name;archived (yes/no);archiveDuration (60/1440/4320/10080);locked (yes/no);slowmode (in seconds)]

Edits a existing thread. (learn more)

Member Thread Management

Adding a User to a Thread

$threadAddMember[threadID;userID]

Adds a user to the thread. (learn more)

Removing a User from a Thread

$threadRemoveMember[threadID;userID]

Removes a user from the thread. (learn more)

Example

$var[threadID;$startThread[Cool Thread;$channelID;;1440;yes]]
I created a new thread! <#$var[threadID]>
$c[❗️This example requires BDScript 2 enabled❗️]

Further Reading

If you want to learn more about threads, read Discord's support article.

Variables Guide

Introduction

Variables are how we store data in BDFD. Data can be assigned to users, servers, and globally. Each variable has two elements, which we will breakdown in this section.

Variable Elements

  • name - The name of the variable. This can't be modified by the bot, its used the "call" the current variable.
  • value - The value of the variable. This can be modified by the bot, its returned when the variable name is called in $getVar/$getUserVar/$getServerVar.

Creating Variables

Creating variables can only be done in the app. Here's how to create a variable, which you can get and modify later.

#1: Select the bot you want to add the new variable to.

#2: Click the 3-line menu.

ex1

#3: Select the "Variables" tab.

ex2

#4: Create a new variable.

ex3

#5: Give the variable a name and value.

ex4

#6: Save your changes!

ex5

Editing Variables

Here's how you can modify a existing variable's name/default value.

#1: Select the bot you want to edit the variable for.

#2: Click the 3-line menu.

ex1

#3: Select the "Variables" tab.

ex2

#4: Select the variable you want to edit.

ex3

#5: Edit the variable name and/or value.

ex4

#6: Save your changes!

ex5

Deleting Variables

Here's how you can delete variables, which means commands using the deleted variable may return error messages.

#1: Select the bot you want to delete the variable for.

#2: Click the 3-line menu.

ex1

#3: Select the "Variables" tab.

ex2

#4: Select the variable you want to delete.

ex3

#5: Confirm the deletion!

ex4

Global/Global-User Variables

$setVar[variableName;newValue]/$getVar[variableName] are global variable functions, this means they apply to universally (they don't change per-server or per-user). However, if you input a user in the optional userID field then it becomes a global-user variable. Global-user variables stay with the user in every server. The usage of global-user variables looks like this: $setVar[variableName;newValue;userID]/$getVar[variable name;userID].

Global Variables - Functions

  • $setVar[variableName;newValue] - Changes the provided global-variable's value to 'newValue'.

πŸ§™β€β™‚οΈ Global variables are universal, meaning if the variable gets modified, the modification applies to everyone.

  • $getVar[variableName] - Gets the current value of the provided global-variable.

Global Variables - Example

This is the variable we're working with:

ex

This command adds 1 cool point to the 'CoolCount' variable value, everytime it is ran.

$nomention
$setVar[CoolCount;$sum[$getVar[CoolCount];1]]
Cool counter updated! 😎
$c[Updates the variable for all servers.]

ex

This command returns how many cool points have been earned.

$nomention
Cool counter is at $getVar[CoolCount] currently! Keep running `!cool` for more cool points.
$c[This is the same for everyone, no matter who runs it.]

ex

Global-User Variables - Functions

  • $setVar[variableName;newValue;userID] - Sets the provided variable to 'newValue' for the inputted 'userID'.
  • $getVar[variableName;userID] - Gets the provided variable's value for the inputted 'userID'.

πŸ§™β€β™‚οΈ Global-user variables stay with the user in every server. Unlike user variables which unqiue per-user and differ in each server.

Global-User Variables - Examples

This is the variable we're working with:

ex

This command modifies the user's bio.

$nomention
$argsCheck[>1;❌ Please provide text!]
$setVar[Bio;$noMentionMessage;$authorID]
Successfully updated your bio!
$c[Updates the variable for the user in all servers.]

ex

This command returns the user's current bio.

$nomention
**<@$mentioned[1;yes]>'s Bio:**
$getVar[Bio;$mentioned[1;yes]]
$c[Gets the author/mentioned-user's current bio.]

ex

User Variables

User variables are unique per-user and differ in each server.

User Variables - Functions

  • $setUserVar[variableName;newValue;(optional) userID] - Sets the provided variable to 'newValue' for the inputted 'userID', or the author of the command if no user is provided.
  • $getUserVar[variableName;(optional) userID] - Gets the current value for the provided user variable. Returns the author's variable value if no 'userID' is provided.

User Variables - Examples

⚠️ This example would require premium to be fully functional! ⚠️

Here's the variable we're working with:

example

This command adds 1 to the user's 'Mentions' variable, everytime the user mentions someone.

πŸ§™β€β™‚οΈ The trigger for this command would be $messageContains[<@].

$nomention
$setUserVar[Mentions;$sum[$getUserVar[Mentions];1]]

This command returns how many times the user has mentioned others, in the current server:

$nomention
You have mentioned others `$getUserVar[Mentions]` times in $serverName[$guildID]!

ex

Server Variables

Server variables are unique per-server.

Server Variables - Functions

  • $setServerVar[variableName;newValue;(optional) serverID] - Sets the provided variable to 'newValue' for the inputted 'serverID', or the server that the command was ran in; if no 'serverID' was provided.
  • $getServerVar[variableName;(optional) serverID] - Gets the current value for the provided server variable. Returns the current server's variable value if no 'serverID' is provided.

Server Variables - Examples

Here's the variable we're working with:

ex

This command adds 1 cookie to the 'ServerCookies' variable value, everytime it is ran.

$nomention
This server now has `$sum[$getServerVar[ServerCookies];1]` cookies picked πŸͺ
$setServerVar[ServerCookies;$sum[$getServerVar[ServerCookies];1]]

ex

This command returns how many cookies the server has currently.

$nomention
Total Server Cookies: πŸͺ $getServerVar[ServerCookies]

ex

Economy

Local vs Global

  • Local Economy - Changes per server. If a user has 10,000 coins in one server, in another server they would have a different amount. For example, Unbelievaboat has a local economy. (local economy uses user-variables)
  • Global Economy - Does not change per server. If a user has 10,000 coins in one server, in another server they would have the same amount. For example, Dank Memer has a global economy. (global economy uses global-user variables

Local Economy

  • Replace "Money" with your cash/money variable, if "Money" is the name of your money variable then you can just leave it as is!
  • Replace "Amount" with the amount of money you want to add/remove to/from the user. Like this: 100, $random[1;10], $random[100;1000], 10000.

Gets the user's current balance. If a user mention is provided, then the bot will return that user's balance:

$getUserVar[Money;$mentioned[1;yes]]

Adds money to the mentioned user:

$setUserVar[Money;$sum[Amount;$getVar[Money;$mentioned[1]]];$mentioned[1]]

Adds money to the user running the command:

$setUserVar[Money;$sum[Amount;$getVar[Money;$authorID]];$authorID]

Removes money to the mentioned user:

$setUserVar[Money;$sub[Amount;$getVar[Money;$mentioned[1]]];$mentioned[1]]

Removes money from the user running the command:

$setUserVar[Money;$sub[Amount;$getVar[Money;$authorID]];$authorID]

Leaderboard:

$userLeaderboard[Money;asc]

Global Economy

  • Replace "Money" with your cash/money variable, if "Money" is the name of your money variable then you can just leave it as is!
  • Replace "Amount" with the amount of money you want to add/remove to/from the user. Like this: 100, $random[1;10], $random[100;1000], 10000.

Gets the user's current balance/amount of money. If a user mention is provided then the bot will return that user's balance:

$getVar[Money;$mentioned[1;yes]]

Adds money to the mentioned user:

$setVar[Money;$sum[Amount;$getVar[Money;$mentioned[1]]];$mentioned[1]]

Adds money to the user running the command:

$setVar[Money;$sum[Amount;$getVar[Money;$authorID]];$authorID]

Removes money to the mentioned user:

$setVar[Money;$sub[Amount;$getVar[Money;$mentioned[1]]];$mentioned[1]]

Removes money from the user running the command:

$setVar[Money;$sub[Amount;$getVar[Money;$authorID]];$authorID]

Global leaderboard:

$globalUserLeaderboard[Money;asc]

Leaderboards

You can generate variable leaderboards, using the functions below. Click the hyperlinks for more information about these leaderboard functions.

Additional Tips

  • You can change the variables with a userID or with a mention of the user. Here's a example:
$setUserVar[Money;0;<@696368083517964288>]
$setUserVar[Money;0;696368083517964288]

$getUserVar[Money;<@696368083517964288>]
$getUserVar[Money;696368083517964288]

$setVar[Money;0;<@696368083517964288>]
$setVar[Money;0;696368083517964288]

$getVar[Money;696368083517964288]
$getVar[Money;696368083517964288]

$c[All of these would work fine!]

Webhooks

This wiki explains how to create and use webhooks in BDFD.

Creating A Webhook

$webhookCreate[channelID;username;avatarURL (can be left empty)]

Creates a webhook in the provided 'channelID', with the inputted 'username' and 'avatarURL' assests. This function returns the URL of the newly created webhook (webhook URLs should be kept private, treat them like a password).

Note: Only ten webhooks can be created per channel.

Editing A Webhook

$webhookAvatarURL[webhookURL;avatarURL]

Changes the provided webhook's avatar.

$webhookUsername[webhookURL;username]

Changes the provided webhook's username.

Webhook Messages

You can send messages via a webhook using the following functions:

  • $webhookTitle[webhookURL;text] - Adds a title to the webhook embed.
  • $webhookDescription[webhookURL;text] - Adds a description to the webhook embed.
  • $webhookFooter[webhookURL;text] - Adds a footer to the webhook embed.
  • $webhookContent[webhookURL;text] - The webhook non-embedded message content.
  • $webhookColor[webhookURL;colorHex] - The color of the webhook embed.

Alternatively, you can use $webhookSend[] for more options and condensement:

$webhookSend[webhookURL;content;title;titleURL;description;color;author;authorIcon;footer;footerIcon;thumbnail;image;addTimestamp (yes/no)]

Note: Uneeded fields can be left empty.

Deleting A Webhook

$webhookDelete[webhookURL]

Deletes the provided webhook.

Example

$nomention
$var[webhookURL;$webhookCreate[$channelID;Cool Webhook;]]
$webhookContent[$var[webhookURL];Hello World!]
$c[❗️This example requires BDScript 2 enabled❗️]

Explaination:

This code is storing the newly created webhook URL returned from $webhookCreate[] (using $var[]). Then, in the rest of the code $var[webhookURL] was called to get the webhook URL, which allowed the webhook message to send using $webhookContent[].

πŸ§™β€β™‚οΈ Remember, you need to be in BDScript 2 mode to use $var[]!

Output:

example

BDFD's Creation

How Bot Designer For Discord became what it is today.

Who Develops BDFD?

NameDiscord TagPosition
Jakub Tomanawiadr000#1947 (kubastick)Owner/Developer
MikoΕ‚aj Radkowskinoituri#2489Developer/DevOp
BartΕ‚omiej SkoczeΕ„MineBartekSA#4899Developer/DevOp

The Company

NilPointer Software is the parent company of Bot Designer For Discord. NilPointer Software a start-up focused on providing fast and quality software.

BDFD's Beginning and Growth

Kubastick was inspired by one of his friends to create the application. One day, his friend stated, "It would be nice if there'd be an app for creating bots". Kubastick having previous programming knowledge, took this idea and ran with it. By early 2019, the premature version of BDFD was created. Later on, Kubastick acquired two talented Developers, MineBartekSA and noituri. This is when the app's functions and UI got majorly improved. BDFD was slowly growing, until Discord's explosion during the COVID-19 pandemic, which caused a uproar of users coming to BDFD to create their very own bots... and the rest is history... The growth of BDFD isn't stopping though, as the developers are actively integrating new features; and the community is growing larger by the day.

πŸ§™β€β™‚οΈ Have more questions? Ask in our community server.

Avoiding Currency Inflation

BDFD's Creation

How Bot Designer For Discord became what it is today.

Who Develops BDFD?

NameDiscord TagPosition
Jakub Tomanawiadr000#1947 (kubastick)Owner/Developer
MikoΕ‚aj Radkowskinoituri#2489Developer/DevOp
BartΕ‚omiej SkoczeΕ„MineBartekSA#4899Developer/DevOp

The Company

NilPointer Software is the parent company of Bot Designer For Discord. NilPointer Software a start-up focused on providing fast and quality software.

BDFD's Beginning and Growth

Kubastick was inspired by one of his friends to create the application. One day, his friend stated, "It would be nice if there'd be an app for creating bots". Kubastick having previous programming knowledge, took this idea and ran with it. By early 2019, the premature version of BDFD was created. Later on, Kubastick acquired two talented Developers, MineBartekSA and noituri. This is when the app's functions and UI got majorly improved. BDFD was slowly growing, until Discord's explosion during the COVID-19 pandemic, which caused a uproar of users coming to BDFD to create their very own bots... and the rest is history... The growth of BDFD isn't stopping though, as the developers are actively integrating new features; and the community is growing larger by the day.

πŸ§™β€β™‚οΈ Have more questions? Ask in our community server.

Discord's ID System

Discord's ID System allows bot's to manage and use IDs to get/edit object data (e.g. returning user's name, deleting a role, etc).

What's A ID?

A ID is a Discord object identifier. Let's break this down:

  • A 'object' refers to a Discord channel, role, user, server/guild, etc.
  • A 'identifier' (typically called 'ID') refers to the multi-digit number that the object belongs to.

Enabling Developer Mode

In order to access and copy IDs in the Discord client, you must enable developer mode. Here's how:

Desktop

ex1

ex2

ex3

Mobile

For Android users, go to User Settings > App Settings > Behavior and turn on Developer Mode. For iOS you’ll head to User Settings > Appearance > Advanced and turn on Developer Mode.

ex4

Finding IDs

Where do I find these 'IDs'?

You can use 'Functions That Return IDs' to retrieve IDs.

If you want to get IDs using your client, check out Discord's full guide on getting IDs!

Using IDs in Commands

There are alot of functions that use IDs. Like, $deleteChannels, $modifyRole $banID, and many more.

Let's use $deleteChannels for this example. In order to delete a channel, we need the channel's ID. Here's how $deleteChannels could look:

$deleteChannels[320949943877437847]
$c[Deletes the provided custom channel ID.]

$deleteChannels[$channelID]
$c[Deletes the channel where the command was ran.]

$deleteChannels[$mentionedChannels[1]]
$c[Deletes the mentioned channel.]

πŸ§™β€β™‚οΈ Be careful not to mix up ID types. For example, you can't do $deleteChannels[$authorID]. This is because $authorID returns a user ID, not a channel ID.

Functions That Return IDs

  • $authorID/$userID/$roleID/$channelID
  • $findUser/$findChannel/$findRole
  • $mentioned/$mentionedChannels/$mentionedRoles
  • ... (a few others)

Using IDs For Mentions

  • Mentioning a User - <@userID>
  • Mentioning a Role - <@&roleID>
  • Mentioning a Channel - <#channelID>
  • Using a Emoji - <:emojiName:emojiID>
  • Mentioning a Guild - Guilds can't be mentioned.

πŸ§™β€β™‚οΈ Non-bots can use IDs to mention objects too!

Embed Indexes

Discord now allows 10 embeds per bot message. There is a embedIndex field in embed functions, for this purpose.

By default, the embedIndex is set to 1 (the first embed). You can provide any number between 1 and 10 in embedIndex fields.

Example

$nomention
$title[Title #1]
$description[Description #1]

$title[Title #2;2]
$description[Description #2;2]

$title[Title #3;3]
$description[Description #3;3]

example

2FA and Elevated Permissions

ex

If a guild owner enables the server's "two-factor authentication for moderation" setting, everyone executing a certain segment of actions will need to have two-factor authentication (2FA) enabled on their account. Since bots do not have 2FA themselves, you as the bot owner, will need to enable it on your account.
The permissions assigned to these actions are referred to as "elevated permissions". Elevated permissions include but may not limited to: ADMINISTRATOR, KICK_MEMBERS, BAN_MEMBERS, MANAGE_CHANNELS, MANAGE_GUILD, MANAGE_WEBHOOKS, MANAGE_MESSAGES, MANAGE_ROLES, and MANAGE_EMOJIS.

More info about enabling 2FA can be found in Discord's support article.

Permissions

This is a list of all permissions supported in BDFD.

  • addreactions
  • admin
  • attachfiles
  • ban
  • changenicknames
  • createinstantinvite
  • embedlinks
  • externalemojis
  • kick
  • managechannels
  • manageemojis
  • managemessages
  • managenicknames
  • manageroles
  • manageserver
  • managewebhooks
  • mentioneveryone
  • readmessagehistory
  • readmessages
  • sendmessages
  • tts

Security

Security is an important topic to discuss. If security measures are disregarded, your bot and/or account could be at risk of being hacked. This article will share tips about how you can keep your bot and account safe.

Sharing Tokens

Do not share token(s) with anyone. This includes both bot and regular user account tokens. Sharing your bot token with someone (or posting it publicly) grants them full-unlimited access to your editing bot. Sharing your user account token with someone (or posting it publicly) allows them to have full access to your account (even if they don't have your password or email). Once someone has your account or bot's token, there is a high chance of it being used for malicious purposes. For example, stealing personal info, spreading scams, modifying your bot to nuke/raid servers. The only thing you can do is regenerate your bot's token, but likely, the damage has already been done when you regenerate the token. You can't regenerate user account tokens, in such case you need to; you must contact Discord support for an optimal solution. So please, do not risk sharing your token(s) with anyone. The same applies to your account password, in such case you expose your account password; you should change it in user settings as soon as possible.
If your account is hacked, you should contact Discord for further assistance.

Account 2FA

Bot owners should consider enabling two-factor authentication on their accounts. Learn more about 2FA and why it's essential for bot owners.

Avoid Scams and Untrusted Links/Files

Scam (or "phishing") links put user’s accounts, personal information, and IP addresses in the hands of scammers and hackers. There's some good news, these scams are preventable! This section will discuss how to protect yourself and your friends from harmful scams.

  • Trusted Links are links that can be trusted to visit.
  • Untrusted Links are links that should be avoided.

This sub-section will breakdown how you identify trusted and untrusted links.

Does the link have a weird spelling?
If a link looks shortened or altered, that usually means it's an untrusted link. For example, discord.com is the official Discord site; while something like dlscird.com is not.

Is it out of context?
If a user sends you a link that is out of context of your previous discussions (or if you've never talked to them) then you can bet on it being untrustworthy.

Was the link sent by a friend?
At first glimpse, you'd assume this makes the link more trustworthy. But, it could be that their account has been compromised, so still, be careful when clicking links from friends.

Too good to be true?
Free Nitro scams are extremely common. If you get a DM from a random user/bot telling you that you won something or can earn Nitro, just disregard it.

Asking for your password/user token?
If a site is asking for your Discord account informationβ€”don't input it. You should only share your Discord password via Discord's official login page. Discord will never ask for your user token.

System Messages

If a message is official by Discord, there will be a 'system' badge next to the system user's name, like:
image

The following is a list of all official Discord links that are operated by Discord themselves. discordapp.com, discordapp.net, discord.com, discord.dev, discord.new, discord.gift, discord.gifts, discord.media, discord.gg, discord.co, discord.app, dis.gd, watchanimeattheoffice.com

Common Scams

ex1
This scam is using a phishing "steam community" URL, to potentially steal your account details.

ex2
Inviting the bot will cause your server members to be mass DMed, with the same/similar message you got. Also, Nitro Generators break Discord ToS.

ex3
"I reported your steam account on an accident" scam.

Files

Files are like links, treat them with the same care. Avoid downloading non-image/text files. And, don't fall for these types of scams:
image

Maintain a Safe Account

Keep in mind, if your account gets hacked; said hacker will have access to all your bots and their tokens. For more info about setting up a secure account, read Discord's Support Article.

Summary

Never share your account token or password with anyone, the same stands for your bot token(s). Do not visit untrusted sites or download untrusted files. Keep your account safe, as if your account gets hacked; then your bot(s) could be hacked as well. Thank you for reading this article, hopefully, you found these tips helpful.

Functions introduction

In this section of wiki you will learn about some of the useful functions.
Functions (as the name itself says) add extra functionality to your commands.
They are heart and soul of your bot. Remember that functions start with $.
For example $nomention or $ping.

Functions introduction

In this section of wiki you will learn about some of the useful functions.
Functions (as the name itself says) add extra functionality to your commands.
They are heart and soul of your bot. Remember that functions start with $.
For example $nomention or $ping.

$addCmdReactions

Adds reactions to the message that triggered the command.

Usage

$addCmdReactions[emojis]

πŸ§™β€β™‚οΈ You can use unicode emojis or emoji IDs, not emoji names. For emoji IDs: The bot must be present in the server, that you are using the emoji from.

Breakdown

  • emojis - The emoji(s) the bot reacts with. Separate emojis using ;.

Unicode Emojis

Do not use emoji names: $addCmdReactions[:smile:]

Use the unicode version: $addCmdReactions[πŸ˜€]

List of unicode emojis: https://getemoji.com

Emoji IDs

  1. Type \:TheEmojiName:
  2. Send the message.
  3. Copy the ID it returns. (The emoji ID should be in this format: <:emojiName:ID>. If the emoji is animated, it should look like this: <a:emojiName:ID>)
  4. Input the emoji ID into $addCmdReactions[]. (e.g $addCmdReactions[<:hollyDab:828628880629825546>])

πŸ§™β€β™‚οΈ Note: If \:TheEmojiName: doesn't work, try :-:TheEmojiName:. Both methods require Developer Mode enabled!

$addEmoji

Adds a emoji to the server.

Usage

$addEmoji[name;imageURL;returnEmoji (yes/no)]

Breakdown

  • name - The name of the new emoji.
  • imageURL - The image that the emoji showcases. This needs to be a valid image URL.
  • returnEmoji - Whether to show the emoji in the bot's message or not.

Example

$nomention
Added new emoji: $addEmoji[$replaceText[$message;$message[1];;1];$message[1];yes]
$argsCheck[>2;Provide all needed arguments! Usage: `!add-emoji (imageURL) (emojiName)`]

πŸ§™β€β™‚οΈ This may require BDScript Unstable mode enabled.

$addField

Adds a field to the embed.

Usage

$addField[name;value;(optional) inline (yes/no)]

Breakdown

  • name - The name of the field.
  • value - The value of the field.
  • inline - If 'yes', fields will appear in same line. However, if you have more than 3 fields (or the fields are just too long) with inline enabled, the bot will return rows with 3 fields (2 if there is a thumbnail) in each row. 'no' by default. Optional.

πŸ§™β€β™‚οΈ Inline fields may not appear inline on some mobile devices.

Examples

Example #1

(without inline fields)

$nomention
$addField[This is the field name! #1;This is the field value! #1]
$addField[This is the field name! #2;This is the field value! #2]
$addField[This is the field name! #3;This is the field value! #3]

example1

Example #2

(with inline fields)

$nomention
$addField[This is the field name! #1;This is the field value! #1;yes]
$addField[This is the field name! #2;This is the field value! #2;yes]
$addField[This is the field name! #3;This is the field value! #3;yes]

example2

$addReactions

Adds reactions to the bot's response.

Usage

$addReactions[emojis]

πŸ§™β€β™‚οΈ You can use unicode emojis or emoji IDs, not emoji names. For emoji IDs: The bot must be present in the server, that you are using the emoji from.

Breakdown

  • emojis - The emoji(s) the bot reacts with. Separate emojis using ;.

Unicode Emojis

Do not use emoji names: $addReactions[:smile:]

Use the unicode version: $addReactions[πŸ˜€]

List of unicode emojis: https://getemoji.com

Emoji IDs

  1. Type \:TheEmojiName:
  2. Send the message.
  3. Copy the ID it returns. (The emoji ID should be in this format: <:emojiName:ID>. If the emoji is animated, it should look like this: <a:emojiName:ID>)
  4. Input the emoji ID into $addReactions[]. (e.g $addReactions[<:hollyDab:828628880629825546>])

πŸ§™β€β™‚οΈ Note: If \:TheEmojiName: doesn't work, try :-:TheEmojiName:. This requires Developer Mode enabled!

$addTimestamp

Adds a timestamp to the embed.

Usage

$addTimestamp[(optional) embedIndex]

Breakdown

  • embedIndex - What embed the timestamp should belong to. Default is 1. (learn more)

Example

$description[Hi!]
$footer[That is the timestamp =>]
$addTimestamp

example

$allMembersCount

Returns the total number of users from every server the bot is in.

Usage

$allMembersCount

Example

$nomention
I'm serving $allMembersCount users!

example

$allowMention

Disables replacing mentions in $message with text.

Usage

$allowMention

Example

$nomention
$allowMention
$message

Comparison

This comparison shows a "say" command with and without $allowMention.

With $allowMention

example1

Without $allowMention

example2

$allowRoleMentions

Disables the pings for the roles not provided, which means the role will be 'fake pinged' (the role will be pinged, but users will not get notified of the ping). While, the inputted allowed roles are ones that can be pinged (and it will work like a regular ping).

Usage

$allowRoleMentions[roleIDs]

Breakdown

  • roleIDs - The roles that can be pinged, leave empty to disable pings for every role. Separate role IDs using ;.

Example

$nomention
$allowRoleMentions[]
I'm pinging <@&858376972303204362>, but no one got notified; wow!

example

$allowUserMentions

Disables the pings for the users not provided, which means the user will be 'fake pinged' (the user will be pinged, but the user will not get notified of the ping). While, the inputted allowed users are ones that can be pinged (and it will work like a regular ping).

Usage

$allowUserMentions[userIDs]

Breakdown

  • userIDs - The users that can be pinged, leave empty to disable pings for every user. Separate user IDs using ;.

Example

$nomention
$allowUserMentions[]
Hi <@696368083517964288>! I mentioned you, but you didn't get pinged.

$and

Returns 'true' if every provided condition is true, otherwise 'false' is returned.

Usage

$and[condition1;condition2;etc]

Example

$nomention
$if[$and[$username==noituri;$message==update]==true]
Noit said "Update"!
$endif
$c[The code in the if statement only executes if the user's username is 'noituri', and the message content is 'update'.]

$argCount

Returns how many words (aka arguments/args) are in the provided text.

Usage

$argCount[text]

Breakdown

  • text - The text to get word count from.

Example

$argCount[$message]

πŸ§™β€β™‚οΈ Returns the word count of the user's message.

$argsCheck

When this function is used, the command can only be executed if the user’s message contains a certain amount of arguments (words).

Usage

$argsCheck[how-many;error message]

Breakdown

  • how-many - How many arguments there should be in the user’s message.

πŸ§™β€β™‚οΈ For example, if you want users to have 3 or more arguments in their message; you can use >3. If you want users to have less than 3 arguments in their message, you can use <3. If you want the users to have exactly 3 arguments in their message put 3.

  • error message - The message that the bot will send if the user has too many/little arguments.

Example

$argsCheck[>1;❌ Please provide something for me to say!]
$noMentionMessage

πŸ§™β€β™‚οΈ This example, a !say command; only allows users to run the command if they provided 1 or more argument in their message. If they don't provide any arguments the bot returns β€œβŒ Please provide something for me to say!”.

$author

Adds author text to the embed.

Usage

$author[text;(optional) embedIndex]

Breakdown

  • text - The text that appears in the author text.
  • embedIndex - What embed the author text should belong to. Default is 1. (learn more)

Example

$nomention
$author[This is the author text!]

example

$authorAvatar

Returns the author's avatar URL.

Usage

$authorAvatar

Examples

Example #1

$image[$authorAvatar]

example1

Example #2

πŸ§™β€β™‚οΈ You can use ?size=size at the end of the avatar URL to decrease/increase the image size. Example sizes: 1024, 2048, 4096.

$image[$authorAvatar?size=4096]

example2

$authorIcon

Adds a icon to the author section in the embed.

πŸ§™β€β™‚οΈ $authorIcon can't work without author text ($author).

Usage

$authorIcon[imageURL;(optional) embedIndex]

Breakdown

  • imageURL - The image that appears in the author icon. This must be a valid image URL.
  • embedIndex - What embed the author icon should belong to. Default is 1. (learn more)

Example

$nomention
$authorIcon[$authorAvatar]
$author[⬅️ That is the author icon. This is the author text.]

example

$authorID

Returns message's author ID.

Usage

$authorID

Example

$nomention
This command was written by <@$authorID>!

Explanation

Discord uses this format: <@USER_ID> to mention user. For example, let's say that $authorID is equal to 246604909451935745. If we use this: <@$authorID>, it will be replaced with <@246604909451935745> and discord will interpret this as a mention (@Noituri).

$authorOfMessage

Returns the ID of the provided message's author.

Usage

$authorOfMessage[channelID;messageID]

Breakdown

  • channelID - The channel where the message was sent.
  • messageID - The message that the bot returns the author ID for.

πŸ§™β€β™‚οΈ Where do I find message/channel IDs? (click-me)

$authorURL

Adds a hyperlink to the author text.

Usage

$authorURL[link]

πŸ§™β€β™‚οΈ $authorURL cannot work without $author.

Breakdown

  • link - The link to set as the author hyperlink.

Example

$nomention
$author[Click me to visit the BDFD website!]
$authorURL[https://botdesignerdiscord.com]

example

(tap on the text to visit the URL)

$ban

Bans the mentioned user. Both the bot and user running the command need the 'ban' permission.

Usage

$ban[(optional) reason]

Breakdown

  • reason - The reason for this action, which will be sent to the audit-log. Optional.

Examples

Example #1

(without optional fields)

$nomention
$ban
<@$mentioned[1]> was banned!

image

Example #2

(with optional fields)

$nomention
$ban[$noMentionMessage]
<@$mentioned[1]> was banned!

image

$banID

Bans a user using their ID.

Usages

There are three usages of the $banID function.

Usage #1

$banID

Gets the user to ban from the author's message. No reason will be provided in audit logs for the ban.

Usage #2

$banID[reason]

Gets the user to ban from the author's message. The 'reason' will show in audit logs.

Usage #3

(recommended)

$banID[reason;userID]

Gets the user to ban from the 'userID' field. The 'reason' will show up in audit logs. You can also leave the 'reason' field empty to provide no reason.

Example

$nomention
$argsCheck[>1;Please provide a 'user'. Usage: `!ban (user) <reason>`]
$onlyIf[$findUser[$message[1];no]!=;Failed to find user!]
$onlyPerms[ban;You need the 'ban' permission to use that command!]
$banID[$replaceText[$message;$message[1];;1];$findUser[$message[1];no]]
<@$findUser[$message[1];no]> was banned!

πŸ§™β€β™‚οΈ The code above accepts both IDs or mentions to ban a user!

example

$blackListIDs

Blocks certain users from using the command.

Usage

$blackListIDs[userIDs;errorMessage]

Breakdown

  • userIDs - The users to blacklist from using the command. Separate userIDs with ;.

πŸ§™β€β™‚οΈ Please provide real userID(s). Click-me for more info!

  • errorMessage - The message that appears when the user running the command is blacklisted.

Example

$nomention
Pong! $ping ms
$blackListIDs[566613317972394004;246604909451935745;❌ You can't use this command!]

$blackListRoles

Blocks users with certain role(s) from using the command. If the user has any role in the blacklist, they will not be able to run the command. Uses role names instead of role IDs.

Usage

$blackListRoles[roleNames;errorMessage]

Breakdown

  • roleNames - The name(s) of the role(s) to blacklist. Separate role names using ;.
  • errorMessage - The message that appears when the user has a role in the blacklist.

$blackListRolesIDs

Block users with certain roles from using the command. If the user has any role in the blacklist, they will not be able to run the command.

Usage

$blackListRolesIDs[roleIDs;errorMessage]

Breakdown

  • roleIDs - The roles that will be blacklisted. Separate roleIDs using ;.
  • errorMessage - The message that sends if the user has a role in the blacklist.

Example

$nomention
$noMentionMessage
$blackListRolesIDs[730739881072132166;727999173600739398;❌ You aren't allowed to use this command!]

$blackListServers

Disables this command for the provided servers.

Usage

$blackListServers[serverIDs;errorMessage]

Breakdown

  • serverIDs - The servers to blacklist. Separate server IDs using ;.

πŸ§™β€β™‚οΈ Where do I find server IDs? (click-me)

  • errorMessage - The error to display when the server is blacklisted.

$blackListUsers

Disables the command for users with usernames matching the ones provided.

Usage

$blackListUsers[usernames;errorMessage]

Breakdown

  • usernames - The usernames to blacklist. Separate names using ;.
  • errorMessage - Message when user's name is in the blacklist.

$botCommands

Calculates a math expression.

Usage

$botCommands[separator]

Breakdown

  • separator - Will be used to separate each command.

Example

$nomention
$botCommands[πŸ”Ή]

image

$botID

Returns the bot's ID.

Usage

$botID

Example

$nomention
My ID is: $botID

example

$botLeave

Forces the bot to leave a server.

Usages

  • There are 2 usages for the $botLeave command.

Usage #1

$botLeave - Forces the bot to leave the server that the command is being ran in.

Usage #2

$botLeave[SERVER ID] - Makes the bot leave the server matching the server ID provided.

$botListDescription

Sets the description of this command, for the BDL command list (if the bot is on Bot Designer List).

Usage

$botListDescription[text]

Breakdown

  • text - The text that description is set to.

Example

$nomention
Pong!
$botListDescription[Ping? Pong!]

$botListHide

Hides this command from being shown on the BDL command list (if the bot is on Bot Designer List).

Usage

$botListHide

Example

This is a secret command! 🀫
$botListHide

$botNode

Returns the bot's node ID

Usage

$botNode

Example

$nomention
$botNode

πŸ§™πŸ»β€β™‚οΈ See list of Nodes and Status, Click here.

$botTyping

$botTyping tells Discord that the bot is typing. When you use a command with $botTyping in it, something like this:

image

should appear.

Usage

$botTyping

$c

Adds a comment to the code. Comments do not appear in the bot's response.

Usage

$c[comment]

Example

$nomention
$noMentionMessage
$c[This is a say command. You are reading a comment!]

example

$calculate

Calculates a math expression.

Usage

$calculate[expression]

Breakdown

  • expression - The math expression to solve.

Signs

  • + - Addition.
  • - - Subtraction.
  • / - Division.
  • * - Multiplication.
  • % - Modulo.
  • () - Parentheses you can put equations in.

Example

$nomention
$calculate[$message] 🧠

example

$changeCooldownTime

Changes the cooldown metrics for %time-d%, %time-h%, %time-m%, and %time-s%. These can be used in cooldown error messages, its useful for translating.

Usage

$changeCooldownTime[days;hours;minutes;seconds]

Breakdown

  • days - The text to replace 'Days' with.
  • hours - The text to replace 'Hours' with.
  • minutes - The text to replace 'Minutes' with.
  • seconds - The text to replace 'Seconds' with.

Example

Hi!
$changeCooldownTime[Days;Hours;Mins;Secs]
$cooldown[10m;Please wait %time-m%!]

$changeUsername

Changes the mentioned user's nickname.

Usage

$changeUsername[newNickname]

Breakdown

  • newNickname - The text to change the user's nickname to.

Example

$onlyPerms[managenicknames;Missing permission 'manage nicknames'!]
$argsCheck[>2;Wrong usage! Correct Usage: `!nickname (user) (text)`]
$changeUsername[$noMentionMessage]
Changed <@$mentioned[1]>'s nickname to `$noMentionMessage`.

example

$changeUsernameWithID

Changes a user's nickname using their ID.

Usage

$changeUsernameWithID[userID;newNickname]

Breakdown

  • userID - The ID of the user which is getting their nickname changed.
  • newNickname - The text to change the user's nickname to.

Example

$changeUsernameWithID[$authorID;$message]
$argsCheck[>1;Please provide text!]

πŸ§™β€β™‚οΈ This changes the author's nickname.

$channelCount

Returns the amount of channels in the current server.

Usage

$channelCount

Example

$nomention
There are $channelCount channels in this server!

image

$channelExists

Checks if the channel provided actually exists.

πŸ§™β€β™‚οΈ 'true' means the channel does exist, 'false' means it doesn't.

Usage

$channelExists[channelID]

Breakdown

  • channelID - The "channel" which the bot checks.

$channelID

Returns a channel's ID.

Usages

There are two usages of the $channelID function.

Usage #1

$channelID - Gets the ID of the current channel.

Usage #2

$channelID[channelName] - Gets the ID of the channel which matched 'channelName'.

$channelName

Returns a channel's name.

Usage

$channelName[channelID]

Breakdown

  • channelID - The channel that the bot gets the channel name from.

πŸ§™β€β™‚οΈ How do I find channel IDs? (click-me)

Example

$channelName[$channelID]

πŸ§™β€β™‚οΈ This example would return the name of the current channel.

$channelSendMessage

Sends a message in the provided channel.

Usage

$channelSendMessage[channelID;message]

Breakdown

  • channelID - The channel to send the message in.
  • message - The message that gets sent to the channel.

Example

$nomention
$channelSendMessage[835108724846493726;Hello!]

example1

example2

$channelTopic

Returns a channel's topic/description.

Usages

There are two usages of the $channelTopic function.

Usage #1

$channelTopic - Returns the topic of the channel that the command is being used in.

Usage #2

$channelTopic[channelID] - Returns the channel topic of the provided 'channelID'.

Example

$nomention
<#$channelID>'s channel topic is: $channelTopic

example

$channelType

Returns channel type

Usage

$channelType[channel ID]

Example

$nomention
$channelType[$channelID]

$charCount

Gets the amount of characters in the provided 'text'.

Usage

$charCount[text]

Breakdown

  • text - The text to return the character count for.

Example

$charCount[$message]

πŸ§™β€β™‚οΈ This example would return how many characters were in the author's message.

$checkCondition

Checks if a condition is true or false.

Usage

$checkCondition[condition]

Explanation

Simply put, $checkCondition serves as a way to make a custom true or false statement. For example: $checkCondition[$username==Spen], the bot would return "true" if someone named Spen used the command, otherwise it would return "false". However this: $checkCondition[$username!=Spen], would return "false" if someone named Spen used the command, otherwise it would return "true".

Base Usage: $checkCondition[value1(sign)value2]

What's Sign? Replace (sign) with one of these.

  • == - Should be equal
  • != - Should be not equal
  • <- Should be less than (only numbers)
  • >- Should be greater than (only numbers)
  • => - Should be greater than or equal to (only numbers)
  • <= - Should be less than or equal to (only numbers)

What Are Values?

The value is what the bot is checking. Like one of the examples above: $checkCondition[$username==Spen].

  • value1 is $username
  • sign is ==
  • value2 is Spen

$checkContains

Checks if the 'text' contains atleast one of the provided 'phrases'.

Usage

$checkContains[text;phrases]

Breakdown

  • text - The text that will be checked.
  • phrases - The phrases/words the bot will check for in 'text'. Separate phrases using ;.

Example

$nomention
$checkContains[$message;hi;hello]

example

$checkUserPerms

Returns 'true' if a user has all of the provided permissions, otherwise 'false' is returned.

Usage

$checkUserPerms[userID;permissions]

Breakdown

  • userID - The user that the bot checks the permissions for.
  • permissions - The permissions that the bot checks for. Separate permissions using ;.

Example

$nomention
You aren't a admin!
$onlyIf[$checkUserPerms[$authorID;admin]==false;You can't use this command, because you are administrator. F in the chat!] 

πŸ§™β€β™‚οΈ This example requires unstable mode enabled!

example

$clear

Deletes a certain amount of messages.

Usages

There are two usages of the $clear function.

Usage #1

$clear

πŸ§™β€β™‚οΈ When using just $clear, the author's message must include a number.

Usage #2

$clear[howMany;(optional) userID;(optional) removePinnedMessages (yes/no)]

Breakdown

  • howMany - How many messages to delete. (max 100)
  • userID - If a userID is provided, the bot will only delete messages from that user. Optional.
  • removePinnedMessages - Decides whether to delete pinned messages or not. Default is 'yes'. Optional.

Example

$nomention
$onlyPerms[managemessages;You need the 'MANAGE_MESSAGES' permission to use that!]
$argsCheck[>1;Please provide how many messages to clear. Usage: !purge (number)]
$clear[$message]

$clearReactions

Removes reactions from the provided message.

Usage

$clearReactions[channelID;messageID;emoji/!all]

Breakdown

  • channelID - The channel that the message belongs to.
  • messageID - The message to remove the reaction from.
  • emoji - The emoji to remove from the message. Use !all to clear all reactions.

$closeTicket

Deletes the ticket channel (has to be created with $newTicket).

Usage

$closeTicket[errorMessage]

Breakdown

  • errorMessage - The error to return if the channel isn't a ticket.

Example

$nomention
$closeTicket[That channel isn't a ticket!]

$color

Sets the embed border color.

Usage

$color[colorHex;(optional) embedIndex]

Breakdown

  • colorHex - The color hex to set the embed border color as.
  • embedIndex - What embed the color border should belong to. Default is 1. (learn more)

Example

$nomention
$description[⬅️ That is the embed color border!]
$color[#673ab7]

example

$colorRole

Changes the color of the mentioned role.

Usage

$colorRole[colorHex]

Breakdown

  • colorHex - The color hex to change the mentioned role color to.

Example

$onlyPerms[manageroles;You need the manage_roles permission to use that!]
$argsCheck[>2;Please provide the needed arguments! The `colorHex` and `role` arguments are needed.]
$colorRole[$noMentionMessage]
βœ… Changed role color!

$commandsCount

Returns how many commands the bot has total.

Usage

$commandsCount

Example

$nomention
I have $commandsCount commands!

example

$cooldown

Sets a cooldown. The user can not run the command again, until the 'duration' is up.

Usage

$cooldown[duration;errorMessage]

Breakdown

  • duration - The duration of this cooldown. (e.g 30s, 3m, 3h, 3d, etc)
  • errorMessage - The message that is returned when the cooldown duration is still ongoing. %time% and other related functions can be used here.

πŸ§™β€β™‚οΈ %time% returns how much time is left on the cooldown.

Example

$nomention
Hi!
$cooldown[30s;Please wait %time%, then use that command again!]

$createChannel

Creates a channel.

Usage

$createChannel[name;type;(optional) categoryID]

Breakdown

  • name - The name to give this channel.
  • type - The channel type. Channel types:
    • category
    • text
    • voice
  • categoryID - The category to put the channel in (if applicable).

Example

$nomention
$createChannel[cool-channel;text]

example1

example1.5

$createRole

Creates a new role.

Usage

$createRole[roleName;colorHex;hoist (yes/no);mentionable (yes/no)]

Breakdown

  • roleName - The name to give the new role.
  • colorHex - The color hex of the new role.
  • hoist - Whether the role should be displayed separately (hoisted) or not. no means the role won't be hoisted, yes means it will.

Example1

  • mentionable - Whether the role should be mentionable by everyone. no means the role won't be mentionable, yes means it will.

Example2

Example

$nomention
$createRole[Cool Role;#FFFF00;yes;no]
Created new role!

example1

example1.5

$creationDate

Gets the creation date of a user, channel, role, etc.

πŸ§™β€β™‚οΈ Date Format of $creationDate is yyyy-mm-dd.

Usage

$creationDate[ID]

Breakdown

  • ID - The channelID/userID/roleID/messageID/serverID to get the creation date for.

Example

$username[$mentioned[1;yes]]'s Creation Date: $creationDate[$mentioned[1;yes]]

example

$cropText

Crops the provided text. If text is cropped then the ending is added at the end of the text.

Usage

$cropText[text;maxCharacters;ending]

Breakdown

  • text - The text to crop.
  • maxCharacters - The maxmium amount of characters, subsequent characters are removed.
  • ending - The text to end the cropped-text with (if the text was cropped).

Example

$nomention
$cropText[$noMentionMessage;100;...]

Example

$customEmoji

Returns a custom emoji.

πŸ§™β€β™‚οΈ Note: We recommend emoji IDs instead of $customEmoji for public bots.

Usage

$customEmoji[emojiName]

Breakdown

  • emojiName - The name of the emoji to return.

Example

$nomention
Hello there! $customEmoji[Wave]

Example

$customID

Can only be used with the $onInteraction (without brackets) callback. Returns the custom ID of this interaction.

Example

!buttons code:

$nomention
Pick a button!
$addButton[no;button1-$authorID;Button #1;primary;no;]
$addButton[no;button2-$authorID;Button #2;primary;no;]

You may remove -$authorID from $addButton[] to allow all users to use the interaction, rather than just the author.

$onInteraction code:

$nomention
$if[$customID==button1-$authorID]
You picked button #1!
$editButton[$customID;Button #1;success;yes;]
$editButton[button2-$authorID;Button #2;danger;yes;]
$endif

$if[$customID==button2-$authorID]
You picked button #2!
$editButton[button1-$authorID;Button #1;danger;yes;]
$editButton[$customID;Button #2;success;yes;]
$endif

You may remove -$authorID from the $if[] statement to allow all users to use the interaction, rather than just the author.

Result

Before pressing a button:

After pressing a button:

$date

Returns the current date.

πŸ§™β€β™‚οΈ You can use $time to change the timezone.

Usage

$date

Example

$nomention
Today's Date: $date

Example

$day

Returns the current day of the month.

πŸ§™β€β™‚οΈ You can use $time to change the timezone.

Usage

$day

Example

$nomention
Today Is: $day

Example

$defer

Defers the interaction (components/slash commands).

Usage

$defer

$deleteChannels

Deletes the provided channel(s).

Usage

$deleteChannels[channelIDs]

Breakdown

  • channels - The channels to delete. Separate channel IDs using ;.

Example

$nomention
$deleteChannels[$mentionedChannels[1]]
Successfully deleted $channelName[$mentionedChannels[1]]!
$onlyPerms[managechannels;You need the manage channels permission to use that!]
$argsCheck[>1;Please mention a channel!]

Example

$deleteChannelsByName

Deletes all channels matching the names provided.

Usage

$deleteChannelsByName[names]

Breakdown

  • names - The name(s) of the channel(s) to delete. Use ; to separate channel names.

$deletecommand

Deletes the author's message.

πŸ§™β€β™‚οΈ The bot must have the manage_messages permission.

Usage

$deletecommand

$deleteIn

Deletes the bot's response in after the provided duration.

Usage

$deleteIn[duration]

Breakdown

  • duration - The time to wait before deleting the message (e.g 3s, 30s, 1m, etc). Max duration is 40m.

Example

$nomention
Hello World!
$deleteIn[3s]

$deleteMessage

Deletes a message

Usage

$deleteMessage[channel ID;message ID]

Example

$nomention
$var[getPing;$sendMessage[Please Wait...;yes]]
$deleteMessage[$channelID;$var[getPing]]
$description[$ping ms]

$deleteRole

Deletes a role.

Usage

$deleteRole[roleID]

Breakdown

  • roleID - The role to delete.

Example

$nomention
$onlyPerms[manageroles;You are missing permissions!]
$argsCheck[>1;Please provide a role to delete!]
$onlyIf[$findRole[$message]!=;Invalid role!]
$deleteRole[$findRole[$message]]
Deleted role!

example1

example2

$description

Adds a description to the embed.

Usage

$description[text;(optional) embedIndex]

Breakdown

  • text - The text to set the description as.
  • embedIndex - What embed the description should belong to. Default is 1. (learn more)

Example

$nomention
$description[This is a description! 😎]

example

$disableSpecialEscaping

(for advanced users)

Disables escaping for ; and $ (e.g. %{-SEMICOL-}% gets interpeted as a regular ;).

Usage

$disableSpecialEscaping

Example

$nomention
$disableSpecialEscaping 
%{DOL}%replaceText[Hello World!%{-SEMICOL-}%World%{-SEMICOL-}%Planet%{-SEMICOL-}%1]

example

$discriminator

Returns a user's discriminator (the 4 digit number at the end of their username).

Usages

There are two usages of the $discriminator function.

Usage #1

$discriminator[userID]

Breakdown

  • userID - The user to get the discriminator from.

Usage #2

$discriminator[]

Returns the author's discriminator.

Example

$nomention
Hello $username#$discriminator[]!

example

$divide

Divides the provided numbers.

Usage

$divide[numbers]

Breakdown

  • numbers - The numbers to divide. Separate numbers using ;.

Example

$nomention
$argsCheck[>2;❌ Please provide the needed arguments! Usage: `!divide (number1) (number2)`]
Answer: $divide[$message[1];$message[2]]

example

$dm

Direct messages a user.

Usages

There are three possible usages of the $dm function.

Usage #1

$dm

This will send the message to the user that runs the command.

Usage #2

$dm[]

This will send the message to the first mentioned user.

Usage #3

$dm[UserID;...]

This will send the message to every user with given User ID.

Note

If the command fails to send the message, make sure the user allows dm messages from everyone.

$editEmbedIn

Edits the bot's message after the given time, as a embed.

Usage

$editEmbedIn[time;title;description;footer;color]

πŸ§™β€β™‚οΈ Optional fields can be left empty. Atleast one embed field (title, description, or footer) needs to be inputted (excluding color, which is always needed).

Breakdown

  • time - The time to wait before editing the message (e.g 3s, 30s, 10m). Max is 40m. Required.
  • title - The new embed title. Optional.
  • description - The new embed description. Optional.
  • footer - The new embed footer. Optional.
  • color - The embed border color, must be a valid color hex. Required (use 0 for default color).

Example

$nomention
$title[Cool Title]
$description[This is a cool embed to edit!]
$color[#6A96FC]
$editEmbedIn[5s;Epic Title;This is the edited description!;;#E46AFC]

Output

Before

example1

After

example2

$editIn

Edits the bot's response after the given time.

Usage

$editIn[time;newMessage]

Breakdown

  • time - The time to wait before editing the message (e.g 3s, 30s, 10m). Max is 40m.
  • newMessage - The text that appears when this message is edited.

Example

$nomention
This is a nice message to edit!
$editIn[5s;This is the edited message!]

Output

Before

example1

After

example2

$editMessage

Edits one of the bot's messages.

Usage

$editMessage[channelID;messageID;newMessage;(optional) title;(optional) description;(optional) color;(optional) footer]

πŸ§™β€β™‚οΈ How Do I Get The Channel / Message ID? (click-me)

Breakdown

  • channelID - The channel that this message belongs to.
  • messageID - The ID of the message to edit (must be a message that the bot sent).
  • newMessage - The new message contents.
  • title - The new embed title. Optional.
  • description - The new embed description. Optional.
  • color - The new embed color border hex. Optional.
  • footer - The new embed footer text. Optional.

Example

$nomention
$editMessage[853070225398693898;857040509549281292;This message has been edited!]

Output

Before

example1

After

example2

$editThread

Modifies a existing thread.

Usage

$editThread[threadID;name;archived (yes/no);archiveDuration (60/1440/4320/10080);locked (yes/no);slowmode (in seconds)]

Breakdown

  • threadID - The thread channel to edit.
  • name - The new name of the thread.
  • archived - Whether to archive this thread or not.
  • archiveDuration - The archive duration of this thread in minutes. Only 60, 1440,4320, 10080 can be used. Note that for the 4320 archive duration option, the server needs to be level 1 boosted, and for 10080 the server needs level 2.
  • locked - Whether to lock this thread or not. Note that archived threads can't be locked.
  • slowmode - The slowmode of this channel, expressed in seconds.

$embeddedURL

Sets the title hyperlink (clickable text). >πŸ§™β€β™‚οΈ Only works if $title is also used.

Usage

$embeddedURL[link;(optional) embedIndex]

Breakdown

  • link - The link to set the title hyperlink to.
  • embedIndex - What embed the title hyperlink should belong to. Default is 1. (learn more)

Example

$nomention
$title[Bot Designer For Discord]
$embeddedURL[https://botdesignerdiscord.com]
$description[Hello World!]
$color[#683cb4]

example

$embedSuppressErrors

Suppresses the error messages, responds with the embed if there is a error.

Usage

$embedSuppressErrors[title;description;color;author;footerText;footerIcon]

πŸ§™β€β™‚οΈ All fields are optional, leave the field empty to not include it. Atleast one field needs to be inputted, however.

$embedSuppressErrors[Error!;There was a error!;;;;] - this is correct. $embedSuppressErrors[Error!;There was a error!] - this is incorrect.

Breakdown

  • title - The title of the embed.
  • description - The embed description.
  • color - The embed border color, must be a valid color hex.
  • author - The embed author text.
  • footerText - The embed footer text.
  • footerIcon - The embed footer icon, must be a valid image URL.

$emoteCount

Returns the number of emojis in the current server.

Usage

$emoteCount

Example

$nomention
There are $emoteCount emojis in $serverName[$guildID]!

example

$enabled

Allows you to enable/disable commands.

Usage

$enabled[enabled (yes/no);errorMessage]

Breakdown

  • enabled - 'yes' means the command is enabled, 'no' means it's disabled.
  • errorMessage - The message that is returned if the command is disabled.

Example

This section will explain how to disable/enable certain commands using server variables.

1: Create a variable named enabled and set the value to yes or no (whatever you want the default option to be. no - disabled, yes - enabled.)

example

2: Create a command for the enable command. Put this in the reply text/code section:

$setServerVar[enabled;yes]
I successfully enabled the __ command!
$onlyAdmin[❌ Only admins can enable commands!]

3: Create a command for the disable code. Put this in the reply text/code section:

$setServerVar[enabled;no]
I successfully disabled __ command!
$onlyAdmin[❌ Only admins can disable commands!]

4: In the command(s) you want the enable/disable to affect, put:

$enabled[$getServerVar[enabled];❌ This command is disabled!]

5: Now your bot has a system where servers can disable/enable command(s).

⚠️ In order to make this changeable for multiple commands, you'll need to do it multiple times (using different variable names). As this only affects the commands you put the "affect" code in.

$enableDecimals

Enables/disables decimals in math functions.

Usage

$enableDecimals[enable (yes/no)]

Breakdown

  • enable - Whether to enable decimals in math functions or not.

Explaination

By default, decimals in math functions (e.g $sum, $sub, $multi, etc) are disabled. The only use for this function is to enable decimals, if you want decimals enabled for math functions in that command.

Enabling decimals:

$enableDecimals[yes]

πŸ§™β€β™‚οΈ $calculate ignores $enableDecimals.

$ephemeral

Makes the bot's response ephemeral.

πŸ§™β€β™‚οΈ What are ephemeral responses? (click-me)

Usage

$ephemeral

⚠️ Ephemeral responses are only supported for slash commands currently!

Example

Example2

Example1

$executionTime

Returns how long the command took to execute, in milliseconds.

Usage

$executionTime

$findChannel

Finds a channel's ID from the given channel name, ID, or mention.

Usage

$findChannel[channel]

Breakdown

  • channel - The channel name/ID/mention to find.

Example

$nomention
$findChannel[$message]

example

$findRole

Finds a role's ID using the given role name, ID, or mention.

Usage

$findRole[role]

Breakdown

  • role - The role name, ID, or mention to find.

Example

$nomention
$findRole[$message]

example

$findUser

Finds a user's ID using username, ID, or mention.

Usage

$findUser[user;(optional) returnAuthorID (yes/no)]

Breakdown

  • user - The user's username, ID, or mention to find.
  • returnAuthorID - Whether to return the author ID if no user was found. Default is yes. Optional.

Example

$nomention
$findUser[$message]

example

$footer

Sets the embed footer text.

Usage

$footer[text;(optional) embedIndex]

Breakdown

  • text - The text to set the footer as.
  • embedIndex - What embed the footer text should belong to. Default is 1. (learn more)

Example

$nomention
$footer[Hi! I'm a footer.]

example

$footerIcon

Sets the embed footer icon.

πŸ§™β€β™‚οΈ There must be footer text in order to set the footer icon.

Usage

$footerIcon[imageURL;(optional) embedIndex]

Breakdown

  • imageURL - The URL to set the footer icon as. Must be a valid image URL.
  • embedIndex - What embed the footer icon should belong to. Default is 1. (learn more)

Example

$nomention
$footer[⬅️ That is a footer icon!]
$footerIcon[$authorAvatar]

example

$getBotInvite

Returns the bot's invite URL.

Usage

$getBotInvite

Example

$nomention
Invite Me! $getBotInvite

example

$getCooldown

Returns how long is left on the cooldown, in seconds; can be used in the 'errorMessage' field of cooldown functions.

Usage

$getCooldown[cooldownType (normal/server/global)]

Breakdown

  • cooldownType - The cooldown type (normal - $cooldown | server - $serverCooldown | global - $globalCooldown).

Example

$nomention
$cooldown[1h;You're on cooldown! (<t:$sum[$getTimestamp;$getCooldown[type]]>)]
Hello World!
$c[This example should be used in BDScript 2 only.]

$getEmbedData

Fetches embed data from the provided message.

Usage

$getEmbedData[channelID;messageID;embedIndex;embedProperty (title/description/footer/color/image/timestamp)]

Breakdown

  • channelID - The channel this message belongs to.
  • messageID - The message to get this embed data from.
  • embedIndex - The embed of this message to get data from. Use 1 for the first embed of this message.
  • embedProperty - The embed property to return.

Example

$nomention
Title: $getEmbedData[876920205526319144;878299081380876339;1;title]
Description: $getEmbedData[876920205526319144;878299081380876339;1;description]
Footer: $getEmbedData[876920205526319144;878299081380876339;1;footer]

example

$getInviteInfo

Returns information about a invite code.

Usage

$getInviteInfo[inviteCode;inviteProperty]

Breakdown

  • inviteCode - The invite code to get info about.

  • inviteProperty - The information to get about this invite. Invite properties:

    • channel - The channel that this invite is for.
    • creationDate - The creation date of this invite.
    • inviter - The ID of the user who created this invite.
    • isTemporary - Whether or not this invite is temporary.
    • uses - How many times this invite has been used.

Example

$nomention
$argsCheck[>1;Please provide a valid invite code!]
$title[Invite Info]
$description[Uses: $getInviteInfo[$message;uses]
Channel: $getInviteInfo[$message;channel]
Date: $getInviteInfo[$message;creationDate]
Inviter: $getInviteInfo[$message;inviter]
Temporary: $getInviteInfo[$message;isTemporary]]
$color[#673ab7]

Example

$getLeaderboardValue

Gets a leaderboard value.

Usage

$getLeaderboardValue[variableType (user/globalUser/server);variableName;sortType (asc/desc);position;(optional) returnType (id/value)]
  • variableType - The variable type.
  • variableName - The variable name to generate the leaderboard for.
  • sortType - Whether to sort the values in ascending (asc) or descending (desc) order.
  • position - The leaderboard position to get, e.g 1, 3, etc.
  • returnType - The return type. Types:
    • none - If this field is excluded, it will return Username - Value.
    • id - Returns the ID of the user belonging this position.
    • value - Returns the variable value of this position.

Example

$nomention
$title[**Global Leaderboard**]
$description[#1 - $getLeaderboardValue[globalUser;Money;asc;1]
#2 - $getLeaderboardValue[globalUser;Money;asc;2]
#3 - $getLeaderboardValue[globalUser;Money;asc;3]
#4 - $getLeaderboardValue[globalUser;Money;asc;4]
#5 - $getLeaderboardValue[globalUser;Money;asc;5]
#6 - $getLeaderboardValue[globalUser;Money;asc;6]
#7 - $getLeaderboardValue[globalUser;Money;asc;7]
#8 - $getLeaderboardValue[globalUser;Money;asc;8]
#9 - $getLeaderboardValue[globalUser;Money;asc;9]
#10 - $getLeaderboardValue[globalUser;Money;asc;10]]
$color[FFFF00]
$c[This is for global-user variables.]

$getMessage

Gets data from a message, with the provided message and channel IDs.

Usage

$getMessage[channelID;messageID;(optional) property]

Breakdown

  • channelID - The channel that this message belongs to.
  • messageID - The message to get the data from.
  • property - The message data to get. Default is content. Message properties:
    • content - The content of this message.
    • authorID - The ID of the message author.
    • username - The username of the message author.
    • avatar - The avatar of the message author.

Example

$nomention
$argsCheck[>2;Please provide a channel and message ID! Usage: `!quote (channel) (messageID)`]
$description[$getMessage[$findChannel[$message[1]];$message[2]]]
$color[#673ab7]
$authorIcon[$getMessage[$findChannel[$message[1]];$message[2];avatar]]
$author[$getMessage[$findChannel[$message[1]];$message[2];username]#$discriminator[$getMessage[$findChannel[$message[1]];$message[2];authorID]]]

example

$getReactions

Returns a list of users separated by separator that reacted to a message.

Usage

$getReactions[channelID;messageID;separator;emoji]

Breakdown

  • channelID - The channel that the message belongs to.
  • messageID - The message to get the user-reactions from.
  • separator - The separator between each user.
  • emoji - The emoji to get the user's reactions for.

Example

$nomention
$getReactions[2394734883474774;38483494328934989;, ;<:tip:3943484884834848483>]

example

$getRoleColor

Returns a role's color hex.

Usage

$getRoleColor[roleID]

Breakdown

  • roleID - The role to get the color hex from.

Example

$nomention
$description[<@$authorID>'s color: `#$getRoleColor[$highestRole[$authorID]]`]
$color[$getRoleColor[$highestRole[$authorID]]]

example

$getServerInvite

Gets a server's invite URL.

Usages

There are two usages of the $getServerInvite function.

Usage #1

$getServerInvite

Returns a invite to the current server.

Usage #2

$getServerInvite[guildID]

Returns a invite URL for the server provided.

πŸ§™β€β™‚οΈ Note: The bot must be in the provided server for it to create a invite.

πŸ§™β€β™‚οΈ How do I find a server/guild ID? (click-me)

$getServerVar

Returns the value of the provided server variable.

Usage

$getServerVar[variableName;(optional) guildID]

Breakdown

  • variableName - The name of the variable to get.
  • guildID - The server to get the value for. If no guildID is inputted, then the current server is used.

$getTextSplitIndex

Retrieves index from the provided value.

Usage

$getTextSplitIndex[value]

Breakdown

  • 1 - Returns 1 if it could find the index.
  • -1 - Returns -1 if it couldn't find the index.

Example

$nomention
$textSplit[Cake;-]
$getTextSplitIndex[$message[1]]

image

$getTextSplitLength

Returns the number of splits in $textSplit.

πŸ§™β€β™‚οΈ This function can't be used, if $textSplit isn't present in the code.

Usage

$getTextSplitLength

See more in the Text Splitting guide...

$getTimestamp

Returns unix timestamp (in seconds).

Usage

$getTimestamp

Example

$nomention
Unix Timestamp: $getTimestamp

example

$getUserStatus

Returns the provided user's status.

πŸ§™β€β™‚οΈ The user must share atleast 1 server with the bot, for this function to work.

Usage

$getUserStatus[userID]

Breakdown

  • userID - The user to get the status for.

Statuses List

  • online
  • dnd
  • idle
  • offline

Example

$nomention
$nickname[$mentioned[1;yes]]'s status is: $getUserStatus[$mentioned[1;yes]]

example

$getUserVar

Returns a local-user variable value.

Usage

$getUserVar[variableName;(optional) userID]

Breakdown

  • variableName - The name of the variable to get.
  • userID - The user to get the variable value for. If no user is provided, the author is used.

Example

$nomention
<@$mentioned[1;yes]> has $getUserVar[Money;$mentioned[1;yes]] coins.

example

$getVar

Gets a global/global-user variable.

Usage

$getVar[variableName;(optional) userID]

πŸ§™β€β™‚οΈ For a global variable, a userID doesn't need to be provided. For a global-user variable, userID must be provided.

Breakdown

  • variableName - The name of the variable to get the value from.
  • userID - The user to get the value for (if global-user).

Example

$nomention
You have $getVar[Money;$mentioned[1;yes]] coins!

example

Additional Reading

Check our Variable Guide!

$giveRole

Adds a role to the provided user.

Usages

There are two usages of the $giveRole function.

Usage #1

$giveRole[userID;roleID]

Gives a role to the provided user.

Breakdown

  • userID - The user to give the role to.
  • roleID - The role to give the user.

Usage #2

$giveRole[roleID]

Gives the provided role to the mentioned user.

Breakdown

  • roleID - The role to give the mentioned user.

Example

$onlyPerms[manageroles;Missing permissions!]
$giveRole[807004801753284618]
Added $roleName[807004801753284618] to $username[$mentioned[1]]!

example

$globalCooldown

Applies a cooldown to the command, the user can not run the command in any server until the 'duration' is up. (Unlike $cooldown, which only applies the cooldown to the user in the current server)

Usage

$globalCooldown[duration;errorMessage]

Breakdown

  • duration - The duration until the user can use this command again.
  • errorMessage - The message to return when the cooldown duration is still ongoing.

πŸ§™β€β™‚οΈ You can use %time% to get how much time is left until the cooldown is over, in the 'errorMessage'.

$globalUserLeaderboard

Returns the top ten user's username and value for the given global-user variable.

Usage

$globalUserLeaderboard[variableName;sortType (asc/desc)]

Breakdown

  • variableName - The variable to create the leaderboard for.
  • sortType - Whether to sort the leaderboard in ascending (asc) or descending (desc) order.

πŸ§™β€β™‚οΈ $globalUserLeaderboard automatically generates a description. So, $description should not be used in the code.

Example

$nomention
$globalUserLeaderboard[Money;asc]

$guildExists

Returns 'true' if the provided server exists, otherwise 'false' is returned. Returns 'false' if the bot isn't present in the server.

Usage

$guildExists[guildID]

Breakdown

  • guildID - The ID of the hypothetical server.

$guildID

Returns a server/guild's ID.

Usages

There are two usages of the $guildID function.

Usage #1

$guildID - Returns the current server's ID.

Usage #2

$guildID[serverName] - Finds a server ID using the server name.

πŸ§™β€β™‚οΈ Note: The bot can not find the ID of a server that it isn't in.

$hasRole

Returns whether or not a user has the provided role.

πŸ§™β€β™‚οΈ 'true' means the user has the role, 'false' means they don't.

Usage

$hasRole[userID;roleID]

Breakdown

  • userID - The user to check for the role.
  • roleID - The role that the bot is checking the user for.

Example

$nomention
$hasRole[$authorID;858376972303204362]

example

$highestRole

Returns the ID of the users/servers highest role (according to it's position).

Usages

There are two usages of the $highestRole function.

Usage #1

$highestRole

Returns the highest role in the server.

Usage #2

$highestRole[userID]

Returns the user's highest role.

Example

$nomention
$username[$mentioned[1;yes]]'s highest role: $roleName[$highestRole[$mentioned[1;yes]]] ($highestRole[$mentioned[1;yes]])

example

$highestRoleWithPerms

Returns the highest role in the server that has all the provided permissions.

Usage

$highestRoleWithPerms[permissions]

Breakdown

Example

$nomention
Highest Role with Administrator:  $roleName[$highestRoleWithPerms[admin]] ($highestRoleWithPerms[admin])

example

$hostingExpireTime

Returns expire time for the hosting

Usage

$hostingExpireTime

Example

$nomention
$hostingExpireTime

image

$hour

Returns the current minute.

πŸ§™β€β™‚οΈ You can use $time to change the timezone.

Note: The $hour function uses the twenty-four-hour clock instead of two groups of twelve hours; this also known as, Military Time.

Usage

$hour

Example

$nomention
Current Hour: $hour

Example

$ignoreChannels

The command can't be executed in any of the provided channels. If the channel is ignored, then the 'errorMessage' is returned.

Usage

$ignoreChannels[channelIDs;errorMessage]

Breakdown

  • channelIDs - The channels to ignore. Separate IDs using ;.
  • errorMessage - The message that is returned when the channel is ignored.

$image

Adds a image to the embed.

Usage

$image[imageURL;(optional) embedIndex]

Breakdown

  • imageURL - The URL of the image that appears. Must be a valid image URL.
  • embedIndex - What embed the image should belong to. Default is 1. (learn more)

Example

$nomention
$image[$userAvatar[$botID]]

example

$isAdmin

Returns whether or not the provided user has the administrator permission.

πŸ§™β€β™‚οΈ 'true' means the user has the administrator permission, 'false' means they don't.

Usage

$isAdmin[userID]

Breakdown

  • userID - The user to check.

Example

$nomention
Are You A Admin?: `$isAdmin[$authorID]`

example

$isBanned

Returns 'true' if user is banned, otherwise it returns 'false'. Requires 'BAN_MEMBERS' permission

Usage

$isBanned[user ID]

Example

$nomention
$isBanned[$mentioned[1]]

$isBoolean

Returns whether or not the provided 'text' is a boolean.

πŸ§™β€β™‚οΈ 'true' means the text is a boolean, 'false' means it isn't.

Supported Booleans

PositiveNegative
truefalse
yesno
onoff
enabledisable

Usage

$isBoolean[text]

Breakdown

  • text - The text to check.

Example

$nomention
$isBoolean[$message]

example

$isBot

Returns whether or not the provided user is a bot.

πŸ§™β€β™‚οΈ 'true' means the user is a bot, 'false' means the user is not a bot.

Usage

$isBot[userID]

Breakdown

  • userID - The user to check.

Example

$nomention
Bot? $isBot[$findUser[$message]]

image

$isHoisted

Returns if a role is displayed separately.

πŸ§™β€β™‚οΈ 'true' means the role is hoisted, 'false' means the role isn't hoisted.

Usage

$isHoisted[roleID]

Breakdown

  • roleID - The role which the bot checks is hoisted or not.

Example

$nomention
$isHoisted[$findRole[$message]]

example

$isMentionable

Returns whether or not a role is mentionable by everyone.

πŸ§™β€β™‚οΈ 'true' means the role is mentionable, 'false' means it isn't.

setting

Usage

$isMentionable[roleID]

Breakdown

  • roleID - The role which the bot checks is mentionable or not.

Example

$nomention
$isMentionable[$findRole[$message]]

example

$isNSFW

Returns whether the provided channel is NSFW (not-safe-for-work) or not.

πŸ§™β€β™‚οΈ 'true' means the channel is NSFW, 'false' means it isn't.

Usage

$isNSFW[channelID]

Breakdown

  • channelID - The channel to check.

Example

$nomention
Is <#$channelID> NSFW?: `$isNSFW[$channelID]`

example

$isNumber

Returns whether or not the provided value is a number.

πŸ§™β€β™‚οΈ 'true' means the value is a number, 'false' means it isn't.

Usage

$isNumber[value]

Breakdown

  • value - The text to check.

Example

$nomention
$isNumber[$message]

example

$isSlash

Returns whether the command was ran as a slash command or not.

πŸ§™β€β™‚οΈ 'true' means the command was ran as a slash command, 'false' means it wasn't.

Usage

$isSlash

Example

$nomention
$if[$isSlash==true]
$message[text]
$else
$message
$endif

example

$isUserDMEnabled

Checks whether or not the bot can DM the user.

πŸ§™β€β™‚οΈ 'true' means the bot can DM the user, 'false' means it can't.

Usage

$isUserDMEnabled[userID]

Breakdown

  • userID - The user to check the DM status for.

Example

$nomention
$onlyIf[$isUserDMEnabled[$authorID]==true;❌ Failed to DM you. Make sure you have your DMs on!]
$dm
$message

example

$isValidHex

Checks if given color hex is valid.

πŸ§™β€β™‚οΈ 'true' means the color hex is valid, 'false' means it isn't.

Usage

$isValidHex[colorHex]

Breakdown

$joinSplitText

$kick

Kicks a user.

Usages

There are two usages of the $kick function.

Usage #1

$kick

Kicks the user who ran the command.

Usage #2

$kick[userID;(optional) reason]

Kicks the provided user.

Breakdown

  • userID - The user to kick from the server.
  • reason - The audit-log reason for the kick. Optional.

Example

$nomention
$onlyPerms[kick;❌ You need the `kick` permission to use that!]
$argsCheck[>1;❌ Please provide a user to kick. Usage: `!kick (user) <reason>`.]
$kick[$mentioned[1];$noMentionMessage]
βœ… Kicked `$username[$mentioned[1]]#$discriminator[$mentioned[1]]`!

example

$kickMention

A simplified version of $kick. Kicks the mentioned user, the user running the command must have the 'kick' permission.

Usage

$kickMention[(optional) reason]

Breakdown

  • reason - The audit-log reason for the kick. Optional.

Example

$nomention
$kickMention[$noMentionMessage]
βœ… Kicked `$username[$mentioned[1]]#$discriminator[$mentioned[1]]`!

example

$lowestRole

Returns the ID of the users/servers lowest role (according to it's position).

Usages

There are two usages of the $lowestRole function.

Usage #1

$lowestRole

Returns the lowest role in the server.

Usage #2

$lowestRole[userID]

Returns the user's lowest role.

Example

$nomention
$username[$mentioned[1;yes]]'s lowest role: $roleName[$lowestRole[$mentioned[1;yes]]] ($lowestRole[$mentioned[1;yes]])

example

$lowestRoleWithPerms

Returns the lowest role in the server that has all the provided permissions.

Usage

$lowestRoleWithPerms[permissions]

Breakdown

Example

$nomention
Lowest Role with Administrator:  $roleName[$lowestRoleWithPerms[admin]] ($lowestRoleWithPerms[admin])

example

$max

Returns the largest number from the provided numbers.

Usage

$max[numbers]

Breakdown

  • numbers - The numbers to get the data from. Separate numbers using ;.

Example

$nomention
$max[100;20;50]

example

$membersCount

This command returns number of members.

First usage of the command

$membersCount - returns amount of members in current guild

Second usage

$membersCount[presence] - returns amount of members that have their presences set to provided presence. For example if you will use $membersCount[online] it will show you amount of online members.

Available presences:

  • online
  • offline
  • idle
  • dnd
  • invisible

$mentioned

Returns the ID of the mentioned user.

Usage

$mentioned[mentionNumber;(optional) returnAuthor (yes/no)]

Breakdown

  • mentionNumber - The user-mention to get from the author's message (1 = first user-mention, 2 = second, etc).
  • returnAuthor - Whether to return the author's ID if no user is mentioned or not.

Example

$nomention
$mentioned[1]

example

$mentionedChannels

Returns the ID of the mentioned channel.

Usage

$mentionedChannels[mentionNumber;(optional) returnCurrent (yes/no)]

Breakdown

  • mentionNumber - The channel-mention to get from the author's message (1 = first channel-mention, 2 = second, etc).
  • returnCurrent - Whether to return the current channel ID if no channel is mentioned or not.

Example

$nomention
$mentionedChannels[1]

example

$mentionedRoles

Returns the ID of the mentioned role.

Usage

$mentionedRoles[mentionNumber]

Breakdown

  • mentionNumber - The role-mention to get from the author's message (1 = first role-mention, 2 = second, etc).

Example

$nomention
$mentionedRoles[1]

example

$message

Returns the user's message (without the command trigger).

Usages

There are two usages of the the $message function.

Usage #1

$message

Returns the user's message.

Usage #2

$message[argumentNumber]

Returns the argument matching the provided number.

  • For example, $message[1] would just return the first word of the message.
  • You can also use $message[>] to get the last argument/word of the user's message.

Optimization

Find info about optimizing $message[] for slash commands here.

$messageID

Returns the ID of the author's message.

Usage

$messageID

Example

$nomention
$messageID

example

$min

Returns the smallest number from the provided numbers.

Usage

$min[numbers]

Breakdown

  • numbers - The numbers to get the data from. Separate numbers using ;.

Example

$nomention
$min[3;5;1]

example

$minute

Returns the current minute of this hour.

πŸ§™β€β™‚οΈ You can use $time to change the timezone.

Usage

$minute

Example

$nomention
Current Minute: $minute

example

$modifyChannel

Edits a channel with the data provided.

πŸ§™β€β™‚οΈ You can use !unchanged as a argument for the option to remain in its current state.

Usages

There are two usages of the $modifyChannel function.

Usage #1

$modifyChannel[channelID;channelName;topic;NSFW (yes/no);position]

Breakdown

  • channelID - The channel the bot will edit.
  • channelName - The new channel name.
  • topic - The new channel topic/description.
  • NSFW - Whether the channel will be marked as NSFW or not.
  • position - The new channel position (1 = top).

Usage #2

$modifyChannel[channelID;channelName;topic;NSFW (yes/no);position;categoryID]

Breakdown

Same usage as the first. The only new option is categoryID. This will choose what category the channel is put in.

πŸ§™β€β™‚οΈ You can use $channelID[category/channelName] to get the ID of a category or channel.

Example

For this example, we will be changing the channel name from 'general' to 'chill-chat'. As well as changing the channel topic to 'A chill chat!'.

$nomention
$modifyChannel[$channelID[general];chill-chat;A chill chat!;!unchanged;!unchanged]

$modifyChannelPerms

Modifies a channel's permissions.

Usage

$modifyChannelPerms[channelID;permissions;userID/roleID]

Breakdown

  • channelID - The channel to change the permissions for.
  • permissions - The permissions to add/remove. + means allow, - means deny.
  • userID/roleID - The role or user to modify the permissions for. Use $guildID for @everyone.

Example

Lock:

$nomention
βœ… Successfully locked <#$mentionedChannels[1;yes]>!
$onlyPerms[managechannels;❌ You need the manage_channels permission to use that!]
$modifyChannelPerms[$mentionedChannels[1;yes];-sendmessages;$guildID]

example1

Unlock:

$nomention
βœ… Successfully unlocked <#$mentionedChannels[1;yes]>!
$onlyPerms[managechannels;❌ You need the manage_channels permission to use that!]
$modifyChannelPerms[$mentionedChannels[1;yes];+sendmessages;$guildID]

example2

$modifyRole

Modifies a role.

Usage

$modifyRole[roleID;roleName;colorHex;hoisted (yes/no);mentionable (yes/no)]

πŸ§™β€β™‚οΈ You can use !unchanged as a argument to leave the setting as-is.

Breakdown

  • roleID - The ID of the role to modify.
  • roleName - The new role name.
  • colorHex - The new role color.
  • hoisted - Whether the role should be displayed separately or not.
  • mentionable - Whether the role should be mentionable by everyone or not.

Example

$nomention
$argsCheck[>2;❌ Please provide the needed arguments! Usage: `!role-name (role) (newRoleName)`]
$onlyPerms[manageroles;❌ You are missing the manage_roles permission!]
$modifyRole[$findRole[$message[1]];$replaceText[$message;$message[1];;1];!unchanged;!unchanged;!unchanged]
$description[βœ… Changed role name of <@&$findRole[$message[1]]>]

example

$modifyRolePerms

Modifies a role's permissions.

Usage

$modifyRolePerms[roleID;permissions]

Breakdown

  • roleID - The role to modify the permissions for. Use $guildID for the @everyone role.
  • permissions - The permissions to toggle, separate permissions using ;.

$modulo

Returns remainder between numbers.

Usage

$modulo[numbers]

Breakdown

  • numbers - The numbers to return the remainder for. Separate numbers using ;.

Example

$nomention
$argsCheck[>2;❌ Invalid usage. Usage: `!modulo (number1) (number2)`]
$modulo[$message[1];$message[2]]

example

$month

Returns the current month of this year.

πŸ§™β€β™‚οΈ You can use $time to change the timezone.

Usage

$month

Example

$nomention
Current Month: $month

example

$multi

Muliplies the provided numbers.

Usage

$multi[numbers]

Breakdown

  • numbers - The numbers to multiply, separate numbers using ;.

Example

$nomention
$argsCheck[>2;❌ Invalid usage. Usage: `!multiply (number1) (number2)`]
$multi[$message[1];$message[2]]

example

$mute

(deprecated)

πŸ§™β€β™‚οΈ This command is deprecated instead better use $timeout.

Mutes the mentioned user.

Usage

$mute[mutedRoleName]

Breakdown

  • mutedRoleName - The name of the 'Muted' role (case sensitive).

Example

$nomention
$onlyPerms[manageroles;❌ You are missing permission: `MANAGE_ROLES`.]
$mute[Muted]
βœ… Successfully muted $username[$mentioned[1]]#$discriminator[$mentioned[1]]!

example

$newTicket

Creates a new ticket.

Usage

$newTicket[categoryID/name;messageWhenNoSubject;MessageInTicket;MessageToUser;errorMessage]

Breakdown

  • categoryID/name - The category to put the ticket channels in. Can be a category ID or name.

πŸ§™β€β™‚οΈ Setup the ticket category permissions: tickets

  • messageWhenNoSubject - The message that appears in {subject} when the user doesn't provide a subject.
  • messageInTicket - The message that is sent in the new ticket channel.
  • messageToUser - The message that gets sent in the current channel.
  • errorMessage - The message that gets returned when the ticket can't be created.

Subset Functions

You can use these subset functions in $newTicket.

  • {subject} - Returns the ticket subject (user's message).
  • {channel} - Mentions the new ticket channel.

Example

$nomention
$newTicket[Tickets;No subject was provided.;Thanks for making a ticket. Please explain your issue in detail so we can help.
Subject: {subject}
User: <@$authorID>;Created ticket! {channel};Failed to make ticket!]

example1

example1

$nickname

Returns a user's display name. >πŸ§™β€β™‚οΈ 'display name' means the user's server nickname, but if the user doesn't have a nickname then their username is returned instead.

Usages

There are two usages of the $nickname function.

Usage #1

$nickname

Returns the author's display name.

Usage #2

$nickname[userID]

Returns the provided user's display name.

Example

$nomention
<@$mentioned[1;yes]>'s nickname is `$nickname[$mentioned[1;yes]]`

example

$nomention

Disables the default author mention.

Usage

$nomention

Example

With $nomention:

example

Without $nomention:

example

$noMentionMessage

Returns the user's message without any mentions.

Usages

There are 2 usages of the $noMentionMessage function.

Usage #1

$noMentionMessage

Returns the user's full message (without mentions).

Usage #2

$noMentionMessage[argumentNumber]

Returns the argument matching the provided number (excluding mentions).

πŸ§™β€β™‚οΈ For example, $noMentionMessage[1] would just return the first word of the message. You can also use $noMentionessage[>] to get the last argument/word of the user's message.

Example

$nomention
$noMentionMessage

example

$onlyAdmin

Makes the command only for users with the administrator permission.

Usage

$onlyAdmin[errorMessage]

Breakdown

  • errorMessage - The error message that is returned when the user doesn't have administrator.

$onlyBotChannelPerms

The command can only be executed if the bot has all of the provided permissions in a channel.

Usage

$onlyBotChannelPerms[channelID;permissions;errorMessage]

Breakdown

  • channelID - The channel to check the permissions for. Use $channelID for the current channel.
  • permissions - The permissions that the bot needs to execute the command. Separate permissions with ;.
  • errorMessage - The message that is returned when the bot doesn't have the needed permissions.

$onlyBotPerms

The command can be executed if bot has all of the provided permissions.

Usage

$onlyBotPerms[permissions;errorMessage]

Breakdown

  • permissions - The permissions that the bot needs to run the command.
  • errorMessage - The message to return when the bot doesn't have all the provided permissions.

$onlyForChannels

The command can only be executed in the provided channels.

Usage

$onlyForChannels[channelIDs;errorMessage]

Breakdown

  • channelIDs - The channels that the command can be executed in. Separate the IDs using ;.
  • errorMessage - The message that is returned when the command is used in a non-whitelisted channel.

$onlyForIDs

The command can only be executed by the provided users.

Usage

$onlyForIDs[userIDs;errorMessage]

Breakdown

  • userIDs - The users that can use this command, separate IDs using ;.
  • errorMessage - The error message that is returned, when the user running the command is not whitelisted.

Example

$onlyForIDs[YOUR_ID;❌ You are not my owner!]
$eval[$message]
$c[This can only be executed in BDScript 2.]

$onlyForRoles

The command can only executed by the provided roles.

Usage

$onlyForRoles[roleNames;errorMessage]

Breakdown

  • roleNames - The role names to allow.
  • errorMessage - The message to return when the user doesn't have the required roles.

$onlyForRolesIDs

The command can only executed by the provided roles.

Usage

$onlyForRolesIDs[roleIDs;errorMessage]

Breakdown

  • roleIDs - The role IDs to allow, separate IDs using ;.
  • errorMessage - The message to return when the user doesn't have the required roles.

$onlyForServers

The command can only be executed in the provided servers.

Usage

$onlyForServers[serverIDs;errorMessage]

Breakdown

  • serverIDs - The servers that the command can be executed in. Separate the IDs using ;.
  • errorMessage - The message that is returned when the command is used in a non-whitelisted server.

$onlyForUsers

The command can only be executed by users with certain 'usernames'.

Usage

$onlyForUsers[usernames;errorMessage]

Breakdown

  • usernames - The name's of the users that this command can be executed by. Separate the usernames using ;.
  • errorMessage - The message that is returned when the command is used by a non-whitelisted user.

$onlyIf

If x is related accordingly (based on the "sign") with y then the code runs. If not, the 'errorMessage' is returned.

Usage

$onlyIf[valuex(sign)valuey;errorMessage]

Signs

  • == - Equal
  • != - Not Equal
  • < - Less Than
  • >- Greater Than
  • >= - Greater Than Or Equal To
  • <= - Less Than Or Equal To

$onlyIfMessageContains

The command can only be executed if the 'text' contains all the 'indexes', otherwise the 'errorMessage' is returned.

Usage

$onlyIfMessageContains[text;indexes;errorMessage]

Breakdown

  • text - The text to check.
  • indexes - The phrases that the text must contain, separate phrases using ;.
  • errorMessage - The message that is returned if the text doesn't contain all the provided indexes.

$onlyNSFW

Only allows the command to be executed in NSFW channels.

Usage

$onlyNSFW[errorMessage]

Breakdown

  • errorMessage - The message that is returned when the command is executed outside of a NSFW channel.

Example

$nomention
$onlyNSFW[❌ That command can only be used in NSFW channels.]
$c[Put your code here.]

$onlyPerms

The command can only be executed if the user running the command has all the provided 'permissions'. Otherwise, the 'errorMessage' is returned.

Usage

$onlyPerms[permissions;errorMessage]

Breakdown

  • permissions - The required permissions (see permissions list). Separate permissions using ;.
  • errorMessage - The message that is returned when the user is missing the required permissions.

$or

Returns 'true' if atleast one of the provided conditions is true, otherwise 'false' is returned.

Usage

$or[condition1;condition2;etc]

Example

$nomention
$if[$or[$message==hi;$message==hey;$message==hello]==true]
Hello $username!
$endif

example

$ping

Shows the delay between sent message and bot's response. The value of $ping is expressed in miliseconds.

Example command:

Ping: $ping ms

Expected output:

Ping: 50 ms

β €

$pinMessage

Pins the bot's message.

Usage

$pinMessage

Example

$nomention
$pinMessage
This is a cool pinned message! 😎

example

$premiumExpireTime

Returns how long until premium expires.

πŸ§™β€β™‚οΈ Returns 'expired' if the bot is not premium.

Usage

$premiumExpireTime

Example

$nomention
My premium expires in: $premiumExpireTime

example

$random

Returns random numbers.

Usages

There are two usages of the $random function.

Usage #1

$random

Returns a random number between 0 and 9.

Usage #2

$random[minimum;maximum]

Returns a random number between 'minimum' and 'maximum'.

Example

$nomention
🎲 You rolled `$random[1;7]`!

$random[] never returns the 'maxium' value, as it's right side exclusive range. Basically, to get a random number between 1 and 10; you'd put 11 as the 'maxium' instead of 10.

example

$randomChannelID

Returns a random channel ID from the current server.

Usage

$randomChannelID

Example

$nomention
Here's A Random Channel: <#$randomChannelID>

example

$randomMention

Mentions a random user from the server.

Usage

$randomMention

Example

$nomention
Random User: $randomMention

$randomString

Generates a random combination of letters/numbers.

Usage

$randomString[length]

Breakdown

  • length - How long the string should be (max 10).

Example

$nomention
String: `$randomString[$message]`

example

$randomText

Picks one value from the provided values randomly.

Usage

$randomText[text1;text2;etc]

Breakdown

  • text1/text2/etc - The text which the bot can choose from.

Example

$nomention
$randomText[Hello;Hi;Hey]!

example

$randomUser

Returns a random user's username.

Usage

$randomUser

$randomUserID

Returns a random user ID from the current server.

Usage

$randomUserID

$removeComponent

Removes certain component from a message.

Usage

$removeComponent[customID;(optional) messageID]

Breakdown

  • customID - The select-menu/button custom ID to remove from the message.
  • messageID - The message to remove the component from, uses the bot's current message if no 'messageID' is provided.

$removeContains

Deletes messages that contain the provided phrases.

Usage

$removeContains[phrases;howMany]

Breakdown

  • phrases - The phrases/words to delete, separate phrases using ;.
  • howMany - How many messages containing the provided phrases to delete.

Example

$nomention
$onlyPerms[managemessages;❌ You are missing the `MANAGE_MESSAGES` permission!]
$removeContains[https://discord.gg/;discord.gg/;https://discord.com/invite;$noMentionMessage]
Successful purged `$noMentionMessage` messages containing invites!

$removeLinks

Removes links from a value.

Usages

There are two usages of the $removeLinks function.

Usage #1

$removeLinks

Removes all links from the bot's reply.

Usage #2

$removeLinks[text]

Removes all links from the provided 'text'.

Example

$nomention
$removeLinks[$noMentionMessage]

example

$removeSplitTextElement

Removes a certain element from the $textSplit values.

πŸ§™β€β™‚οΈ This function is uneeded, if $textSplit isn't present in the code.

Usage

$removeSplitTextElement[index]

Breakdown

  • index - The index of the $textSplit value to remove.

See more in the Text Splitting guide...

$repeatMessage

Repeats the provided text a certain amount of times.

Usage

$repeatMessage[howMany;text]

Breakdown

  • howMany - How many times the text is repeated (max 10 times).
  • text - The text to repeat.

Examples

Example #1:

$nomention
$repeatMessage[5;Hello World]

example1

Example #2:

πŸ§™β€β™‚οΈ You can use a space at the end of 'text', so there are spaces in-between repeats.

$nomention
$repeatMessage[5;Hello World! ]

example2

$replaceText

Replaces 'sample' with 'new' from 'text', you can choose how many 'sample' is replaced by inputting 'howMany'.

Usage

$replaceText[text;sample;new;(optional) howMany]

Breakdown

  • text - The text where the bot is searching for the 'sample'.
  • sample - The text to replace with 'new'.
  • new - The text to replace 'sample' with.
  • how many - How many times the bot should replace the sample (if there is multiple arguments in 'text' that match 'sample'). Use -1 to replace all 'sample' in 'text' with 'new' (this last argument is optional).

Examples

Example #1:

  • Input: $replaceText[Hello World! Hello Earth!;Hello;Hi;1]
  • Output: Hi World! Hello Earth!

Example #2:

  • Input: $replaceText[Hello World! Hello Earth! Hello Dog!;Hello;Hi;-1]
  • Output: Hi World! Hi Earth! Hello Dog!

Example #3:

  • Input: $replaceText[Hello World! Hello Earth! Hello Dog!;Hello;Hi;-1] or $replaceText[Hello World! Hello Earth! Hello Dog!;Hello;Hi]
  • Output: Hi World! Hi Earth! Hi Dog!

$reply

Replies to the user's command

Usage

$reply

Example

$nomention
$reply
Hello $username πŸ‘‹πŸ»

Example

With $reply:

image

Without $reply:

image

$replyIn

The bot waits x (amount of time) before executing the code.

Usage

$replyIn[delay]

πŸ§™β€β™‚οΈ The 'delay' can't be more than 40 minutes or less than 1 second.

Breakdown

  • delay - How long the command is delayed (e.g: 10s, 10m, 40m).

Example

$replyIn[5s]
Hi $username!

$resetServerVar

Resets a server variable back to it's default value (the one inputted in the app) for every server.

πŸ§™β€β™‚οΈ Use this function wisely!

Usage

$resetServerVar[variableName]

Breakdown

  • variableName - The name of the variable to reset.

$resetUserVar

Resets a user variable back to it's default value (the one inputted in the app) for every user, or just the provided user.

πŸ§™β€β™‚οΈ Use this function wisely!

Usage

$resetUserVar[variableName;(optional) userID]

Breakdown

  • variableName - The name of the variable to reset.
  • userID - The user to reset the variable for, if no user is provided, then the variable is reset for everyone!

$roleCount

Returns how many roles are in the current server.

Usage

$roleCount

Example

$nomention
There are $roleCount roles in $serverName[$guildID]

example

$roleExists

Returns whether or not the provided ID is a actual role.

πŸ§™β€β™‚οΈ 'true' means the role exists, 'false' means it doesn't.

Usage

$roleExists[roleID]

Breakdown

  • roleID - The "role" which the bot checks.

Examples

Example #1:

$roleExists[1239039039030939]
$c[This role doesn't exist!]

example1

Example #2:

$roleExists[858334189899087943]
$c[This role exists!]

example2

$roleID

Returns a role's ID using its name.

Usage

$roleID[roleName]

Breakdown

  • roleName - The role name to get the role ID for.

Example

$nomention
Role ID For "$message": $roleID[$message]

example

$roleInfo

$roleInfo allows you to make a 'role info' command without using a bunch of different functions at once. This function returns info about the mentioned role.

Commands

You can use the 'commands' below within $roleInfo:

  • {name} - Returns the role name.
  • {ID} - Returns the role's ID.
  • {mentionable} - Returns if the role is mentionable by everyone.
  • {hoist} - Returns if a role is hoisted (displayed separately).
  • {color} - Returns the role's color.
  • {position} - Returns the roles position on 'roles list'.

Usage

$roleInfo[code/text]

⚠️ You can not include $roleInfo[] in a command with a $description[] (because it makes one automatically).

Example

$nomention
$roleInfo[Name: {name}
ID: {ID}
Mentionable?: {mentionable}
Hoisted?: {hoist}
Color: {color}
Position: {position}]
$title[Role Info]

example

$roleName

Returns a role's name.

Usage

$roleName[roleID]

Breakdown

  • roleID - The role to get the name of.

Example

$nomention
$roleName[$highestRole[$authorID]]

example

$roleNames

Returns the name of every role in the current server.

Usage

$roleNames

Example

$nomention
$description[Server Roles: $roleNames]

exampel

$rolePosition

Returns a roles position (1 being highest role).

Usage

$rolePosition[roleID]

Breakdown

  • roleID - The role to get the position of.

Example

$nomention
$description[<@&$findRole[$message]>'s Position: $rolePosition[$findRole[$message]]]

example

$round

Rounds up the provided number.

Usage

$round[number;decimalPlace]

Breakdown

  • number - The number to round.
  • decimalPlace - The decimal place to round the number to. 0 removes decimal place.

Example

$nomention
$round[100.123;1]

example

$second

Returns the current second of this minute.

πŸ§™β€β™‚οΈ You can use $time to change the timezone.

Usage

$second

Example

$nomention
Current Second: $second

example

$sendEmbedMessage

Sends embed message to provided channel. Not needed fields can be left empty.

Usage

$sendEmbedMessage[channel ID;content;title;title URL;description;color;author;author icon;footer;footer icon;thumbnail;image;add timestamp;return ID]

Breakdown

  • channel ID - id of the channel where the message will be sent.
  • content - text to be sent before embed.
  • title - text that will be used as the title in the embed.
  • title URL - url that will be applied to the title.
  • description - description that will be applied to the embed.
  • color - the color hex to set the embed border color as.
  • author icon - the image that appears in the author icon. This must be a valid image URL.
  • footer - The text to set the footer as.
  • footer icon - the URL to set the footer icon as. Must be a valid image URL.
  • thumbnail - the image to set as the thumbnail.
  • image - the URL of the image that appears. Must be a valid image URL.
  • add timestamp - add the time to send (use yes or no).
  • return ID - output the message ID outside the embed (use yes or no).

Example

$nomention
$sendEmbedMessage[$channelID;;Title;https://discord.gg/;description;000000;author;$authorAvatar;footer;$authorAvatar;$authorAvatar;$authorAvatar;no;no]

image

$sendMessage

Sends a new message.

Usage

$sendMessage[text;(optional) returnMessageID (yes/no)]

Breakdown

  • text - The text to send in the new message.
  • returnMessageID - Whether to return the ID of the newly created message, in another message. Optional, default is no.

Examples

Example #1:

$nomention
$sendMessage[This is message #1!]
$sendMessage[This is message #2!]
$sendMessage[This is message #3!]

example1

Example #2:

$nomention
$sendMessage[This is message #1!;yes]
$sendMessage[This is message #2!;yes]

example2

$serverChannelExists

Checks if the channel exists in the guild

Usage

$serverChannelExists[channel ID]

Breakdown

  • true - If could find the channel.
  • false - If couldn't find the channel

Example 1

$nomention
$serverChannelExists[566370477967147018]

Example 2

$nomention
$serverChannelExists[$channelID[channelName]]

$serverCooldown

Sets a server cooldown. After the command is used, no one in the server will be able to run the command until the 'duration' is up.

Usage

$serverCooldown[duration;errorMessage]

Breakdown

  • duration - The duration of this cooldown.
  • errorMessage - The error to return when the cooldown is still ongoing.

πŸ§™β€β™‚οΈ You can use %time% to get how much time is left on the cooldown, in 'errorMessage'.

$serverCount

Returns how many servers the bot is in.

Usage

$serverCount

Example

$nomention
I'm currently in $serverCount servers!

example

$serverIcon

Returns the server's icon.

Usages

There are two usages of the $serverIcon function.

Usage #1

$serverIcon

Returns the icon of the server that this command was ran in.

Usage #2

$serverIcon[serverID]

Returns the icon of the server provided.

Breakdown

  • serverID - The server to get the icon for (bot must be in the server).

Example

$nomention
$image[$serverIcon]

example

$serverInfo

Allows you to make a 'server info' command without using a bunch of different functions at once. This function returns info about the current server.

Usage

$serverInfo[text/code;(optional) showIcon (yes/no)]

Breakdown

  • text/code - The text that is returned.
  • showIcon - Whether or not to show the server icon as the thumbnail. Default is yes.

⚠️ You can not include $serverInfo[] in a command with a $description[] (because it makes one automatically).

Subset-Functions

You can use the 'subset-functions' below within $serverInfo:

  • {name} - Returns the server name
  • {region} - Returns the server region
  • {emoji} - Returns the server's emojis in a list.
  • {owner} - Returns the owner's username.
  • {ID} - Gets the guild ID.
  • {verificationLvl} - Returns the server verification level.
  • {large} - Finds out if a server is considered 'large'.

Example

$nomention
$title[Server Info]
$serverInfo[Server Name: {name}
Region: {region}
Owner: {owner}
Server ID: {ID}
Verify Level: {verificationLvl}
Emojis: {emoji}
Large Server?: {large};no]

example

$serverLeaderboard

Makes a server leaderboard (top-10).

Usage

$serverLeaderboard[variableName;sortType (asc/desc)]

Breakdown

  • variableName - The variable to create the leaderboard for.
  • sortType - Whether to sort the leaderboard in ascending (asc) or descending (desc) order.

πŸ§™β€β™‚οΈ $serverLeadboard automatically generates a description. So, $description should not be used in the code.

$serverName

Returns the server's name.

Usage

$serverName[guildID]

Breakdown

  • guildID - The server to get the name of. Use $guildID for the current server.

πŸ§™β€β™‚οΈ The bot must be present in the server to return it's name.

Example

$nomention
Server Name: $serverName[$guildID]

example

$serverNames

Returns up to 10 server names that the bot is in.

Usage

$serverNames

Example

$nomention
$onlyForIDs[YOUR_ID;Only my owner can use that!]
$serverNames

πŸ§™β€β™‚οΈ Replace 'YOUR_ID' with your user ID.

$serverOwner

Returns the ID of the server owner.

Usages

There are two usages of the $serverOwner function.

Usage #1

$serverOwner

Returns the current server's owner.

Usage #2

$serverOwner[serverID]

Returns the owner ID of the provided server.

Breakdown

  • serverID - The server to get the owner ID for.

πŸ§™β€β™‚οΈ Bot must be present in the server to get the server owner ID.

Example

$nomention
This server is owned by <@$serverOwner>!

example

$serverRegion

(deprecated)

Returns the server's region.

πŸ§™β€β™‚οΈ This function is deprecated, because Discord removed the server region setting. For more information, click here.

Usage

$serverRegion

$serverVerificationLvl

The server's verification level. Returns None, Low, Medium, High, or Very High.

Usage

$serverVerificationLvl

Example

$nomention
This server's verification level is $serverVerificationLvl

example

$setServerVar

Updates a variable value for a server.

Usage

$setServerVar[variableName;newValue;(optional) serverID]

Breakdown

  • variableName - The variable to update.
  • newValue - The newly assigned variable value.
  • serverID - The server to assign the new value to, uses current server if no 'serverID' is provided.

See more in the Variables guide...

$setUserVar

Updates a variable's value for a user.

Usage

$setUserVar[variableName;newValue;(optional) userID]

Breakdown

  • variableName - The variable to update.
  • newValue - The newly assigned variable value.
  • userID - The user to assign the new value to, uses the author if no 'userID' is provided.

See more in the Variables guide...

$setVar

Sets a variable's value globally, or for a user globally.

Usage

$setVar[variableName;newValue;(optional) userID]

Breakdown

  • variableName - The variable to update.
  • newValue - The newly assigned variable value.
  • serverID - The user to globally assign the new value to, sets the variable un

See more in the Variables guide...

$shardID

Returns the id of the currently used shard

Usage

$shardID

$slashCommandsCount

Returns the number of slash commands the bot has enabled.

Usage

$slashCommandsCount

Example

$nomention
I have $slashCommandsCount slash commands!

example

$slowmode

With slowmode enabled in a channel, it'll limit the number of messages a user is able to send in a channel based on a timed cooldown. $slowmode[] is used to change a channel's slowmode using a bot.

πŸ§™β€β™‚οΈ Slowmode delay can't be set over 6 hours/21600 seconds. Also, in order for the bot to run $slowmode[] successfully, it needs the 'Manage Channels' permission.

Usage

$slowmode[channelID;delay]

Breakdown

  • channelID - The channel in the which the slowmode is being modified in. Use 0/0s to disable the slowmode.
  • delay - The new slowmode delay (in seconds, e.g. 1s, 180s, 5s, 3s, etc).

Example

$nomention
$slowmode[$mentionedChannels[1;yes];$message[1]]
Slowmode changed to $message[1]!
$argsCheck[>1;:x: Incorrect Usage! Example: `!slowmode 5s`]

example

$sort

Sorts provided numbers. Amount of numbers can be set to -1 if you'd like to return every number

Usage

$sort[numbers;...;direction;return amount;separator]

Breakdown

  • numbers - sets numbers separated by ; (ex: 1;2;3)
  • direction - what order will be used (ascending or descending).
    • asc - ascending
    • desc - descending
  • return amount - how many numbers will be returned.
    • -1 - Use -1 to generate all numbers
  • separator - the separator between each number.

Example

$nomention
$sort[8;5;9;1;3;asc;4; - ]

image

$splitText

Retrieves a value from $textSplit.

Usage

$splitText[index]

Breakdown

  • index - The split value to get (e.g 2 for the second split).

See more in the Text Splitting guide...

$startThread

Creates a new thread.

Usage

$startThread[name;channelID;messageID (canBeLeftEmpty);archiveDuration (60/1440/4320/10080);returnThreadID (yes/no)]

Breakdown

  • name - The name of the newly created thread.
  • channelID - The channel that is the parent of this thread.
  • messageID - The message that this thread is created for, can be left empty.
  • archiveDuration - The archive duration of this thread in minutes. Only 60, 1440,4320, 10080 can be used. Note that for the 4320 archive duration option, the server needs to be level 1 boosted, and for 10080 the server needs level 2.
  • returnThreadID - Whether to return the thread channel ID or not.

Example

$var[threadID;$startThread[Cool Thread;$channelID;;1440;yes]]
I created a new thread! <#$var[threadID]>
$c[❗️This example requires BDScript 2 enabled❗️]

example

Explaination:
This code is storing the newly created thread ID returned from $startThread[] (using $var[]). Then, in the rest of the code $var[threadID] was called to get the thread ID; which allowed the bot to mention the new thread channel.

$sub

Returns the subtraction of the provided numbers.

Usage

$sub[numbers]

Breakdown

  • numbers - The numbers to subtract, separate numbers using ;.

Example

$nomention
$sub[10;5]

example

$sum

Returns the addition of the provided numbers.

Usage

$sum[numbers]

Breakdown

  • numbers - The numbers to add together, separate numbers using ;.

Example

$nomention
$sum[10;5]

example

$suppressErrors

Suppresses error messages.

Usages

There are two usages of $suppressErrors.

Usage #1

$suppressErrors

Prevents error messages from being returned as the response.

Simply put, the bot will not respond if there is a error message.

Usage #2

$suppressErrors[customError]

Prevents error messages from being returned as the response. Instead, the 'customError' text is returned.

$takeRole

Removes a role to the provided user.

Usages

There are two usages of the $takeRole function.

Usage #1

$takeRole[userID;roleID]

Removes a role for the provided user.

Breakdown

  • userID - The user to remove the role for.
  • roleID - The role to remove from the user.

Usage #2

$takeRole[roleID]

Removes the provided role from the mentioned user.

Breakdown

  • roleID - The role to remove from the mentioned user.

Example

$nomention
$onlyPerms[manageroles;Missing permissions!]
$takeRole[867492530463178803]
Removed $roleName[867492530463178803] from $username[$mentioned[1]]!

example

$textSplit

Separates 'text' by the 'splitter', and saves data for $splitText.

Usage

$textSplit[text;splitter]

Breakdown

  • text - The text to split.
  • splitter - The splitter to split arguments with.

See more in the Text Splitting guide...

$threadAddMember

Adds a member to a thread.

Usage

$threadAddMember[threadID;userID]

Breakdown

  • threadID - The ID of the thread channel to add this user to.
  • userID - The user to add to the thread.

Example

$nomention
$var[thread;$startThread[Cool Thread;$channelID;;60;yes]]
$threadAddMember[$var[thread];$authorID]
$c[Adds the author to the newly created 'Cool Thread']

example1

example2

$threadRemoveMember

Removes a member from a thread.

Usage

$threadRemoveMember[threadID;userID]

Breakdown

  • threadID - The ID of the thread channel to remove this user from.
  • userID - The user to remove from the thread.

Example

$nomention
$threadRemoveMember[878305123707785218;$authorID]

example

$thumbnail

Adds a thumbnail to the embed.

Usage

$thumbnail[imageURL;(optional) embedIndex]

Breakdown

  • imageURL - The image to set as the thumbnail.
  • embedIndex - What embed the thumbnail should belong to. Default is 1. (learn more)

Example

$nomention
$description[This is the thumbnail β†˜οΈ]
$thumbnail[$authorAvatar]

example

$time

Changes the timezone for date/time functions.

Usage

$time[timezone]

Breakdown

  • timezone - The timezone to change the time/date functions to.

⚠️ Get timezones from here (click-me)

Example

$nomention
$time[America/New_York]
Date: $date

Example

$timeout

Timeouts the mentioned users, or the user provided in 'User ID', for a certain 'Duration' (max 28 days)

Usage

$timeout[duration;(optional) userID]

Example

$nomention
$timeout[$message[1];$mentioned[1]]

example

$title

Sets the embed title.

Usage

$title[text;(optional) embedIndex]

Breakdown

  • text - The text to set the title as.
  • embedIndex - What embed the title should belong to. Default is 1. (learn more)

Example

$nomention
$title[This is a title!]
$description[⬆️ That is a nice title.]

example

$toLowercase

Converts the provided text to all lowercase.

Usage

$toLowercase[text]

Breakdown

  • text - The text to convert.

Example

$nomention
$toLowercase[THIS TEXT IS NOW lowercase]

example

$toUppercase

Converts the provided text to all uppercase.

Usage

$toUppercase[text]

Breakdown

  • text - The text to convert.

Example

$nomention
$toUppercase[this text is now UPPERCASE]

example

$trimSpace

Removes space from the start and end of the provided text

Usage

$trimSpace[text]

Example

$nomention
>$trimSpace[ Hi ]<

image

$tts

Marks the bot's message as TTS (text-to-speech).

What is TTS? (click-me)

Usage

$tts

$unban

Unbans a user using their username (from the user's message).

Usage

$unban

Example

$nomention
$unban
Successfully unbanned user!

example

example2

$unbanID

Unbans a user using their ID.

πŸ§™β€β™‚οΈ The bot needs ban permissions to unban users!

Usages

There are two usages of the $unbanID function.

Usage #1

$unbanID

Unbans user by using their ID. The ID is taken from the last argument of the user's message.

Usage #2

$unbanID[userID]

Unbans user by using the ID provided in the 'userID' field.

Breakdown

  • userID - The user to unban.

Example

$nomention
$unbanID
Successfully unbanned user!

example

$unmute

(deprecated)

πŸ§™β€β™‚οΈ This command is deprecated instead better use $untimeout.

Unmutes the mentioned user.

Usage

$unmute[mutedRoleName]

Breakdown

  • mutedRoleName - The name of the 'Muted' role (case sensitive).

Example

$nomention
$onlyPerms[manageroles;❌ You are missing permission: `MANAGE_ROLES`.]
$unmute[Muted]
βœ… Successfully unmuted $username[$mentioned[1]]#$discriminator[$mentioned[1]]!

example

$unpinMessage

Unpins the message.

Usage

$unpinMessage[channel ID;message ID]

$untimeout

$uptime

Returns how long the bot has been online.

Usage

$uptime

Example

$nomention
I've been online for `$uptime`!

ex

$url

Encodes or decodes url

Usage

$url[mode;text]

Signs

  • encode - encode text.
  • decode - decode text.

Example

$nomention
$url[encode;@Wiki Bot]

image

$useChannel

The bot's response gets sent to the provided channel.

Usage

$useChannel[channelID]

Breakdown

  • channelID - The channel to redirect the bot's response to.

Example

$nomention
$useChannel[$mentionedChannels[1]]
$description[hi]
$title[hello]

ex1

ex2

$userAvatar

Returns the provided user's avatar URL.

Usage

$userAvatar[userID]

Breakdown

  • userID - The user to return the avatar for.

Example

$nomention
$image[$userAvatar[$mentioned[1;yes]]]

example

πŸ§™β€β™‚οΈ You can use ?size=size at the end of the URL to increase the size of the image. Example sizes: 1024, 2048, 4096.

$nomention
$image[$userAvatar[$mentioned[1;yes]]?size=4096]

example2

$userExists

Returns whether the provided user actually exists.

πŸ§™β€β™‚οΈ 'true' means the user exists, 'false' means they don't.

Usage

$userExists[userID]

Breakdown

  • userID - The ID of the hypothetical user.

Example

$nomention
$userExists[$mentioned[1]]

example

$userID

Gets the user's ID using their username or tag.

Usage

$userID[username/tag]

Breakdown

username/tag - The user's username (User) or tag (User#0000) to return the ID for.

Example

$userID[Spen]

example

$userInfo

Allows you to make a 'user info' command without using a bunch of different functions at once. Returns info about the mentioned user.

Usage

$userInfo[text/code]

⚠️ You can not include $userInfo[] in a command with a $description[] (because it makes one automatically).

Subset Functions

You can use the 'subset-functions' below within $userInfo:

  • {username} - Returns the user's username.
  • {ID} - Gets the users ID.
  • {BOT} - Checks if the user is a bot.
  • {discriminator} - Gets the user's discriminator.

Example

$nomention
$userInfo[Username: {username}
User ID: {ID}
Bot?: {BOT}
Discriminator: {discriminator}]
$title[User Info]

example

$userJoined

Returns date when given user joined the server. You can also give your own date format.

Usage

$userJoined[userID;(optional) format]

Example

$nomention
$userJoined[$authorID]

example

Format

The format allows you to customize the date format.

  • Monday - Day
  • January - Month
  • 3:04 Time
  • 2006 - Year
  • 2 - Day Of The Month

$userJoined[$authorID;January 2 (Monday), 2006 at 3:04] would return Month DayOfTheMonth (Day), Year at Time.

$userJoinedDiscord

Returns the date when given user created their Discord account. You can also give your own date format.

Usage

$userJoinedDiscord[userID;(optional) format]

Example

$nomention
$userJoinedDiscord[$authorID]

example

Format

The 'format' option allows you to customize the date format.

  • Monday - Day
  • January - Month
  • 3:04 - Time
  • 2006 - Year
  • 2 - Day Of The Month

$userJoinedDiscord[$authorID;January 2 (Monday), 2006 at 3:04] would return Month DayOfTheMonth (Day), Year at Time.

$userLeaderboard

Returns the top ten user's username and value for the given user variable.

Usage

$userLeaderboard[variableName;sortType (asc/desc)]

Breakdown

  • variableName - The variable to create the leaderboard for.
  • sortType - Whether to sort the leaderboard in ascending (asc) or descending (desc) order.

πŸ§™β€β™‚οΈ $userLeaderbard automatically generates a description. So, $description should not be used in the code.

Example

$nomention
$userLeaderboard[Money;asc]

$username

Returns a user's username.

Usages

There are two usages of the $username function.

Usage #1

$username - Returns the username of the user running this command.

Usage #2

$username[userID] - Returns username of the user with the 'userID' that is provided.

Examples

Example #1

(for this example a echo command)

$nomention
Hello $username!

example1

Example #2

(for this example a hug command)

$nomention
$username just hugged $username[$mentioned[1]]!

example2

$userPerms

Returns user permissions. Amount to return can be set to -1 if you'd like to return every permission

Usage

$userPerms[user ID;return amount;separator]

Breakdown

  • user id - the userID to get their permissions.
  • return amount - how many permissions you want to get, use -1 to extract all.
  • separator - text/character to use to separate each permission

Example

$nomention
$userPerms[$mentioned[1];-1;-]

image

$userReacted

Checks if the user reacted to a message, with the provided 'emoji'.

πŸ§™β€β™‚οΈ 'true' means the user did react with the emoji, otherwise 'false' is returned.

Usage

$userReacted[channelID;messageID;userID;emoji]

Breakdown

  • channelID - The channel where the message is located.
  • messageID - The message to check the reactions for.
  • userID - The user that should of reacted.
  • emoji - The emoji that the user should of reacted with.

Example

$nomention
$userReacted[$channelID;9213992398838926;3894834783463753;πŸ§™β€β™‚οΈ]

example

$userRoles

Returns a user's roles.

Usage

$userRoles[userID]

Breakdown

  • userID - The user to return the roles for.

Example

$nomention
$description[<@$mentioned[1;yes]>'s roles: 
$userRoles[$mentioned[1;yes]]]

example

$varExistError

Returns a custom error if a certain variable doesn't exist.

Usage

$varExistError[variableName;errorMessage]

πŸ§™β€β™‚οΈ This function is useful when posting codes in the #wikis channel, so users don't forget to create the needed variables.

Breakdown

  • variableName - The variable that should exist.
  • errorMessage - The custom error message to return if the variable doesn't exist.

Example

$nomention
$varExistError[Cool;Add the 'Cool' variable in the app.]
$setUserVar[Cool;true;$authorID]
You are now cool!

example

$variablesCount

Returns how many of a certain variable type the bot has.

Usage

$variablesCount[variableType (user/server)]

Breakdown

  • variableType - The variable type to return the count for.

Example

$nomention
$variablesCount[server]

example

$year

Returns the current year.

πŸ§™β€β™‚οΈ You can use $time to change the timezone.

Usage

$year

Example

$nomention
Current Year: $year

example

Introduction

Bot Designer for Discord's premium points systems allows you to support the developers financially, and gain some sweet perks!

Purchasing Premium Points

#1: Click the menu icon.

#2: Select the "Premium" tab.

#3: Click "Go to premium store".

#4: Make your purchase! ✨

Retrieving Premium

After buying premium point(s), here's how you use them:

#1: Select the bot that you want to add premium point(s) to, via the bot list.

#2: Click the menu icon.

#3: Select the "Premium" tab.

#4: Select the amount of point(s) you want to add to the bot, then confirm. Keep in mind, one premium point equals one week of premium hosting.

Premium Perks

Main

  • $getServerVar[] in triggers. (custom prefixes)
  • Awaited reactions.
  • The $messageContains[] and $alwaysReply callbacks.
  • Custom images.
  • The $ignoreTriggerCase function.
  • Unlimited commands/variables.
  • Ad-free hosting time.
  • Priority bot hosting/startup.

Discord Server Perks

  • The premium role. Run !getPremiumRole.
  • Access to the premium chat.
  • Additional role income in our server economy system.

Guides

Support

Support for paying users is available at premium-support@mail.botdesignerdiscord.com. You can also ask questions about premium in our Community Discord Server.

Introduction

Bot Designer for Discord's premium points systems allows you to support the developers financially, and gain some sweet perks!

Purchasing Premium Points

#1: Click the menu icon.

#2: Select the "Premium" tab.

#3: Click "Go to premium store".

#4: Make your purchase! ✨

Retrieving Premium

After buying premium point(s), here's how you use them:

#1: Select the bot that you want to add premium point(s) to, via the bot list.

#2: Click the menu icon.

#3: Select the "Premium" tab.

#4: Select the amount of point(s) you want to add to the bot, then confirm. Keep in mind, one premium point equals one week of premium hosting.

Premium Perks

Main

  • $getServerVar[] in triggers. (custom prefixes)
  • Awaited reactions.
  • The $messageContains[] and $alwaysReply callbacks.
  • Custom images.
  • The $ignoreTriggerCase function.
  • Unlimited commands/variables.
  • Ad-free hosting time.
  • Priority bot hosting/startup.

Discord Server Perks

  • The premium role. Run !getPremiumRole.
  • Access to the premium chat.
  • Additional role income in our server economy system.

Guides

Support

Support for paying users is available at premium-support@mail.botdesignerdiscord.com. You can also ask questions about premium in our Community Discord Server.

Awaited reactions

(for premium bots)

Thanks to awaited reactions your bot can be triggered by reactions

end result

Here's how the end result looks like.

accept command

accept command

$awaitReactions[awaited reaction name;reaction] is used to specify which command is used when user reacts with reaction.
$awaitReactions[] allows you to group reactions (as you can see in the accept command) by specifing more awaited reaction names and reactions. What does it mean?
When one of the reactions is used then the other one stops working. So for example if I react with βœ”οΈ then ❌ stops working.

Awaited reaction trigger

Here you can see the acceptCmd and declineCmd awaited reaction commands:

acceptCmd
acceptCmd

$reaction[name]. As you can see it's pretty straightforward.
If you want to know what emoji was used in the $reaction[] trigger command
then you can use $usedEmoji which will return the emoji that was used.

Custom Images

(for premium bots)

Upload custom images in the app from your device, no image links required! Then, you can use the custom image as a embed image using $customImage[].

Uploading

⚠️ This feature is only for premium bots. ⚠️

#1: Select your bot.

#2: Click the menu icon.

example1

#3: Select the "Custom images" tab.

example2

#4: Click the "Add image" button.

example3

#5: Provide a image name and tag. The tag is used in $customImage[] to get the image. The name can be anything.

example4

#6: Upload your image.

example5

#7: Save your changes.

example6

Function

The $customImage[] function is used to get the uploaded image.

Usage

$customImage[imageTag]

Breakdown

  • imageTag - The tag that you set this custom image to, previously.

Example

$nomention
$customImage[NiceImage]

ex

Custom Prefixes

(for premium bots)

Explanation

Premium gives you access to use $getServerVar[] in triggers. This makes it possible to make custom prefixes.

What Are Custom Prefixes?

Custom prefixes allow the bot's prefix (like !) to be changed in different servers. For example, in one server the bot's prefix could be ! and in the other it could be ?.

How-To

  1. Create a variable called "prefix" with the value set to the bot's default prefix. The default prefix is the prefix the bot uses if no custom one is set.

image

  1. Create a command for setting the prefix, use the code below.
$nomention
$onlyAdmin[❌ You need the administrator permission to use that!]
$setServerVar[prefix;$noMentionMessage]
Set $serverName[$guildID]'s prefix to `$noMentionMessage`

image

  1. Change all the command triggers to $getServerVar[prefix]trigger-here. For example, !ping would become $getServerVar[prefix]ping.

  2. You're all set, enjoy!

image

$alwaysReply

(for premium users) Triggered whenever a user sends a message.
$alwaysReply is a callback, which means it's used in the command trigger (not the code). The command is ran when a user sends a message.
It's useful when creating leveling, auto-moderation, or message counting systems.

$ignoreTriggerCase

(for premium bots)
$ignoreTriggerCase is a function that makes the command trigger not case sensitive. For example, !help and !HeLp would both work.

Usage

$ignoreTriggerCase

Example

$nomention
$ignoreTriggerCase
Hello World!

$messageContains

(for premium bots)
$messageContains[] is a callback that allows you to create a trigger with multiple phrases. In addition, the bot also looks for those phrases anywhere in the author's message. This feature is great for creating a auto-response or auto-moderation system.

Usage

$messageContains[phrases]

Breakdown

  • phrases - The phrases/words the bot checks for. Separate phrases using ;.

Example

a. Make the command trigger $messageContains[].
b. Put text in the reply message/code.

example

Now, let's say in chat someone typed: Hello Bot!, Hello, Hey Everyone!, Hi Noituri, etc. The bot would respond with "Hello there! How are you?".

JavaScript

(for advanced users)

Index

Notes

  • Bot Designer for Discord allows you to use JavaScript (ES2015).
  • Discord's API is not fully supported yet but there will be more extensive support in the future.
  • Callbacks don't support JavaScript at the moment.

Accessing JavaScript

1: Go to user settings in the BDFD app, and enable "Features for Advanced Users".

jswiki1

jswiki2

2: After to creating a new command, set the Scripting Language to "JavaScript".

jswiki3

jswiki4

Available Objects in Commands

NameTypeDescription
messagestringContains author's message.
commandPrefixstringContains the trigger of this command.
authorIdstringContains the ID of the user that executed this command.
channelIdstringContains channel ID where the command was used.
userMentionsarray of string valuesContains user mentions.
roleMentionsarray of string valuesContains role mentions.

Supported API Functions

NameDescription
setResponse(replyText)Where replyText is a string value. Sends a message to the channel where the command was used.
setEmbedResponse(title, description, footer)Where title, description, footer are string values. Sends a embedded message to the channel where the command was used.
setEmbedImage(imageURL)Where imageURL is a string value. Sets image of the embedded message.
ban(userID)Where userID is a string value. Bans a user.
banWithReason(userID, reason)Where userID and reason are string values. Bans a user with reason.
unban(userID)Where userID is a string value. Unbans the user.
kick(userID)Where userID is a string value. Kicks a user.
kickWithReason(userID, reason)Where userID and reason are string values. Kicks a user with reason.
giveRole(userID, roleID)Where userID and roleID are string values. Gives a role to the user.
takeRole(userID, roleID)Where userID and roleID are string values. Removes a role from the user.
channelTyping()Shows "Bot is typing..." message.
createChannel(name, type)Where name and type are string values (type must be text or voice). Creates a channel. Providing wrong type will result in throwing an exception which you can catch.
removeChannel(channelID)Where channelID is a string value. Deletes a channel.
pinMessage(channelID, messageID)Where channelID and messageID are string values. Pins a message.
unpinMessage(channelID, messageID)Where channelID and messageID are string values. Unpins a pinned message.
sendChannelMessage(channelID, message)Where channelID and message are string values. Sends message to the provided channel.

Example

(say command)

var text = message.replace(commandPrefix, " ") // Makes 'text' the user's message without the command trigger.
setResponse(text) // Sets the response as 'text'.

image

JavaScript

(for advanced users)

Index

Notes

  • Bot Designer for Discord allows you to use JavaScript (ES2015).
  • Discord's API is not fully supported yet but there will be more extensive support in the future.
  • Callbacks don't support JavaScript at the moment.

Accessing JavaScript

1: Go to user settings in the BDFD app, and enable "Features for Advanced Users".

jswiki1

jswiki2

2: After to creating a new command, set the Scripting Language to "JavaScript".

jswiki3

jswiki4

Available Objects in Commands

NameTypeDescription
messagestringContains author's message.
commandPrefixstringContains the trigger of this command.
authorIdstringContains the ID of the user that executed this command.
channelIdstringContains channel ID where the command was used.
userMentionsarray of string valuesContains user mentions.
roleMentionsarray of string valuesContains role mentions.

Supported API Functions

NameDescription
setResponse(replyText)Where replyText is a string value. Sends a message to the channel where the command was used.
setEmbedResponse(title, description, footer)Where title, description, footer are string values. Sends a embedded message to the channel where the command was used.
setEmbedImage(imageURL)Where imageURL is a string value. Sets image of the embedded message.
ban(userID)Where userID is a string value. Bans a user.
banWithReason(userID, reason)Where userID and reason are string values. Bans a user with reason.
unban(userID)Where userID is a string value. Unbans the user.
kick(userID)Where userID is a string value. Kicks a user.
kickWithReason(userID, reason)Where userID and reason are string values. Kicks a user with reason.
giveRole(userID, roleID)Where userID and roleID are string values. Gives a role to the user.
takeRole(userID, roleID)Where userID and roleID are string values. Removes a role from the user.
channelTyping()Shows "Bot is typing..." message.
createChannel(name, type)Where name and type are string values (type must be text or voice). Creates a channel. Providing wrong type will result in throwing an exception which you can catch.
removeChannel(channelID)Where channelID is a string value. Deletes a channel.
pinMessage(channelID, messageID)Where channelID and messageID are string values. Pins a message.
unpinMessage(channelID, messageID)Where channelID and messageID are string values. Unpins a pinned message.
sendChannelMessage(channelID, message)Where channelID and message are string values. Sends message to the provided channel.

Example

(say command)

var text = message.replace(commandPrefix, " ") // Makes 'text' the user's message without the command trigger.
setResponse(text) // Sets the response as 'text'.

image

Callbacks

Callbacks in BDFD are functions for triggers which are executed when a certain action is preformed. These actions include banning, unbanning, user joining, user leaving, and more. Callbacks are not used in the command code, they are used in the command trigger. This section will explain the various callbacks you can use.

Callbacks

Callbacks in BDFD are functions for triggers which are executed when a certain action is preformed. These actions include banning, unbanning, user joining, user leaving, and more. Callbacks are not used in the command code, they are used in the command trigger. This section will explain the various callbacks you can use.

$onJoined

When a user joins the server, the command is triggered.
$onJoined[channelID] is a callback, which means it's used in the command trigger (not the code). The command is ran when a user joins the server. You must replace 'channelID' with a valid channel ID.

Example

#1: Make the command trigger $onJoined[channelID].

example1

#2: Input your code/reply text.

πŸ§™β€β™‚οΈ You can use functions like $username, $authorAvatar, $authorID, $membersCount, $serverName[$guildID] here.

example2

#3: Now you have a welcome message! ✨
example3
Not Working? Check out the Troubleshooting section.

Troubleshooting

Is $onJoined bugged or not working?

#1: You must have atleast version 1.17.9 of the app.

#2: Go to Discord Developer Portal, go to your bot's page, and enable Member Intents.
image
image

#3: Open app and go to bot settings, then enable Member Intents.
image
image
image

Note: Enabled intents in the app should reflect the intents enabled in the Discord Developer Portal.
For example: If you have members intent enabled in the Discord Developer Portal then you should respectively enable them in the app (unless you don't want to use them at all).

#4: Make sure $onJoined[channelID] is inputted in the 'command trigger' field, not the code.
image

#5: Make sure your bot has the VIEW_CHANNEL, EMBED_LINKS, SEND_MESSAGES permission in the channel provided in $onJoined[], and that you inputted a valid channel ID.

Advanced

Per-Server $onJoined

Both free and premium users can use $onJoined[], and all users can put $getServerVar[] within $onJoined[]. However, non-premium users can not use $getServerVar[] outside of callbacks.
If you own a public bot and want to make it so multiple different servers can use $onJoined[] (e.g. set their own welcome channel), follow these steps:

#1: Make a variable named "welcome" and the value set to nothing.
image

#2: Make a command for setting the welcome channel, then put the following in your code:

$nomention
$onlyAdmin[You need the admin permission to use that!]
$argsCheck[>1;Please mention a channel!]
Welcome channel updated!
$setServerVar[welcome;$mentionedChannels[1]]

Note: Servers will need to setup the channel they want the welcome message to send to (by running a command with the code above).

#3: Now replace $onJoined[channelID] in your welcome command trigger, with $onJoined[$getServerVar[welcome]] and you're all set!

$onLeave

When a user leaves the server, the command is triggered.
$onLeave[channelID] is a callback, which means it's used in the command trigger (not the code). The command is ran when a user leaves the server. You must replace 'channelID' with a valid channel ID.

Example

#1: Make the command trigger $onLeave[channelID].

example1

#2: Input your code/reply text.

πŸ§™β€β™‚οΈ You can use functions like $username, $authorAvatar, $authorID, $membersCount, $serverName[$guildID] here.

example2

#3: Now you have a leave message! ✨
example3
Not Working? Check out the Troubleshooting section.

Troubleshooting

Is $onLeave bugged or not working?

#1: You must have atleast version 1.17.9 of the app.

#2: Go to Discord Developer Portal, go to your bot's page, and enable Member Intents.
image
image

#3: Open app and go to bot settings, then enable Member Intents.
image
image
image

Note: Enabled intents in the app should reflect the intents enabled in the Discord Developer Portal.
For example: If you have members intent enabled in the Discord Developer Portal then you should respectively enable them in the app (unless you don't want to use them at all).

#4: Make sure $onLeave[channelID] is inputted in the 'command trigger' field, not the code.
image

#5: Make sure your bot has the VIEW_CHANNEL, EMBED_LINKS, SEND_MESSAGES permission in the channel provided in $onLeave[], and that you inputted a valid channel ID.

Advanced

Per-Server $onLeave

Both free and premium users can use $onLeave[], and all users can put $getServerVar[] within $onLeave[]. However, non-premium users can not use $getServerVar[] outside of callbacks.
If you own a public bot and want to make it so multiple different servers can use $onLeave[] (e.g. set their own leave message channel), follow these steps:

#1: Make a variable named "leave" and the value set to nothing.
image

#2: Make a command for setting the leave channel, then put the following in your code:

$nomention
$onlyAdmin[You need the admin permission to use that!]
$argsCheck[>1;Please mention a channel!]
Leave channel updated!
$setServerVar[leave;$mentionedChannels[1]]

Note: Servers will need to setup the channel they want the leave message to send to (by running a command with the code above).

#3: Now replace $onLeave[channelID] in your leave command trigger, with $onLeave[$getServerVar[leave]] and you're all set!

$onBanAdd

Triggered when a user gets banned from the server.
$onBanAdd[channelID] is a callback, which means it's used in the command trigger (not the code). The command is ran when a user is banned from the server. You must replace 'channelID' with a valid channel ID or a server variable that holds the channelID ($getServerVar[]).

Example

#1: Make a command with $onBanAdd[channelID] as the trigger.

πŸ§™β€β™‚οΈ You must replace 'channelID' with a valid channel ID!

example1

#2: Input your code/reply text.
example2

#3: Now you have a ban message! ✨
example3

$onBanRemove

Triggered when a user gets unbanned from the server.
$onBanRemove[channelID] is a callback, which means it's used in the command trigger (not the code). The command is ran when a user is unbanned from the server. You must replace 'channelID' with a valid channel ID or a server variable that holds the channelID ($getServerVar[]).

Example

#1: Make a command with $onBanRemove[channelID] as the trigger.

πŸ§™β€β™‚οΈ You must replace 'channelID' with a valid channel ID!

example1

#2: Input your code/reply text.
example2

#3: Now you have a unban message! ✨
example3

$onMessageDelete

Triggered when a user deletes a message.
$onMessageDelete[channelID] is a callback, which means it's used in the command trigger (not the code). The command is ran when a user deletes a message. You must replace 'channelID' with a valid channel ID or a server variable that holds the channelID ($getServerVar[]).

Example

#1: Make a new command, with the trigger $onMessageDelete[channelID].

πŸ§™β€β™‚οΈ Replace 'channelID' with a valid channel ID!

example1

#2: Set the code/reply text.
example2

#3: Now the bot will send a message when someone deletes a message! ✨
example3

$onInteraction

Triggered upon an interaction being emitted (e.g. a button being clicked).

Usages

  • $onInteraction - Command runs upon any interaction being emitted.

Note: $onInteraction (without brackets) shall only be used once. As it replies directly to the Discord's interaction event--once it processes the data, such data becomes invalid.

  • $onInteraction[customID] - Command runs upon the provided 'customID' being clicked/selected/interacted with.

Custom IDs

Components (e.g. buttons and select menus), must have a custom ID. This property is defined by the developer when using $addButton[], $newSelectMenu[], etc. For example, if you set customID to click_me on a button, in $onInteraction[] you'd put click_me: $onInteraction[click_me]. Alternatively, you can use $onInteraction (without brackets) with if statements and $customID:

$if[$customID==click_me]
Hello!
$c[Bot replies with "Hello" when the 'click_me' button is clicked by a user.]
$endif

πŸ§™πŸΌβ€β™‚οΈ Using $onInteraction (with brackets) can help save command space.

Custom IDs must be unique per component, multiple buttons on the same message must not share the same custom ID. Custom ID is a string of max 100 characters.

Custom IDs may also be referred to as interaction IDs.

Examples