Foreword

✨ Imagine An App…

…That makes building Discord bots easy with beginner-friendly functions. An app 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. You’re currrently viewing Bot Designer for Discord’s wiki.

📂 Wiki Index

Want to contribute to the wiki?

Head over to the GitHub repository contribution file and learn how you can help out!

Changelog

2024

July

  • Added $setUserRoles[]
  • Added $getLeaderboardPosition[]
  • Added $isBooster[]
Previous Updates

June

  • Added $ai[]
  • Added $aiQuota

March

  • Fixed the bot sometimes duplicating its answer
  • Fixed $onlyForIDs[] not working correctly on big nodes

2023

June

  • Fixed custom images not always being displayed
  • Allowed for empty string values in $jsonSetString[]
  • Added $jsonArraySort[]
  • Added $jsonArrayReverse[]
  • JSON Array function now can interact with JSON root
  • Emoji argument now allows for emoji aliases
  • Added $nodeVersion[]
  • Added $removeEmoji[]
  • Added $addMessageReactions[]
  • Fixed $nickname[] to work with the new Discord username system
  • Added $displayName[]
  • Added $userBadges[]
  • Added $userBannerColor[]
Previous Updates

May

  • Fixed $min[] and $max[] not working with floats

April

  • Fixed caching timeout information

March

  • Fixed callbacks not always getting detected
  • Fixed JSON functions inability to correctly return an object
  • Fixed $jsonArrayPop[] and $jsonArrayShift[] only working once on an array
  • Fixed a bug where $jsonArrayPop[] and $jsonArrayShift[] would stop execution when trying to operate on an empty array
  • Fixed $round[] adding trailing zeros
  • Added $removeAllComponents

February

  • Fixed caching issues for leaderboards
  • Added $jsonArrayShift[]
  • Added $jsonArrayUnshift[]
  • Added $jsonArrayPop[]
  • Added $jsonJoinArray[]

January

  • Added $jsonParse[]
  • Added $jsonClear
  • Added $jsonStringify
  • Added $jsonPretty[]
  • Added $json[]
  • Added $jsonExists[]
  • Added $jsonSet[]
  • Added $jsonArray[]
  • Added $jsonArrayAppend[]
  • Added $jsonArrayCount[]
  • Added $jsonUnset[]
  • Added $disableInnerSpaceRemoval
  • Fixed big numbers not working in leaderboard functions
  • Added Emoji argument type
  • Added $isTicket[]
  • Added $userBanner[]
  • Added $randomGuildID
  • Added $randomRoleID[]
  • Added $randomCategoryID[]
  • Added $channelNames[]
  • Added $categoryChannels[]
  • Fixed $allowUserMentions[] not working on slash commands
  • Fixed $addTextInput[] not working with empty values
  • Added $jsonSetString[]
  • Added $jsonArrayIndex[]

2022

December

  • Added limit on input numbers to 2128 on the basic math functions
  • Fixed BDScript 2 having problems with handling unicode characters
  • Fixed $stop causing undefined behaviour
  • Added $getBanReason[]
  • Fixed caching issues for the text splitting functions
  • Fixed issues with custom images
Previous Updates

November

  • Deprecated $userJoinedDiscord[] in favor of $creationDate[]
  • Added Format argument to $creationDate[]
  • Added $editSplitText[]
  • Added $serverEmojis[]
  • Added $setChannelVar[]
  • Added $getChannelVar[]
  • Added $resetChannelVar[]
  • Added channel option to $variablesCount[]
  • Fixed BDScript 2’s escaping not working in some cases

October

  • Added $publishMessage[]
  • Made $useChannel[] work with message components
  • Added $channelPosition[]
  • Added $categoryID
  • Added $varExists[]
  • Added $boostCount
  • Added $categoryCount
  • Added $isTimedOut[]
  • Added stage and forum channel types to $createChannel[]
  • Added stage, announcement, and forum channel types to $channelType[]
  • $enableDecimals[] now works with $calculate[]
  • Added $getCustomStatus[]
  • Added $httpStatus
  • Added $httpGetHeader[]
  • Added $botOwnerID
  • Added $repliedMessageID
  • Fixed the guild list fetching issue
  • Added $parentID

September

  • Added channelID field to $awaitFunc[]
  • Added $trimContent
  • Fixed fetching guilds not always working in the app
  • Added $slashID
  • Fixed slash command reordering
  • Added intent autodetection
  • Added globaluser option to $variablesCount[]
  • Added support for big numbers in the math functions
  • Added new text tutorial
  • Fixed $checkUserPerms[] ignoring channel permissions
  • Fixed $addReactions[] not working on slash commands
  • Fixed Ticket number argument not working in $newTicket[]
  • Fixed $httpAddHeader[]
  • Fixed some callbacks not being detected as callbacks
  • Fixed attachments not working in slash commands

August

  • Added $scriptLanguage
  • Fixed $stop breaking $if[]
  • Renamed $customImage[] argument to Custom image tag
  • Added $hypesquad[]
  • Added $dmChannelID[]
  • Fixed the app’s max choices limit
  • Fixed $registerGuildCommands[] removing previously registered commands
  • Fixed $reply not working in DMs
  • Made it possible to return milliseconds and nanoseconds in $getTimestamp[]
  • Fixed $addTextInput[] not verifying max length
  • Fixed $url[] returning an error when no input was provided
  • Added $userServerAvatar[]
  • Fixed $cropText[] not supporting unicode
  • Not putting required slash command options on top no longer breaks the commands

July

  • Added hex to the color picker
  • Fixed $executionTime not working inside embed fields
  • App now sends notification when bot hosting is expired
  • Added $sendNotification[] for premium bots
  • Made it possible to use only one option in a select menu
  • Fixed $editChannelPerms[]
  • Fixed verification of slash command names
  • Fixed $sort not working with -1 as return amount

June

  • Fixed $onlyBotChannelPerms[]
  • Fixed description verification in $addSelectMenuOption[] and $editSelectMenuOption[]
  • Updated limits of select menu options
  • Fixed updating components which are refering to $messageID

May

  • Fixed token issues
  • Fixed disappearing slash command options
  • AllowedMentions field is now used in $channelSendMessage[], $sendEmbedMessage[] and $sendMessage[]
  • Fixed black screen after bot creation
  • Fixed in-app tutorial
  • Fixed escaping response in interactions
  • Fixed cooldown error messages
  • Fixed empty values in variables not getting saved
  • Fixed userID being ignored when guildID is passed to $getUserVar[]

April

  • Added "return ID of the ticket message" argument to $newTicket[]
  • Fixed disappearing slash commands from the app’s state

March

  • Added $toTitleCase[]
  • Fixed invite permission calculator
  • Fixed $suppressErrors[] and $embedSuppressErrors[] getting ignored by components errors
  • Fixed updating some components
  • Added $registerGuildCommands[]
  • Added $unregisterGuildCommands[]
  • Added /callback_list, /callback_tag_list, and /callback/:callback_tag endpoints to public BDFD API

February

  • $httpResult[] can return JSON now
  • Fixed $httpResult[] not working with multiple requests
  • Saving a command in the webapp no longer restarts the bots
  • Optimized slash commands resynchronization
  • Fixed custom images not working after saving a command
  • Made it possible to escape \ by using \\
  • Removed user permission check for $ban[], $banID[], $unban[] and $unbanID[]
  • Added $newModal[]
  • Added $addTextInput[]
  • Added $input[]
  • Deprecated $channelIDFromName[], use $channelID[] instead
  • Added $onlyForCategories[]
  • Fixed $modifyChannelPerms[] ignoring last permission
  • Added $onAutoComplete[] callback
  • Added $autoCompleteOptionName
  • Added $autoCompleteOptionValue
  • Added $appendOptionSuggestion[]

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
Previous Updates

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[] and $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 an 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 script language
  • Added to BDScript 2:
    • $try, $catch and $error
    • $eval[]
    • $optOff[]
    • $stop[]
    • $var[]
  • 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[] to 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[]

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 an 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 a problem with statuses not showing up
  • Fixed an 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 is now returned instead of everyone 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 $resetUserVar
  • 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
  • Fixed $userID[] to 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[]
  • Added multi-line support 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 multi-line support for $textSplit[]
  • Fixed brackets in $username

2019

December

  • Fixed high ping issues
  • Fixed whole bunch of other issues
  • Added to JS:
    • 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
Previous Updates

November

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

If you want to access this changelog externally, we have a JSON version of the changelog to which you can send a GET request and work with a JSON document further.

Terms of service

Your use of our service (“Bot Designer for Discord”) implies that you agree to the Terms stated on this page, and these Terms will remain in effect while you use the service.

Context and Reference

  • Bot Designer for Discord” refers to “our service”.

  • “our service” refers to the mobile application, “web app”, and any other related product or service that Bot Designer for Discord provides. It should be noted that Bot Designer for Discord is a service provided by company NilPointer Software.

  • “web app” refers to our web panel (the “web app” is accessible via most major web browsers) from which users may modify their bot(s) and/or account.

  • “template store” refers to the platform which Bot Designer for Discord’s mobile application provides. It serves as a way for users to share and use bot command code(s).

  • “bot” refers to a user’s Discord Bot. A “(bot) command” is a certain order which can be called by a user (a “user” referring to anyone that has access, not just a user of our service in this case) typically in a Discord text or DM channel.

  • “using our service” refers to having the application installed on your device, being logged in to our web app, or accessing any related product or service. If you use our service, you are considered a “user”. When the phrase “user” is utilized in these Terms; it refers to an individual using our service (unless stated otherwise).

  • “spam” refers to an action that’s repeated in mass form.

  • “Premium Points” are our in-app currency which users can buy via the premium points store. A premium point grants the user one week of premium-hosting for a singular bot, which allows for some extra functionalities that the app provides for said amount of time. For premium-hosted bots, we do guarantee 90% of uptime per week. If it is less, the user (after contacting support), will receive some sort of compensation (e.g. Premium Points) if applicable.

  • “promo codes” or “promocodes” are codes (randomized text) that transfer into bot hosting time. Promo codes can be earned by winning an event, giveaway, or Discord Nitro Boosting our Discord Server.

  • Users can get free bot hosting time by watching advertisements; using the one-time hosting without-AD button; using Premium Point(s); or by receiving a hosting time promo code.

  • “bug” refers to unintended behavior happening, often these “bugs” can be observed by users.

  • “token” refers to a Discord Bot Token, a token is essentially a password (and should be treated as such) which grants full access to the bot.

  • “ban” refers to a user of our service being temporarily or permanently suspended from using our service.

  • “warn”/“warning” refers to a user of our service being notified that they neglected to comply with one or more of our Terms.

Terms

  1. You agree that you will not contribute any content/actions that use our service or interact with our service in a manner that:

    1. is dangerous, harmful, fraudulent, deceptive, threatening, harassing, defamatory, obscene, or otherwise objectionable.

    2. is any form of “spam”, or any processes that interfere with Bot Designer for Discord’s services. As an example, mass creating or modifying your bot(s) with the intent of crashing or otherwise harming the service.

    3. infringes or violates the intellectual property rights or any other rights of anyone else, including ours.

  2. You agree to not decompile or modify our software in any way. We may take legal steps if we detect these actions.

  3. You understand that we reserve the right to warn/ban users of our service, for any reason and without previous notice; even if the user isn’t directly violating our Terms. You also understand, we may ban any user that breaks Discord’s Terms of Service and/or Discord’s Community Guidelines.

  4. You agree not to spam or overuse our computing/storage resources.

  5. You agree not to resell your Bot Designer for Discord account, “Premium Points”, or “promo codes”.

  6. You agree not to exploit a detected bug. It should be sent as a report to the developers instead.

  7. You agree to cope with any applicable limitations that Bot Designer for Discord has. This includes the 2,399 guild limit per bot. We do not guarantee any amount of uptime (for non-premium hosted bots), however hosting is our best effort.

  8. You understand that prices for Premium Points should, but may not include; sales and use taxes. If they do not, the user is responsible for the payment of such taxes related to the purchase.

  9. When submitting or using Bot Designer for Discord’s “Template store” feature, you are agreeing to the Template Store Terms.

  10. You agree to our Privacy Policy.

  11. You agree to first contact support before reversing your payment method if you have purchased Premium Points.

  12. You agree we shall not be held liable for users that abuse our service to perform malicious, or otherwise unlawful ventures. However, as stated previously in these Terms; we do uphold the right to warn/ban in these circumstances.


We reserve the right to change, modify, add, or remove portions of our Terms at any time, and you will still be expected to comply. It is recommended to check this page periodically for changes.

We may warn/ban users if we discover they didn’t comply with these Terms.

All your usage and access to our service is subject to these stated Terms, if you do not agree with them, you shall not use the service.

In case we change our Terms, if you don’t agree with the new Terms, you are free to reject them by no longer using our service.

Registered users may withdraw their data through the mobile application, and request the deletion of data by contacting support.

Contact

If you have questions/concerns about these Terms or our service, you may contact us via email.

Support for regular users is available at support@mail.botdesignerdiscord.com and for paying users at premium-support@mail.botdesignerdiscord.com.

Context

  • Bot Designer for Discord is a service provided by NilPointer Software.
  • “Our service” refers to “Bot Designer for Discord”.
  • “Bot” refers to data held by BDFD describing the behaviour of a Discord Bot on our service.
  • “Hosting time” refers to the time duration left of a singular bot during which it will be hosted by our service.
  • “Premium point” refers to BDFD premium in-app currency, granting users the ability for bots to have extended functionality for a limited time.
  • “Premium time” refers to the time duration left for a singular bot during which it can access the extended functionality. Premium time is related, but not strictly linked, with hosting time. Premium time might end before hosting time, but not vice-versa.
  • “Promocode” or “promo code” refers to a randomly generated string of characters used to gain hosting or premium time.
  • “BDFD entity” or “entity” refers to any piece of data that is being held by BDFD, that ownership of it or itself can be transferred. In this policy, “entity” mainly refers to bots, hosting and premium time, and premium points.
  • “Transfer request” refers to a request made by a user to BDFD developers for an entity transfer. These requests can be made through a ticket on our official Discord server.

Policy

  • Entities that can be transferred can only be transferred through a transfer request by the user that holds ownership of that entity.

  • Requesting users must provide proof of ownership of the entities in question for the request to be granted.

  • BDFD Accounts can not be transferred in any way.

  • Bots can only be transferred between BDFD accounts owned by a single user.

  • Bot after its transfer retains any hosting or premium time the bot in question had left.

  • A bot previously not assigned to any BDFD account can be transferred to an account of the user that holds ownership over the bot in question.

  • Premium points can be transferred between BDFD accounts owned by a single user.

  • Premium points can be donated for a giveaway promotion on our official Discord server.

  • Hosting and Premium time can only be transferred between bots owned by a single user.

  • Hosting and Premium time can not be transferred to a promocode.

  • Only premium time can be donated for a giveaway promotion on our official Discord server.

Guides

In this section, you’ll find guides that contain helpful tutorials on certain elements of the app. These contain example codes and images to help explain functions and their usages.
Here you can learn how to create your first BDFD bot, as well as how to use functions such as select menus, buttons, and more!

Beginning

In this guide, you will learn how to create your own bot using BDFD.

Content

Functions Used > Creating > Inviting > First Code > Bot Online > Test it!

Functions Used

Step 1: Creating

  • Go to Discord Developer Portal.
  • Click on the “New Application” button and provide a name for your application.
  • In top-left corner, click on the hamburger icon () and select the “Bots” tab.
  • Once done, press the “Reset Token” button and copy your bot token.

Never share your Discord bot token with anyone. Learn more

  • Now, open your BDFD app (If you haven’t installed the app yet, head over to Play Store/App Store and download it) and press “Create New Bot”.

Make sure that when you are creating a new bot, your Discord account is signed into the BDFD app. This is so that you don’t lose access to your bot in the future.

  • Enter your bot’s name and its token (the one that you copied earlier from the Discord Developer Portal).
  • If you have a share code, toggle on “Use share code” and put the code into the text field.
  • After agreeing to the Terms of Service of both BDFD & Discord, press “Create bot” to create your Discord bot.

Step 2: Inviting

  • Open the BDFD app and select your bot.
  • Click on the “Invite bot to server” button.
  • Press the “Edit invite link permissions” button and choose the permissions that the bot will have when joining a server.
  • Then, click on “Add your bot to your server” and select the server.
  • Click on the “Continue” button and your bot will be added to the selected server.

Step 3: First Code

To create the first command, you must click on the “Commands” tab after selecting your bot and press on the “+ Command creator”. You will see 3 categories (“Command Name”, “Command Trigger”, “Template Functions”).

  • Come up with a name for your command and paste it into the “Command Name” field. (You can leave it blank).
  • Now come up with a trigger for the command. (Example: !ping).

It is important that the trigger of the command matches its meaning.

After completing the command setup, press the “Create Command” button. Now you can create your first code! In “Reply Message” you can paste this code:

$nomention
Pong!
  • Click on “Save command” to save the code.

Step 4: Bot Online

Method 1 - 30 Minutes

  • Click on the “Dashboard” tab after selecting your bot and press on the “+ Add free hosting time” button.
  • Enter the indicated numbers and click “Confirm”.

Note: This method only works when your bot is offline.

Method 2 - 140 Minutes

  • Press on “Dashboard” tab after selecting your bot and click on “+ Watch ad for 140 minutes of free hosting time”.
  • After watching the ad, your bot will receive 140 minutes of hosting time.

Method 3 - Premium

  • Use premium points to get hosting time without watching ads.

If the bot is not online after these methods, then take a look at this page: Why my bot is offline?

Step 5: Test it!

Send a !ping command in a channel of the server you invited your bot to.

!ping Pong!

Bot Status

Here, you will learn how to set-up a custom bot status & activity.

Status

To set a custom status,

  • Select your bot.

  • Go to the “Status” tab and press gear icon ⚙️ at top-right corner.

  • Toggle on “Enable bot presence”.

  • In “Bot status”, choose your preferred bot presence (i.e Online, Idle, Invisible etc.)

  • In “Interval amount”, set a custom interval duration. This changes how many seconds your bot will wait before refreshing its status (Minimum interval duration is 12 seconds while maximum is 600 seconds).

    📝 If you have multiple bot status entries, it will switch to next status instead of refreshing current status.

Activity

⚠️ You need to toggle on Enable bot presence in “Bot status settings” in order to show activity.

To set custom rich presence,

  • Select your bot.
  • Go to the “Status” tab and press Add new entry.
  • Choose activity type (i.e PLAYING, STREAMING, LISTENING etc.) in the “Status prefix” dropdown selection.
  • In “Status”, type any text that you would like to display as your bot’s status. Additionally, you can also use some BDFD functions in your bot’s status.
  • “Status details” is just a text for you to see. It won’t display anywhere.
  • Save the changes.

📝 If the activity type is STREAMING, there will be an additional required field called “Streaming URL”. You can only put either YouTube or Twitch URL.

Available functions

Here are the available functions that you can use in your bot’s status:

  • $membersCount

    Returns your bot total members count.

  • $serverCount

    Returns your bot total server count.

  • $numberSeparator[number;(separator)]

    Separates numbers in thousands format.

Example

Screenshot_20220718_003851

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 when the command is executed, you can use functions like $ping and $message here.

image

Example

image

Output

!help !command1 - description...
!command2 - description...
etc

Gateway Intents

In this guide, you will learn about Discord’s Gateway Intents and how to enable them in BDFD.

What are Gateway Intents?

When a bot is connected to the Discord Gateway, it receives events on actions happening on Discord. Bots can receive a large amount of events from Discord, so in order to decrease the amount of events each bot receives, Discord requires bots to send Gateway Intents when connecting to the Gateway.
Gateway Intents allow to specify which events the bot wants to receive.

Gateway Intents can be further divided into:

For example, a bot needs to send the GUILD_MESSAGES standard intent and the MESSAGE_CONTENT privileged intent to receive the MESSAGE_CREATE event with the messsage content.

📚 Learn more about Gateway Intents here.

Privileged Gateway Intents

Privileged Gateway Intents are special intents which need to be manually enabled in your bot application settings. Due to their sensitive information nature, Discord disables them by default. You should only enable them when it is required.

Currently, there are only 3 privileged gateway intents:

📌 Verified bots require approval from Discord in order to enable these intents.

Presence Intent

Allows the bot to receive PRESENCE_UPDATE event. This intent is primarily used to allow for retrieval of user presences data. For example, Activities (i.e PLAYING, LISTENING), Presence (i.e Online, Idle) and Custom status.

The following functions require this intent:

Server Members Intent

Allows the bot to receive GUILD_MEMBER_ADD, GUILD_MEMBER_UPDATE, GUILD_MEMBER_REMOVE, and THREAD_MEMBERS_UPDATE events. This intent is primarily required to fetch the entire list of guild members, and to receive specific guild member info (like guild joining, leaving, profile update etc.).

The following callbacks require this intent:

Message Content Intent

Unlike the two intents above, Message Content Intent doesn’t allow for any new events. Instead, it allows the bot to receive message content data, which includes content, attachments, embeds, and components.

If your bot is based on prefix-based commands, then this intent is required. Otherwise, you will need to use slash commands instead.

📌 Without this intent, your bot can only read message content data in DMs, messages where your bot was mentioned, and it’s own messages.

The following functions/callbacks require this intent:

Enabling Privileged Gateway Intents

To enable Privileged Gateway Intents in your bot, follow these steps:

  1. Open your bot dashboard in the BDFD app (Make sure your app version is 2.2.2 or above).

  2. Click on the “Settings” tab, and then on “Go to gateway intents settings”.

  3. After that, click on “Change gateway intents on Developer Portal”.

  4. Select your required intents and save the changes.

    📌 The intents you have enabled in the Developer portal should be reflected in the BDFD app. If they aren’t, click on “Sync intents with Developer Portal settings”.

Example

Instruction

1

We will not be discussing about Standard Intents here, since it isn’t required and is auto-handled by BDFD internally. If you still want to learn more about it, feel free to check Discord Docs.

Variables

Introduction

Variables are how we store data in BDFD. Data can be assigned to users, servers, channels, 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 to “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/$getChannelVar.

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. Go to “Variables” tab.

    ex2

  3. Then, click “+ New variable” button.

    ex3

  4. Give the variable a name and value.

    ex4

  5. Finally, save the changes!

    ex5

Editing Variables

Here’s how you can modify an existing variable’s name/default value:

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

  2. Go to “Variables” tab.

    ex2

  3. Click the edit/pencil icon near the variable name that you want to edit.

    ex3

  4. Provide a new variable name and/or value.

    ex4

  5. Finally, save the changes!

    ex5

Deleting Variables

Here’s how you can delete variables:

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

  2. Go to “Variables” tab.

    ex2

  3. Select the variable you want to delete.

    ex3

  4. Finally, confirm the deletion!

    ex4

📌 Deleting variables might return error message in those commands which were using the deleted variables.

Global/Global-User Variables

$setVar/$getVar are global variable functions, which means they apply universally (i.e they don’t change per-server, per-channel, or per-user).
However, if you provide a user ID in the optional User ID parameter then it becomes a global-user variable.

Global-user variables value stay same with the user in every server. The usage of global-user variables looks like this:

  • $setVar[Variable Name;New Value;User ID]
  • $getVar[Variable Name;User ID]

Global Variables - Functions

  • $setVar[Variable Name;New Value]: Changes the provided global-variable’s value to ‘New Value’.
  • $getVar[Variable Name]: Gets the current value of the provided global-variable.

📌 Global variables are universal, meaning if the variable gets modified, the modification applies to everyone.

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[Variable Name;New Value;User ID]: Sets the provided variable to ‘New Value’ for the provided ‘User ID’.
  • $getVar[Variable Name;User ID]: Gets the provided variable’s value for the given ‘User ID’.

📌 Global-user variables stay with the user in every server. Unlike user variables which are unique 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[Variable Name;New Value;(User ID;Guild ID)]: Sets the provided variable to ‘New Value’ for the given ‘User ID’ and ‘Guild ID’, or the author of the command if no ‘User ID’ is provided and current guild if no ‘Guild ID’ is provided.
  • $getUserVar[Variable Name;(User ID;Guild ID)]: Gets the current value for the provided user variable. Returns the author’s variable value if no ‘User ID’ is provided and uses the current guild if no ‘Guild ID’ 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[Variable Name;New Value;(Server ID)]: Sets the provided variable to ‘New Value’ for the given ‘Server ID’, or the server that the command was ran in; if no ‘Server ID’ was provided.
  • $getServerVar[Variable Name;(Server ID)]: Gets the current value for the provided server variable. Returns the current server’s variable value if no ‘Server ID’ 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

Channel Variables - Functions

  • $setChannelVar[Variable Name;New Value;(Channel ID)]: Sets the provided variable to ‘New Value’ for the provided ‘Channel ID’, or the channel that the command was ran in; if no ‘Channel ID’ was provided.
  • $getChannelVar[Variable Name;(Channel ID)]: Gets the current value for the provided channel variable. Returns the current channel’s variable value if no ‘Channel ID’ is provided.

Channel Variables - Examples

Here’s the variable we’re working with:

ex

This command adds 1 uses to the ‘Uses’ variable value, everytime it is ran.

📌 The trigger for this command will be your bot’s prefix, example: !.

$nomention
This channel has now `$sum[$getChannelVar[Uses];1]` uses of the command.
$setChannelVar[Uses;$sum[$getChannelVar[Uses];1]]

ex

This command returns how many command uses the channel has currently.

$nomention
Command used `$getChannelVar[Uses]` times in this channel

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;11], $random[100;1001], 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;$getUserVar[Money;$mentioned[1]]];$mentioned[1]]

Adds money to the user running the command:

$setUserVar[Money;$sum[Amount;$getUserVar[Money]]]

Removes money to the mentioned user:

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

Removes money from the user running the command:

$setUserVar[Money;$sub[Amount;$getUserVar[Money]]]

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;11], $random[100;1001], 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.

BDScript 2

Introduction

BDScript 2 is the default in-app scripting language (as of October 2021). It has been created with intention of enhancing its capabilities and fixing some of the problems previous versions had.

The first edition of BDScript has one big issue, commands like $sum[$sum[3;2];1] didn’t work. The reason it didn’t work is because BDScript has a pre-defined order for executing functions.

In order to fix the issue, a new BDScript edition was developed called BDScript Unstable. It executes function in a command from bottom to top and from right to left. It fixes the issue, but the new edition has its quirks which could be problematic for some commands. That’s where BDScript 2 comes in. This edition executes commands from top to bottom and from left to right (basically, just the way you read most of the books).
Besides that, BDScript 2 has additional features like $eval[], $try and $catch and more.

Features

$eval[]

Evaluates the provided BDScript code. Read this for more information.

$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 Async Guide for more information.

$elseif

Read If Statements Guide for more information.

$var[]

Creates a temporary variable. Read this for more information.

$stop

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

$optOff[]

Executes functions with turned off optimizations. Read this for more information.

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.

Basics

  • Use $async[name] to start an async block. The name must be unique for each block. Functions inside async blocks run in the background without blocking the command’s thread.
  • Use $endasync to end the 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

Error Handling

In BDScript 2 you can handle errors returned by functions or limiters (such as $cooldown[] or $onlyIf[]).

Error Handling Functions

$try

Used to open the Error Handling block.

$endtry

Used to close the Error Handling block.

$catch

Used to create a sub-block between $try and $endtry that will contain the code that will be executed when an error occurs.

$error[]

Used in the $catch block to return error information.

Possible Arguments

  • command - returns the name of the function that returned the error.
  • message - returns the error message that was received.
  • source - returns the content of the line where the error occurred.
  • row - returns the number of the row in the code where the error occurred.
  • column - returns the number of the column in the code where the error occurred.

Examples

Function Error

$nomention

$try
  $color[FFFFFF]
  $title[Hi]
  $description[Some broken code;]
$catch
  $color[E74C3C]
  $title[Error Handling]
  $addField[Function:;$error[command]]
  $addField[Error:;$error[message]]
$endtry

Function Error

Limiter Error

As a way to use Error Handling with Limiter Errors, we’ll use $cooldown[]. With the help of Error Handling, we can make a nice cooldown error message.

To handle only the error of our limiter, we will use a temporary variable and if statements. If $cooldown[] returns an error, the value of the temporary variable will be set to true (in which case our nice error message will be sent).

Note: The error message argument in $cooldown[] must be left blank.

$nomention

$var[cooldownError;false]

$try
  $cooldown[3m;]
$catch
  $var[cooldownError;true]
$endtry

$if[$var[cooldownError]==false]
Hey $username, are you making an example for the guide?
$else
$color[E74C3C]
$author[Oops, $username!]
$authorIcon[$authorAvatar]
$title[You have a cooldown!]
$description[Come back <t:$sum[$getTimestamp;$getCooldown[normal]]:R>.]
$endif

Limiter Error Limiter Error

Buttons

In this section, you’ll learn how to use the button component.

Content

Functions Used > Button Style > Button Type > $addButton[] > $editButton[] > $removeButtons > $removeButtons[] > $removeComponent[] > Create Interaction

Functions Used

Button Style

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

  • primary - Blue button
  • secondary - Gray button
  • success - Green button
  • danger - Red button
  • link - Redirect button
Buttons: Primary Primary Success Success Danger Danger Secondary Secondary Other Buttons: Link Link Emoji

If link style is used, the button won’t send any interactions!

Button Type

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. A $onInteraction[ID] callback, will only 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 need to set their style argument value to link.

$addButton

Adds a button to the response message.

Syntax

$addButton[New row?;Interaction ID/url;Label;Style;(Disable?;Emoji;Message ID)]

Parameters

  • New row? (Type: Bool || Flag: Required): 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.

    A message can have a maximum of 25 buttons (5 rows of 5 buttons).

  • Interaction ID/URL (Type: String, URL || Flag: Required): Depending on the button type, you either set it to an Interaction ID which is then used in the $onInteraction[Interaction ID] or $onInteraction callback or a URL if it’s a link button.

You don’t need $onInteraction/$onInteraction[] for URL.

  • Label (Type: String || Flag: Emptiable): The text visible on the button.
  • Style (Type: Enum || Flag: Required): It’s used to specify the button’s background color. If the button has a link/url you have to set this value to link. Check this section for more details.
  • Disable? (Type: Bool || Flag: Vacantable): If set to yes the button can’t be pressed. Defaults as no.
  • Emoji (Type: Emoji || Flag: Vacantable): Adds an emoji inside the button. Emojis have to be either pasted as unicode or be in the following format <:emoji name:emoji ID>.
  • message ID (Type: Snowflake || Flag: Vacantable): Adds a button to the provided message ID. It’s important to note that provided message ID author has to be the bot.

Interactive buttons can’t have duplicated ID’s in the same message. So for example, you can’t have two buttons with the ID set to test.

If URL is used in Interaction ID/url argument, it has to start with http:// or https://

Example

$nomention
Hello
$addButton[no;test;Say hello!;primary;no;]
!example Hello Say hello!

$editButton

Edits an already existing button.

Syntax

$editButton[Interaction ID/URL;Label;Style;(Disable?;Emoji;Message ID)]

Parameters

  • Interaction ID/URL (Type: String, URL || Flag: Required): Depending on the button type, you either set it to an Interaction ID which is then used in the $onInteraction[Interaction ID] callback or a URL if it’s a link button.
  • Label (Type: String || Flag: Emptiable): The text visible on the button.
  • Style (Type: Enum || Flag: Required): It’s used to specify the button’s background color. If the button has a link/url you have to set this value to link. Check this section for more details.
  • Disable? (Type: Bool || Flag: Vacantable): If set to yes the button can’t be pressed. Defaults as no. (Optional)
  • Emoji (Type: Emoji || Flag: Vacantable): Edits an emoji inside the button. Emojis have to be either pasted as unicode or be in the following format <:emoji name:emoji ID>. (Optional)
  • Message ID (Type: Snowflake || Flag: Vacantable): Edits a button in a message with the provided ID. It’s important to note that provided message ID author has to be the bot. (Optional)

Example

Trigger: $onInteraction[test]

$nomention
$username said hello!
$editButton[test;Say hello!;danger;yes;]

example

$removeButtons

Removes all buttons from the triggered message.

Syntax

$removeButtons

Example

Trigger: $onInteraction[test]

$nomention
$username removed all buttons from this message
$removeButtons

example

$removeButtons[]

Removes all buttons from the specified message.

Syntax

$removeButtons[Message ID]

Parameters

  • Message ID (Type: Snowflake || Flag: Required): Removes buttons from the message with the provided ID. It’s important to note that provided message ID author has to be the bot.

Example

$nomention
$username removed all buttons from the specified message id
$removeButtons[$message]

example

$removeComponent

Removes a certain component from a message.

Syntax

$removeComponent[Interaction ID/URL;(Message ID)]

This function supports select-menu and button.

Parameters

  • Interaction ID/URL (Type: String || Flag: Required): The interaction ID of the button, to remove from the message.
  • Message ID (Type: Snowflake || Flag: Vacantable): Removes the button from the message with the provided ID. It’s important to note that provided message ID author has to be the bot. (Optional)

Example

$nomention
$username successfully removed the button!
$removeComponent[test;$message]

example

example

Create interaction

Example with $onInteraction[] callback:

  1. Create two commands with !example and $onInteraction[test] triggers.
  2. Paste the following code: Code for the command with the !example trigger:
$nomention
Click the button below!
$addButton[no;test;Click;primary]
$addButton[no;button;Button disabled;secondary;yes]
$addButton[yes;https://botdesignerdiscord.com/;Link;link]

Code for the command with the $onInteraction[test] trigger:

$nomention
$editButton[test;Clicked;danger;yes]
$sendMessage[$username hello!]

Note that the interaction ID provided in $onInteraction[] is the same as the one provided in $addButton[]

In $addButton[], yes is being used for the new row? argument so that the button would appear in the next row.

  1. Execute command !example

example

Example with $onInteraction callback:

  1. Create two commands with !example and $onInteraction triggers.
  2. Paste the following code: Code for the command with the !example trigger:
$nomention
Click the button below!
$addButton[no;test;Click;primary]
$addButton[no;button;Button disabled;secondary;yes]
$addButton[yes;https://botdesignerdiscord.com/;Link;link]

Code for the command with the $onInteraction trigger:

$nomention
$if[$customID==test]
    $editButton[test;Clicked;danger;yes]
    $sendMessage[$username hello!]
$endif

Note that the interaction ID returned by $customID will be the same as the one provided in $addButton[]

In $addButton[], yes is being used for the new row? argument so that the button would appear in the next row.

  1. Execute command !example

example

How $onInteraction or $onInteraction[] works?

Modals

In this section, you’ll learn how to use the modal message component.

⚠️ Warning: Modals are only supported for interaction responses (like slash commands, buttons, select menus, etc), you can’t open a modal from just a message command.

Creating a Modal

$newModal[Modal ID;Title]
  • Modal ID - Used in $onInteraction[ID] callback. It works same way as buttons and select menus.
  • Title - The text which is displayed on top of a modal. This value must be less than or equal to 45 characters.

Adding Input Fields

$addTextInput[Text Input ID;Style;Label;(Minimum length;Maximum length;Required;Value;Placeholder)]
  • Text Input ID - ID that is used to retrieve the text input in the field. This value must be unique. (Used in $input[Text Input ID])

  • Style - The text input field style, either short or paragraph.

  • Label - Name of the text input field. This value must be less than or equal to 45 characters.

  • Minimum length - Minimum number of characters a user needs to input. This value must be an integer between 0 and 4000, and can’t be greater than the Maximum length.

  • Maximum length - Maximum number of characters a user can input. This value must be an integer between 0 and 4000, and can’t be less than the Minimum length.

  • Required - Whether a user must fill in the text input field, defaults to true.

  • Value - The text that is written by default in the text input field. This value must be less than or equal to 4000 characters and must not be less than Minimum length and no more than Maximum length.

  • Placeholder - The text that is displayed if the text input field is empty. This value must be less than or equal to 100 characters.

🧙‍♂️ Note: You can’t add more than 5 text input fields.

Getting Input from a Modal Submission

Use this function in response to the modal submission interaction:

$input[Text Input ID]
  • Text Input ID - The text input field to get the user’s input from.

Example

Command Trigger: !modal | Command Code:

$nomention
Modal Example
$addButton[no;bio;Click me!;primary]

Command Trigger: $onInteraction[bio] | Command Code:

$nomention
$newModal[modal;User Bio]
$addTextInput[modalInput1;short;What is your name?;3;30;yes;;Mikołaj]
$addTextInput[modalInput2;short;What are your pronouns?;2;30;yes;;He/Him]
$addTextInput[modalInput3;paragraph;Can you tell us about yourself?;5;1000;no;;I am a Developer]

🤔 Explanation: The code above executes when the button from the previous code gets clicked. So, when the user clicks the button the modal appears.

Command Trigger: $onInteraction[modal] | Command Code:

$nomention
Name : $input[modalInput1]
Pronouns : $input[modalInput2]
About me : $input[modalInput3]

🤔 Explanation: The code above executes when the modal is submitted, because in the previous command we inputted the custom ID ‘modal’ into the $newModal[] function: $newModal[modal;User Bio].

Result

Select Menu

In this section you’ll learn how to use the select menu component.

Preview 1 Preview 2

Creating a Select Menu

$newSelectMenu[Menu ID;Min;Max;(Placeholder;Message ID)]
  • Menu ID - it’s used for $onInteraction[ID] callback. It works the same way as buttons.
  • Min - minimum amount of values that can be selected.
  • Max - maximum amount of values that can be selected.
  • Placeholder - it’s a text that appears if no option is selected.
  • Message ID - ID of a message that should have select menu added to it. By default it’s the bot’s response.

Adding an Option

$addSelectMenuOption[Menu option ID;Label;Value;Description;(Default;Emoji;Message ID)]
  • Menu option ID - it has to be the same as the ID used in $newSelectMenu[].
  • Label - the name of the option.
  • Value - it’s the data that gets passed to $onInteraction[] callback. The value has to be unique in the select menu!
  • Description - it shows up under the label.
  • Default - should the option be selected by default. There can be only one default option!
  • Emoji - it shows up next to the label.
  • Message ID - same as in $newSelectMenu[].

Example

Select Menu Code

$newSelectMenu[Example;1;1;Choose some option]
$addSelectMenuOption[Example;First;first-option;The first option]
$addSelectMenuOption[Example;Second;second-option;The second option]
$addSelectMenuOption[Example;Third;third-option;The third option]

Interaction Code

$onInteraction[Example]

$if[$message==first-option]
You have chosen the first option
$elseif[$message==second-option]
You have chosen the second option
$elseif[$message==third-option]
You have chosen the third option
$endif

Usage

Usage 1

Multi-Select Menu

In the Select Menu you can choose not only one option, but several at once. You could understand this by the presence of arguments Min and Max.

Example

Select Menu Code

Here we will change the argument Max to 3.

$newSelectMenu[Example;1;3;Choose some option]
$addSelectMenuOption[Example;First;first-option;The first option]
$addSelectMenuOption[Example;Second;second-option;The second option]
$addSelectMenuOption[Example;Third;third-option;The third option]

Interaction Code

$if[$checkContains[$message;first-option]==true]
$addCmdReactions[1️⃣]
$endif

$if[$checkContains[$message;second-option]==true]
$addCmdReactions[2️⃣]
$endif

$if[$checkContains[$message;third-option]==true]
$addCmdReactions[3️⃣]
$endif

If we choose several options, several reactions will be added.

Usage

Usage 2.1 Usage 2.2

Editing a Select Menu

You can edit Select Menu, as well as options in this menu.

$editSelectMenu

Usage

$editSelectMenu[Menu ID;Min;Max;(Placeholder;Message ID)]

$editSelectMenuOption

Usage

$editSelectMenuOption[Menu option ID;Label;Value;Description;(Default;Emoji;Message ID)]

As you can notice, the arguments are exactly the same.

Example

Select Menu Code

$newSelectMenu[Example;1;1;Choose some option]
$addSelectMenuOption[Example;First;first-option;The first option]
$addSelectMenuOption[Example;Second;second-option;The second option]
$addSelectMenuOption[Example;Third;third-option;The third option]

Interaction Code

Example 1

$editSelectMenuOption[Example;First;first-option;The first option;no;1️⃣]
$editSelectMenuOption[Example;Second;second-option;The second option;no;2️⃣]
$editSelectMenuOption[Example;Third;third-option;The third option;no;3️⃣]

Example 1 Example 1 Example 1

We just added emoji to our options after choosing (any) option.

Example 2

$editSelectMenu[Example;1;1;Choose some option 😀]
$addSelectMenuOption[Example;First;first-option;The first option]
$addSelectMenuOption[Example;Second;second-option;The second option]
$addSelectMenuOption[Example;Third;third-option;The third option]

Example 2 Example 2

We just changed the placeholder of our Select Menu after choosing (any) option.

Slash Commands

In this guide, you will learn more about implementing slash commands to your bot.

Slash commands are type of interactive application commands. It let’s users to interact with your bot by typing /<command name>.

preview

General information

  • Discord allows up to 200 slash commands (100 global & 100 guild based commands).

  • To use slash commands, you need to invite the bot with applications.commands scope.

  • Creating/modifying/deleting global slash commands might take up to 1 hour.

  • Creating a guild slash command is instant but it won’t appear unless you have registered them in the current guild using $registerGuildCommands[(slash command name;...)] function.

    📝 Guild slash commands don’t appear in DMs unlike global slash commands.

Getting started

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

Inviting the bot

  • Method #1

    • Visit Discord Developer official website and select your bot application.
    • Click hamburger icon on top-left of the website and choose OAuth2 tab.
    • In OAuth2 tab, click URL Generator sub-tab.
    • Choose bot & application.commands in scopes and desired bot permissions.
    • Copy the generated url below and invite your bot into your server.
  • Method #2

    • Open BDFD app and select your bot.
    • Press Add invite bot to server button in dashboard tab.
    • Click Edit invite link scopes and enable “Slash commands” if its disabled.
    • Now, go back & press “Add your bot to your server”
    • Finally, invite the bot into your server.

Creating a slash command

  • Create or modify an existing command.
  • Click “Slash command trigger”.
  • Choose “Enable global slash command” or “Enable guild slash command” as per your preference.
  • Fill-up necessary data and save it.

📝 Slash commands can have a maximum of 4000 characters (combined name, description, and value properties) per slash.

Example

Screenshot_20220717_170852 Screenshot_20220717_170915 Screenshot_20220717_171511

Slash options

Slash options are great way to get an user’s input in slash commands.

To create a slash option,

  • Open your slash command edit trigger page.
  • Click “Add” button in Options section.
  • Fill-up necessary data and save the changes.

📝 Slash commands can have up to maximum 25 options per slash.

Slash options types

  • Text - Accepts any string data input.
  • Integer - Accepts only integer value input. For example: 3, -70 etc.
  • Number - Accepts only number value input. For example: 5.3, -35, 23 etc.
  • Boolean - Accepts either true or false input.
  • User - It allows to mention any user.
  • Channel - It allows to mention any channel.
  • Role - It allows to mention any role.
  • Mentionable - It allows to mention any user or role.
  • Attachments - It allows to upload attachments.

Retrieving value from options

To retrieve a value from an option, use $message[<option name>].

📝 If you want this function to work both in normal and slash command,
then you can use $message[<arg number>;<option name>].

Example

Screenshot_20220717_175245 Screenshot_20220717_175635 Screenshot_20220717_175649

Pre-defined choices

To create choices in options,

  • In your slash command edit trigger page, create an option and fill-up the necessary data.
  • Toggle “Enabled” in Predefined choices section.
  • Then, click “Add a new choice” button.
  • Type your choice name and value.
  • Click “Add” and save the changes.

📝 A slash command can have upto maximum 25 choices per option.

Retrieving choices

You can retrieve user’s option choices using $if statements.

Format

$if[$message[<option name>]==<choice #1 value>]
      $c[Text/code here when user select 1st choice]
$elseif[$message[<option name>]==<choice #2 value>]
             $c[Text/code here when user select 2nd choice]
$endif

⚠️ Above code snippet requires BDScript 2 in order to execute since it contains $elseif.

Example

Screenshot_20220717_194906 Screenshot_20220717_195016 Screenshot_20220717_194125 Screenshot_20220717_194202 Screenshot_20220717_194214

Auto Complete for Slash Command Options

Auto complete allows your bot to read user input as they type it and give user suggestions based on that.
example-autocomplete
Check example to get started quickly.

General Information

  • You can only create up to 25 suggestions per option
  • You need to enable autocomplete for the option
  • You can’t use option choices with autocomplete

$onAutoComplete[Name] callback

This callback receives information about current user input. It’s used for adding suggestions.
Name is the name of a slash command.

Avaliable functions

$appendOptionSuggestion[Label;Value]

Used for adding new suggestions.

  • Label - text which will be displayed in the suggestion list (for example: arg-ad from the previous example)
  • Value - data that can be accessed in a slash command by using $message[] function. label is only a display name but value holds the actual value for a suggestion.

Note: value must have the same type as the currently typed option! Meaning, if the option’s type is Integer, value can’t be set to Hello but it can be set to 123

$autoCompleteOptionName

Returns the name of currently being typed option. For example arg from the previous example

$autoCompleteOptionValue

Returns the current user input. For example ad from the previous example

Example

New slash command with a new option:

slash auto complete

Slash option:

slash option

Slash command code:

$message[arg]

$onAutoComplete[] callback:

autocompletetrigger

Callback code

$nomention
$appendOptionSuggestion[$autoCompleteOptionName-$autoCompleteOptionValue;$autoCompleteOptionValue]
Explanation
  • $appendOptionSuggestion[] - adds new suggestion
  • $autoCompleteOptionName-$autoCompleteOptionValue - suggestion’s label. It’s set to the option name and user input (<option name>-<user input>)
  • $autoCompleteOptionValue - suggestion’s value. It’s set to whatever user typed.

Result:

1.

example-autocomplete

2.

example-autocomplete2

Awaited Commands

Awaited commands are a special type of command where the bot waits for the user’s response.

Content

Functions Used > Supported Filters > $awaitFunc[] > $awaitedCommand[] > $awaitedCommandError[] > Creating an awaited command

Functions Used

Supported Filters

  • <numeric>: Accepts only number input.
  • <word1/word2/...>: Accepts only specified words provided inside <>. Use / as a separator for multiple words.

$awaitFunc

Used to initiate an awaited command.

Syntax

$awaitFunc[Command name;(User ID;Channel ID)]

Parameters

  • Command name (Type: String || Flag: Required): The name used inside $awaitedCommand[] and $awaitedCommandError[] callbacks.
  • User ID (Type: Snowflake || Flag: Vacantable): The user the awaited command will trigger for. Uses command author, if User ID is not given.
  • Channel ID (Type: Snowflake || Flag: Optional): The channel where the command will be awaited. Uses current channel, if Channel ID is not given.

Example

$nomention
What do you want me to say?
$awaitFunc[say]
!example What do you want me to say? I love BDFD I love BDFD

$awaitedCommand

Triggered when an awaited command gets responded to.

$awaitedCommand[] is a callback, which means it’s used in the command trigger (not the code). The command is only run when an awaited command gets responded to.

Syntax

$awaitedCommand[Name;(Filter)]

Parameters

  • Name (Type: String || Flag: Required): The name used in $awaitFunc[] function.
  • Filter (Type: String || Flag: Emptiable): Used to limit user input (Supported filters). If no filter is provided, it accepts any input.

Example

Without filter

Trigger: $awaitedCommand[say;]

$nomention
$message
!example What do you want me to say? I love BDFD I love BDFD

With choose filter

Trigger: $awaitedCommand[odd;<yes/no/cancel>]

$nomention
$if[$message==yes]
   Your answer is correct!
$elseif[$message==no]
   Your answer is incorrect!
$elseif[$message==cancel]
   Command cancelled!
$endif

example

With numeric filter

Trigger: $awaitedCommand[odd;<numeric>]

$nomention
You have provided a number: $message

example

$awaitedCommandError

Triggered when an awaited command doesn’t match with provided filter.

$awaitedCommandError[] is a callback, which means it’s used in the command trigger (not the code). The command is only run when an awaited command doesn’t match with provided filter.

Syntax

$awaitedCommandError[Name]

Parameters

  • Name (Type: String || Flag: Required): The name used in $awaitFunc[] function.

Example

Trigger: $awaitedCommandError[number]

$nomention
Invalid number!

example

Creating an awaited command

Without filter

  1. Create two commands with !say and $awaitedCommand[say;] triggers.
  2. Paste the following code:

Code for the !say command:

$nomention
What do you want me to say?
$awaitFunc[say]

Code for the command with the $awaitedCommand[say;] trigger:

$nomention
$message
  1. Execute command !say

example

With choose filter

  1. Create two commands with !odd and $awaitedCommand[odd;<yes/no/cancel>] triggers.
  2. Paste the following code:

Code for the !odd command:

$nomention
Is '19' an odd number?
$awaitFunc[odd]

Code for the command with the $awaitedCommand[odd;<yes/no/cancel>] trigger:

$nomention
$if[$message==yes]
   Your answer is correct!
$elseif[$message==no]
   Your answer is incorrect!
$elseif[$message==cancel]
   Command cancelled!
$endif
  1. Execute command !odd

example

With numeric filter

  1. Create two commands with !number and $awaitedCommand[number;<numeric>] triggers.
  2. Paste the following code:

Code for the !number command:

$nomention
Provide a number!
$awaitFunc[number]

Code for the command with the $awaitedCommand[number;<numeric>] trigger:

$nomention
You have provided a number: $message
  1. Execute command !number

example

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

  • Retrieves data from a resource.
$httpGet[url]

POST

  • The data sent to the server with POST is stored in the request body of the HTTP request.
$httpPost[url;(body)]

PUT

  • The PUT method replaces all current representations of the target resource with the request payload.
$httpPut[url;(body)]

DELETE

  • The DELETE method deletes the specified resource.
$httpDelete[url;(body)]

PATCH

  • The PATCH method applies partial modifications to a resource.
$httpPatch[url;(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.
$httpAddHeader[header name;header value]

HTTP Statuses

  • If the API doesn’t return anything after making a request, but you need to know the result, HTTP Statuses can help. You can read more about them here.
$httpStatus

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[JSON Key;...]

Retrieves JSON from HTTP request. All arguments after JSON Key are optional.

Examples

Basic level

An example using a $httpGet function

$nomention
$httpGet[https://nekos.best/api/v2/neko]
$title[Here is a Neko for you!]
$description[**Source:** $httpResult[results;0;source_url]]
$image[$httpResult[results;0;url]]
$footer[nekos.best API]
$color[#e91e63]
Show Example API Response
{
    "results":[
        {
            "artist_href":"https://www.pixiv.net/en/users/4284365",
            "artist_name":"イカたると",
            "source_url":"https://www.pixiv.net/en/artworks/55142454",
            "url":"https://nekos.best/api/v2/neko/0023.png"
        }
    ]
}

Neko

API: nekos.best

Advanced level

An example using a function that has a request body (e.g. $httpPost) and using $httpAddHeader

$httpAddHeader[content-type;application/x-www-form-urlencoded]
$httpPost[https://pastebin.com/api/api_post.php;api_dev_key=7CP52G-BTQP_1AhyBBlTa94qyjE6vHzU&api_paste_code=$url[encode;$message]&api_option=paste]
$httpResult

Pastebin Pastebin

API: pastebin.com

If Statements

In this section, you’ll learn how to use the if statement.

Content

Functions Used > Signs > $if[] > $endif[] > $else > $elseif[] > $and[] > $or[] > Simple Example

Functions Used

Support Functions Used

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.

$if

Executes the following block of code if the provided condition is true.

Syntax

$if[Condition]

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

Parameters

  • Condition (Type: String || Flag: Required): Check that will be carried out. Use Signs.

Example

$nomention
$if[5>$random[0;10]]
  5 is bigger than $random[0;10]
$endif
!example 5 is bigger than 0 !example No answer because $random[0;10] returned that the number are less than 5

$endif

Ends an if statement.

Syntax

$endif

Example

$nomention
$if[$message==abc]
  Good work!
$endif

With $endif

!example abc Good work!

Without $endif

!example abc $if not closed with $endif

$else

A block of code to be executed, if the $if[] condition is false.

Syntax

$else

Example

$if[5>$random[0;10]]
  5 is bigger than $random[0;10]
$else
  5 is less than $random[0;10]
$endif
!example 5 is bigger than 0 !example 5 is less than 8

$elseif

Checks provided condition only if previous $if[] or $elseif[] conditions returned false. If the provided condition is true, the following block of code will be executed.

You can use multiple $elseifs. Only for BDScript 2!

Syntax

$elseif[Condition]

Parameters

  • Condition (Type: String || Flag: Required): Check that will be carried out. Use Signs.

Example

BDScript 2:

$nomention
$if[5<$random[0;10]]
  5 is less than $random[0;10]
$elseif[5==$random[0;10]]
  5 equals $random[0;10]
$endif

BDScrpt and BDScript Unstable:

$nomention
$if[5<$random[0;10]]
  5 is less than $random[0;10]
$else
  $if[5==$random[0;10]]
    5 equals $random[0;10]
  $endif
$endif
!example 5 is less than 6 !example 5 equals 5

$and

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

Syntax

$and[Conditions;...]

Parameters

  • Conditions (Type: String || Flag: Required): Checks that will be carried out. All conditions must be true for this function to return true. Separate conditions using ;. Use Signs.

Example

$nomention
$if[$and[$nickname==MineBartekSA;$message==Update]==true]
  Hi developer
$else
  Hi user
$endif
!example Update Hi user !example Hi user !example Hi user !example Update Hi developer

$or

Returns true if at least one of the provided conditions is true, otherwise false is returned.

Syntax

$or[Conditions;...]

Parameters

  • Conditions (Type: String || Flag: Required): The condition to check. Separate conditions using ;. Use Signs.

Example

$nomention
$if[$or[$nickname==MineBartekSA;$message==Update]==true]
  Hi
$else
  Bye
$endif
!example Update Hi !example Bye !example Hi !example Update Hi

Simple Example

  1. Create command with !example trigger.

  2. Paste the following code:

    $nomention
    $if[$message==BDFD]
      Hi BDFD User!
    $elseif[$message==Bartek]
      Are you Bartek?
    $elseif[$message==Premium]
      Do you want to get premium?
    $else
      I can't find this:(
    $endif
    
  3. Execute command !example

!example BDFD Hi BDFD User! !example Bartek Are you Bartek? !example Premium Do you want to get premium? !example Hello I can't find this:(

JSON Functions

Before you read this guide, you should be familiar with what JSON is and where and how it’s being used.
You can familiarize yourself with JSON by reading a tutorial on W3Schools.

This guide will utilize Character Escaping and the $optOff function.

$jsonParse

$jsonParse is the primary function used when working with JSON data.
This function parses a JSON string into an object which can then be used by other JSON functions.

Syntax

$jsonParse[JSON string]

Parameters

  • JSON string (Type: String || Flag: Required): The JSON string to parse into an object.

Examples

See examples further down the guide.

$json

$json function retrieves JSON values from a specified key in the current JSON object.

The $json function will return an empty string if the value is null, the key doesn’t exist, no $jsonParse or $jsonSet function was executed, or $jsonClear was executed.

Syntax

$json[Key;...]

Parameters

  • Key (Type: String || Flag: Required): The JSON key which will be retrieved.

Examples

Without Arrays

$nomention
$jsonParse[{
    "username": "NightNutSky",
    "tag": "6700",
    "identity": {
        "age": 16
    }
}]

Username: $json[username]
Tag: $json[tag]
Age: $json[identity;age] years old

With Arrays

$nomention
$jsonParse[{
    "computer": [{
        "apps": {
            "software": ["BlueStacks", "Krita", "Visual Studio Code"\],
            "games": ["GTA 5", "RDR 2", "CS:GO", "Cyberpunk 2077"\]
        }
    },{
        "cpu": "Intel",
        "gpu": "NVIDIA",
        "ram": "XPG"
    }\]
}]

Software: $json[computer;0;apps;software]
Games: $json[computer;0;apps;games]
Brands: CPU - $json[computer;1;cpu], GPU - $json[computer;1;gpu], RAM - $json[computer;1;ram]

$jsonSet

$jsonSet sets or replaces the value at the specified JSON key.

Syntax

$jsonSet[Key;...;Value]

Parameters

  • Key (Type: String || Flag: Required): The JSON key where the value will be set or replaced.
  • Value (Type: Integer, Bool, Float, String || Flag: Required): The value to set or replace with.

Example

$nomention
$jsonParse[{
    "username": "NightNutSky",
    "tag": "6700",
    "identity": {
        "age": 16
    }
}]

Username: $json[username]
Tag: $json[tag]
Age: $json[identity;age] years old

$jsonSet[username;Priyanuj]
$jsonSet[tag;2626]
$jsonSet[identity;age;19]

$optOff[Username: $json[username]
Tag: $json[tag]
Age: $json[identity;age] years old]

$jsonSetString

$jsonSetString function sets or replaces the value at the specified JSON key. Always sets the value as a string.

Syntax

$jsonSetString[Key;...;Value]

Parameters

  • Key (Type: String || Flag: Required): The JSON key where the value will be set or replaced.
  • Value (Type: String || Flag: Required): The value to set or replace with.

This function is recommended to be used mostly in economic-related commands. Why? The next example will explain it.

Example

  • $jsonSet

    $nomention
    $jsonParse[{}]
    
    $jsonSet[balance;$message]
    
    Balance key was set to: $json[balance]
    

  • $jsonSetString

    $nomention
    $jsonParse[{}]
    
    $jsonSetString[balance;$message]
    
    Balance key was set to: $json[balance]
    

If we set this value as a number manually, we’ll encounter issues.

$nomention
$jsonParse[{
    "balance": 788895455566645444567
}]

Balance key: $json[balance]

$nomention
$jsonParse[{
    "balance": "788895455566645444567"
}]

Balance key: $json[balance]

Therefore, we should set big numbers as strings.

$jsonUnset

$jsonUnset removes the value at the specified JSON key.
In short, the opposite of the $jsonSet function.

Syntax

$jsonUnset[Key;...]

Parameters

  • Key (Type: String || Flag: Required): The JSON key which will be unset.

Example

$nomention
$jsonParse[{
    "username": "NightNutSky",
    "tag": "6700",
    "identity": {
        "age": 16
    }
}]

Username: $json[username]
Tag: $json[tag]
Age: $json[identity;age] years old

$jsonUnset[username]
$jsonUnset[tag]
$jsonUnset[identity;age]

$optOff[Username: $json[username]
Tag: $json[tag]
Age: $json[identity;age] years old]

$jsonClear

$jsonClear clears out the current JSON object.

Syntax

$jsonClear

Example

$nomention
$jsonParse[{
    "username": "NightNutSky",
    "tag": "6700",
    "identity": {
        "age": 16
    }
}]

Username: $json[username]
$jsonClear
Username: $optOff[$json[username]]

$jsonExists

$jsonExists checks if the specified JSON key exists in the current JSON object.

Returns an empty result if no $jsonParse or $jsonSet function was executed, or $jsonClear was executed.

Syntax

$jsonExists[Key;...]

Parameters

  • Key (Type: String || Flag: Required): The JSON key which will be checked.

Examples

See examples further down the guide.

$jsonStringify

$jsonStringify turns the current JSON object into a string value.

The $jsonStringify function will return an empty string if no $jsonParse or $jsonSet function was executed, or $jsonClear was executed.

Syntax

$jsonStringify

Example

$nomention
$jsonParse[{
    "computer": [{
        "apps": {
            "software": ["BlueStacks", "Krita", "Visual Studio Code"\],
            "games": ["GTA 5", "RDR 2", "CS:GO", "Cyberpunk 2077"\]
        }
    },{
        "cpu": "Intel",
        "gpu": "NVIDIA",
        "ram": "XPG"
    }\]
}]

$jsonStringify

$jsonPretty

$jsonPretty turns the current JSON object into a pretty string value.

The $jsonPretty function will return an empty result if no $jsonParse or $jsonSet function was executed, or $jsonClear was executed.

Syntax

$jsonPretty[Indent length]

Parameters

  • Indent length (Type: Integer || Flag: Required): The length of the indentation. Usually it’s 2 or 4.

Example

$nomention
$disableInnerSpaceRemoval
$jsonParse[{"computer":[{"apps":{"software":["BlueStacks","Krita","Visual Studio Code"\],"games":["GTA 5","RDR 2","CS:GO","Cyberpunk 2077"\]}},{"cpu":"Intel","gpu":"NVIDIA","ram":"XPG"}\]
}]

$jsonPretty[4]

For the output to really be pretty, we have to use the $disableInnerSpaceRemoval function.

$jsonArray

$jsonArray marks a specified JSON key as an array.

Syntax

$jsonArray[Key;...]

Parameters

  • Key (Type: String || Flag: Required): The JSON key which will be marked as an array.

Example

$nomention
$jsonParse[{
    "games": ""
}]

Non-array `games` key:
$jsonPretty[4]

$jsonArray[games]

Array `games` key:
$optOff[$jsonPretty[4]]

$jsonArrayCount

$jsonArrayCount counts the elements in the specified JSON key.

Syntax

$jsonArrayCount[Key;...]

Parameters

  • Key (Type: String || Flag: Required): The JSON key where the elements will be counted.

Example

$nomention
$jsonParse[{
    "computer": [{
        "apps": {
            "software": ["BlueStacks", "Krita", "Visual Studio Code"\],
            "games": ["GTA 5", "RDR 2", "CS:GO", "Cyberpunk 2077"\]
        }
    },{
        "cpu": "Intel",
        "gpu": "NVIDIA",
        "ram": "XPG"
    }\]
}]

$onlyIf[$jsonExists[computer;0;apps;$message]==true;The specified category doesn't exist! Available categories are `software` and `games`]
The count of the `$message` apps is $jsonArrayCount[computer;0;apps;$message]. 

$jsonArrayIndex

$jsonArrayIndex gets the array index of a given value.

The $jsonArrayIndex function will return -1 if value not found and will return an empty result if no $jsonParse or $jsonSet function was executed, or $jsonClear was executed.

Syntax

$jsonArrayIndex[Key;...;Value]

Parameters

  • Key (Type: String || Flag: Required): The JSON key where the value will be searched for.
  • Value (Type: String, Integer, Float || Flag: Required): The value to search for.

Example

$nomention
$jsonParse[{
    "computer": [{
        "apps": {
            "software": ["BlueStacks", "Krita", "Visual Studio Code"\],
            "games": ["GTA 5", "RDR 2", "CS:GO", "Cyberpunk 2077"\]
        }
    },{
        "cpu": "Intel",
        "gpu": "NVIDIA",
        "ram": "XPG"
    }\]
}]

The $message's index in `apps/software` is $jsonArrayIndex[computer;0;apps;software;$message].

$jsonArrayAppend

$jsonArrayAppend appends the value at the end of the specified JSON key.

Syntax

$jsonArrayAppend[Key;...;Value]

Parameters

  • Key (Type: String || Flag: Required): The JSON key where the value will be appended.
  • Value (Type: Integer, Bool, Float, String || Flag: Required) : The value to append.

Example

$nomention
$jsonParse[{
    "computer": [{
        "apps": {
            "software": ["BlueStacks", "Krita", "Visual Studio Code"\],
            "games": ["GTA 5", "RDR 2", "CS:GO", "Cyberpunk 2077"\]
        }
    },{
        "cpu": "Intel",
        "gpu": "NVIDIA",
        "ram": "XPG"
    }\]
}]

$onlyIf[$jsonExists[computer;0;apps;$message[1]]==true;The specified category doesn't exist! Available categories are `software` and `games`]

$var[value;$replaceText[$message;$message[1] ;]]

$jsonArrayAppend[computer;0;apps;$message[1];$var[value]]

A new app was added to the `$message[1]` category!
Current apps in the `$message[1]` category: $json[computer;0;apps;$message[1]]

$jsonArrayPop

$jsonArrayPop function removes the last element of an array and returns the removed element.

Syntax

$jsonArrayPop[Key;...]

Parameters

  • Key (Type: String || Flag: Required): The key of the array from which an element will be removed.

Example

$nomention
$jsonParse[{
    "music": ["Paranoid - MADKID", "Ping! 2 - Exyl", "Tokyo - Leat'eq"\]
}]

Removed: $jsonArrayPop[music]

Current music:
> $jsonJoinArray[music;, ]

$jsonArrayShift

$jsonArrayShift function removes the first element of an array and returns the removed element.

Syntax

$jsonArrayShift[Key;...]

Parameters

  • Key (Type: String || Flag: Required): The key of the array from which an element will be removed.

Example

$nomention
$jsonParse[{
    "music": ["Paranoid - MADKID", "Ping! 2 - Exyl", "Tokyo - Leat'eq"\]
}]

Removed: $jsonArrayShift[music]

Current music:
> $jsonJoinArray[music;, ]

$jsonArrayUnshift

$jsonArrayUnshift function adds the value in the front of the array.

Syntax

$jsonArrayUnshift[Key;...;Value]

Parameters

  • Key (Type: String || Flag: Required): The JSON key of the array to which the value will be added.
  • Value (Type: Float, String, Bool, Integer || Flag: Required): The value to be added.

Example

$nomention
$jsonParse[{
    "music": ["Paranoid - MADKID", "Ping! 2 - Exyl", "Tokyo - Leat'eq"\]
}]

$jsonArrayUnshift[music;Side Character - Cloudfodder]

Music:
> $jsonJoinArray[music;, ]

$jsonArraySort

$jsonArraySort sorts a specific JSON array in ascending order.

The function sorts the elements in the order of integers from lowest to highest, and then strings based on their ASCII/Unicode values.

Syntax

$jsonArraySort[Key;...]

Parameters

  • Key (Type: String || Flag: Emptiable): The key of the JSON array to be sorted.

Example

$nomention
$jsonParse[{
  "data": ["Oranges", "banana", 10, "apple", "Apples", 2, 30\]
}]

$jsonArraySort[data]

After sorting:
> $json[data]

$jsonArrayReverse

$jsonArrayReverse reverses the order of a specific JSON array.

Syntax

$jsonArrayReverse[key;...]

Parameters

  • Key (Type: String || Flag: Emptiable): The key of the JSON array to be reversed.

Example

$nomention
$jsonParse[{
  "fruits": ["apple", "orange", "banana", "grape"\]
}]

$jsonArrayReverse[fruits]

After reversing:
> $json[fruits]

$jsonJoinArray

$jsonJoinArray function joins a JSON array under the specified key with the given separator.

The $jsonJoinArray function will return an empty string if the value is null, the key doesn’t exist, no $jsonParse or $jsonSet function was executed, or $jsonClear was executed.

Syntax

$jsonJoinArray[Key;...;Separator]

Parameters

  • Key (Type: String || Flag: Required): The JSON key to an array which will be retrieved.
  • Separator (Type: String || Flag: Required): The separator which will separate the JSON keys.

Example

$nomention
$jsonParse[{
    "music": ["Paranoid - MADKID", "Ping! 2 - Exyl", "Tokyo - Leat'eq"\]
}]

Music:
> $jsonJoinArray[music;, ]

We separated the list with , .

Threads

In this section, you’ll learn how to integrate threads in your bot.

Make sure your bot has SEND_MESSAGES_IN_THREADS permission.

Content

Functions Used > Archive Duration > $startThread[] > $editThread[] > $threadAddMember[] > $threadRemoveMember[] > Simple Code

Functions Used

Archive Duration

60 - 1 Hour
1440 - 1 Day
4320 - 3 Days (Only for servers with level 1 boosted)
10080 - 7 Days (Only for servers with level 2 boosted)

$startThread

Creates a new thread in the provided channel.

Syntax

$startThread[Thread name;Channel ID;Message ID;(Archive duration;Return thread ID?)]

Required permissions that the bot must have for this function to work properly:

  • createpublicthreads

Parameters

  • Thread name (Type: String || Flag: Required): The name of the newly created thread.
  • Channel ID (Type: Snowflake || Flag: Required): The channel where the thread will be created.
  • Message ID (Type: Snowflake || Flag: Emptiable): The message from which the thread will be created. Can be left empty.
  • Archive duration (Type: Integer || Flag: Optional): The archive duration after which the thread will be auto-archived due to inactivity. Defaults to 60.
  • Return thread ID? (Type: Bool || Flag: Optional): Whether to return the thread channel ID or not. Defaults to no.

Example

$nomention
I created a new thread! <#$startThread[Cool Thread;$channelID;;1440;yes]>
!example BDFD Support Started a thread: Cool Thread. See all threads. I created a new thread! Cool Thread

$editThread

Modifies an existing thread.

Syntax

$editThread[Thread ID;(Thread name;Archived?;Archive duration;Locked?;Slowmode)]

Parameters

  • Thread ID (Type: Snowflake || Flag: Required): The thread channel to edit.
  • Thread name (Type: String || Flag: Optional): The new name of the thread.
  • Archived? (Type: Bool || Flag: Optional): Whether to archive this thread or not.
  • Archive duration (Type: Integer || Flag: Optional): The archive duration after which the thread will be auto-archived due to inactivity. Defaults to 60.
  • Locked? (Type: Bool || Flag: Optional): Whether to lock this thread or not. Note that archived threads can’t be locked.
  • Slowmode (Type: Integer || Flag: Optional): The slowmode of this channel, expressed in seconds.

Use !unchanged as an argument for the option to remain in its current state.

Example

$nomention
$editThread[1098166444111433819;Cool Thread 😎;no;!unchanged;!unchanged;5]
!example BDFD Support changed the channel name: Cool Thread 😎

$threadAddMember

Adds a user to a thread.

Syntax

$threadAddMember[Thread ID;User ID]

Parameters

  • Thread ID (Type: Snowflake || Flag: Required): The ID of the thread channel to add the user to.
  • User ID (Type: Snowflake || Flag: Required): The user to add to the thread.

Example

$nomention
$threadAddMember[1021054508975009793;$authorID]
!example
  • In the thread:
BDFD Support added RainbowKey to the thread.

$threadRemoveMember

Removes a user from a thread.

Syntax

$threadRemoveMember[Thread ID;User ID]

Parameters

  • Thread ID (Type: Snowflake || Flag: Required): The ID of the thread channel to remove the user from.
  • User ID (Type: Snowflake || Flag: Required): The user to remove from the thread.

Example

!example
  • In the thread:
BDFD Support removed RainbowKey from the thread.

Simple Code

$nomention
$var[id;$startThread[Cool Thread;$channelID;;1440;yes]]
New thread - <#$var[id]>
$threadAddMember[$var[id];$authorID]
!example BDFD Support Started a thread: Cool Thread. See all threads. New thread - Cool Thread
  • In the thread:
BDFD Support added RainbowKey to the thread.

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

Text Splitting

In this section, you’ll learn how to use the text splitting.

Content

Functions Used > $textSplit[] > $splitText[] > $getTextSplitLength > $getTextSplitIndex[] > $joinSplitText[] > $removeSplitTextElement[] > Simple Code

Functions Used

$textSplit

Splits the provided text by a given separator and saves the value temporarily.

Syntax

$textSplit[Text;Separator]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to split.
  • Separator (Type: String || Flag: Emptiable): The separator to split the text with. If this parameter is empty, it separates the text by each character.

Example

$nomention
$textSplit[hello-world-!;-]
> $splitText[2]
!example world

$splitText

Each separated text has a number, i.e. an index. $splitText is a function that returns one of the elements of the separated text by an index or the sign < - the very first element, or > - the very last element.

Syntax

$splitText[Index]

Parameters

  • Index (Type: HowMany || Flag: Required): The split value to get (e.g. 2 for the second split). You can also use > to return the last split value i.e $splitText[>].

Example

$nomention
$textSplit[hello world !; ]
> $splitText[<]
> $splitText[2]
> $splitText[>]
!example hello
world
!

$getTextSplitLength

Returns the number of splits.

Syntax

$getTextSplitLength

Example

$nomention
$textSplit[hello%world%!;%]
> $getTextSplitLength
!example 3

$getTextSplitIndex

Retrieves index from the provided value. Returns -1 if it couldn’t find the value.

Syntax

$getTextSplitIndex[Value]

Parameters

  • Value (Type: String || Flag: Emptiable): The value to search in the text split.

Example

$nomention
$textSplit[hello_world_!;_]
> $getTextSplitIndex[$message]
!example world 2 !example bdfd -1

$joinSplitText

This function returns the current elements of the separated text with the specified (sometimes new) separator.

Syntax

$joinSplitText[Separator]

Parameters

  • Separator (Type: String || Flag: Emptiable): The separator to be put between the text split values.

Example

$nomention
$textSplit[hello#world#!;#]
> $joinSplitText[
> ]
!example hello
world
!

$removeSplitTextElement

This function removes an element from the separated text by the specified index.

Syntax

$removeSplitTextElement[Index]

Parameters

  • Index (Type: Integer || Flag: Required): The index of the $textSplit[] value to remove.

Example

$nomention
$textSplit[hello-world-!;-]
$removeSplitTextElement[3]
> $joinSplitText[-]
!example hello-world

$editSplitText

This function replaces the element at the specified index with a new element instead of the previous one.

Syntax

$editSplitText[Index;Value]

Parameters

  • Index (Type: Integer || Flag: Required): The index of the element to edit.
  • Value (Type: String || Flag: Required): The new value to assign to the provided index.

Example

$nomention
$textSplit[hello-world-!;-]
$editSplitText[2;bdfd]
> $joinSplitText[-]
!example hello-bdfd-!

Simple Code

$nomention
$textSplit[$message;]
Characters: $getTextSplitLength
$textSplit[$message; ]
Words: $getTextSplitLength
Random word: $splitText[$random[1;$sum[$getTextSplitLength;1]]]
First word: $splitText[<]
!example Hello world! Characters: 12
Words: 2
Random word: world!
First word: Hello

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’ assets. 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: Unneeded 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

Argument Flags

Function argument flags mark how arguments within a function may be used (or hence, not used at all), it will be displayed near or below the function argument. Example: (- userID (Flag: Required)) etc.

  • Optional - The argument can be excluded but cannot be left empty, they show up as (something) and will always be after all required arguments.
  • Required - The argument must be included and cannot be empty.
  • Emptiable - The argument must be included but can be empty.
  • Vacantable - The argument can be excluded and if included can be empty.

Argument Types

This section will explain the various argument types used for function arguments. Function arguments are anything that goes in the brackets [] of a function, it will be displayed near or below the function argument. Example: (- userID (Type: Snowflake || Flag: Required)) and if it has more than one option it will be (Type: String, Snowflake || Flag: Required) etc.

  • String - This is the most generalized function, a string can be any character or text.
  • Snowflake - A valid discord ID, can be of a role, channel, user, server, emoji and message.
  • Integer - Any number without decimal (-5, -1, 1, 5 10, etc).
  • Float - A number with decimal (-2.5, -0.5, 1.5, 5.2, 7.30, etc).
  • URL - A valid domain link, must be prefixed by http:// or https:// and have a valid domain name.
  • HowMany - A number that is prefixed or suffixed with < or >, or just a plain integer.
  • Enum - Strings that match a certain key value (case insensitive).
  • Emoji - Emoji as 🌹 or emoji aliases in form of :+1: for :+1: or the discord custom emojis in form of <a:emoji_name:emoji-id> for gif emojis and <:emoji_name:emoji-id> for non-gif emojis, for how to get that, check $addReactions as it has explanations for that. Characters <> can be omitted from the discord custom emoji form.
  • Duration - A time based duration, an integer suffixed with a valid time format (s, m, h, d, w).
  • Permission - Discord permission (case insensitive), see this for all valid permissions.
  • Bool - yes/no or true/false.
  • Color - Color Hex Code you can get from here as an example

Pairs

  • Tuple - A tuple is a set of arguments that depend on others to function, they are shown with <> on either side.
  • Ellipsis - Ellipsis notations (...) symbolize an argument that can be repeated multiple times. Ellipsis is denoted with ... as the argument after the argument which can be repeated.

Character Escaping

(for advanced users)

What are Escape Characters?

Escape characters are used to indicate that the character should not be interpreted as a modification 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-}% or \;
$%{DOL}%
]%ESCAPED% or \]
|\\

Example

$nomention
$sendMessage[[ Hi, this is pretty cool\; right? \]]
!example [ Hi, this is pretty cool; right? ]

Hyperlinks

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

You can use hyperlinks inside $description[], $addField[], webhook content/description, slash command response content, and ephemeral $onInteraction response content.

Syntax

[text\](link)

Note: This is the syntax for BDScript 2 and BDScript Unstable. For the BDScript, the syntax is [text](link).

Note: In the case of using hyperlinks inside slash command response content or ephemeral $onInteraction response content, the syntax for BDScript should be used. Does not apply to hyperlinks that are inside functions that support hyperlinks.

Example

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

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

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

Share code

“Share code” is a feature that lets users share a copy of their entire bot.

Creating a Share code

Here is how you can create a share code of your bot:

  • Select your bot in BDFD app homepage.
  • Head over to “Bot Settings” tab.
  • In “Share code” section, click “Create a share code” button.
  • Then, click “Generate share code” button and copy the code.

Now, you can give the code to your friend or someone other, and they will be able to create a carbon copy of your bot.

⚠️ Once a share code has been used, it expires after a month.

Resources

This section of the wiki contains useful information that will allow you to expand your knowledge.

API

Public Bot Designer for Discord API

Endpoints

The base URL is https://botdesignerdiscord.com/public/api

GET /function_list

Returns an array of functions

GET /function_tag_list

Returns an array of function tags

GET /function/:function

  • :function - function tag
    Returns a function

GET /emoji_alias_list

Returns a map, mapping emoji to a list of its aliases

Data Structures

  • Can be empty means the field can be set to a default value.
  • Can be omitted means the field might not be included in the response.

Function

Field nameTypeDescriptionCan be emptyCan be omitted
tagStringFunction nameFalseFalse
shortDescriptionStringDescription for a function without argumentsTrueFalse
longDescriptionStringDescription for a function with argumentsTrueFalse
argumentsArray of ArgumentsArguments needed by a functionTrueFalse
intentsIntegerDiscord intents needed by bot to execute this functionFalseFalse
premiumBoolfunction needs premiumFalseFalse
deprecatedBoolfunction is deprecatedFalseTrue
deprecatedForStringName of the function that should be used insteadFalseTrue

Argument

Field nameTypeDescriptionCan be omitted
nameStringArgument nameFalse
descriptionStringDescription for a function’s argumentTrue
typeString Argument TypesArgument type. | is used for a compound typeFalse
requiredboolArgument is requiredFalse
tupleTypesArray of ArgumentsArray of arguments which can be repeated, i.e channelID;messageID;channelID;messageID;...True
emptyBoolArgument can be emptyTrue
ellipsisBoolArgument accepts more data, i.e username1;username2;username3;...True
enumDataArray of StringsPossible options accepted as argument, i.e primary/secondary/or/etcTrue

Argument Types

Multiple types can be merged together with | (OR).
Possible argument types:

  • String
  • Integer
  • Float
  • Snowflake
  • Bool
  • Color
  • Permission
  • Duration
  • HowMany (>, 2, <, etc)
  • URL
  • Enum
  • Tuple

BDFD’s Creation

How Bot Designer For Discord became what it is today.

Who Develops BDFD?

NameDiscord UsernamePosition
Jakub TomanakubastickOwner/Developer
Mikołaj Radkowski_noitDeveloper
Bartłomiej SkoczeńminebarteksaDeveloper

The Company

NilPointer Software is the company that made 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 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 an ID?

An ID is a Discord object identifier. Let’s break this down:

  • An ‘object’ refers to a Discord channel, role, user, server/guild, etc.
  • An ‘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

    Go 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 a lot 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 an User - <@userID>
  • Mentioning a Role - <@&roleID>
  • Mentioning a Channel - <#channelID>
  • Using an Emoji
    • Static - <:emojiName:emojiID>
    • Animated - <a:emojiName:emojiID>
  • Mentioning a Slash
    • Normal - </name:commandID>
    • Subcommand - </name subcommandName:commandID>
    • Subcommand group - </name subcommandGroup subcommandName:commandID>
  • Mentioning a Guild - Guilds can’t be mentioned.

📝 Non-bots can use IDs to mention objects too!

Discord Timestamps

Discord timestamps are used to provide time in multiple formats. The information is given according to the user’s timezone and locale. Discord timestamps are built with the Unix Time system, meaning that they are dynamic. These can be used by anyone; This includes users, webhooks, and applications.

Syntax

Timestamp syntax: <t:unixTime:Style>

Styles

Here’s a list of all supported time format styles.

StyleInputOutputDescription
t<t:1667219160:t>12:26 AMShort Time
T<t:1667219160:T>12:26:00 AMLong Time
d<t:1667219160:d>10/31/2022Short Date
D<t:1667219160:D>October 31, 2022Long Date
f<t:1667219160:f>October 31, 2022 12:26 AMShort Date/Time
F<t:1667219160:F>Monday, October 31, 2022 12:26 AMLong Date/Time
R<t:1667219160:R>27 minutes agoRelative Time

📌 The default style is f, if no style provided.

Usability

Functions which return UNIX timestamp:

Example

$nomention
<t:$getTimestamp:D>

image

Embed Indexes

If you look around BDFD embed functions (eg. $title, $footer, $addTimestamp etc.). You’ll see an argument called index. This argument is used to create multi-embeds.

📝 Discord supports creating upto a maximum of 10 embeds per bot message.

Creating Multi-Embeds

By default, the index is set to 1 (the first embed). To create a second embed, you have to write 2 in index argument and so on. You can specify any number between 1 to 10 in index argument.

📝 Total character length of the overall response should not exceed more than 6,000. If it does, the bot won’t send the message.

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

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.

ex

The permissions assigned to these actions are referred to as “Elevated permissions”. Elevated permissions include but may not limited to :

  • admin
  • ban
  • kick
  • managechannels
  • manageemojis
  • managemessages
  • manageroles
  • manageserver
  • managethreads
  • managewebhooks

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

Permissions

Permissions allow users to have specific privileges and access in the server. Some permissions can be as basic as allowing users the ability to add reactions to messages while other permissions grant users more administrative actions. These permissions are based on the roles assigned to users in a server and permissions can be assigned per role on both the server level and channel level.

List of Permissions

Following is the list of permissions which are supported in BDFD -

PermissionDescription
addreactionsAllows to react emojis in messages (Doesn’t affect existing emojis in messages).
adminGrants all permissions and bypasses all channel permissions overwrites.
attachfilesAllows to upload attachments in channels.
banAllows banning/unbanning members.
changenicknamesAllows editing own server nickname.
connectAllows to join voice/stage channels.
createinstantinviteAllows to create invites.
createprivatethreadsAllows to create private threads.
createpublicthreadsAllows to create public threads.
embedlinksAllows to send embedded content and links in channels.
externalemojisAllows to use custom emojis from a different server.
externalstickersAllows to use custom stickers from a different server.
kickAllows kicking members.
managechannelsAllows to create/delete/modify channels of the server.
manageemojisAllows to create/delete/modify custom emojis and stickers of the server.
manageeventsAllows to create/delete/modify events in the server.
managemessagesAllows deleting messages of other members and pinning/unpinning messages in channels.
managenicknamesAllows to modify server members nicknames.
managerolesAllows to create/delete/modify server roles. It also allows modifying individual channel’s permissions.
manageserverAllows to create/modify AutoMod rules, add bots, view invites and change server settings.
managethreadsAllows to create/delete/modify channel threads.
managewebhooksAllows to create/delete/modify channel webhooks.
mentioneveryoneAllows to mention ping @everyone, @here and all server roles.
moderatemembersAllows to timeout/untimeout members. This permission is also known as “Timeout members”.
movemembersAllows to move members between voice/stage channels.
priorityspeakerAllows to be easily heard in voice/stage channels.
readmessagehistoryAllows to view channel message history.
readmessagesAllows to view a channel. This permission is also known as “View channel”.
requesttospeakAllows to request to speak in stage.
sendmessagesAllows to send messages in channels.
sendmessagesinthreadsAllows to send messages in threads.
sendvoicemessagesAllows to send voice messages in channels.
slashcommandsAllows to use application commands (i.e slash commands, context-menus) in channels. This permission is also known as “Use Application Commands”.
speakAllows to speak in voice/stage channel.
streamAllows to stream live in voice/stage channels.
ttsAllows to send text-to-speech (tts) messages.
usesoundboardAllows to use sounds from the server soundboard in voice channels.
usevadAllows to use voice-activity detection. Members without this permission will have to use push-to-talk voice feature. This permission is also known as “Use voice activity”.
viewauditlogAllows to view server audit logs.
viewguildinsightsAllows to view insights of a server.
voicedeafenAllows to deafen a member in voice/stage channel.
voicemuteAllows to mute a member from speaking in voice/stage channel.

📝 All permissions are case insensitive (i.e both BAN and Ban will work).

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 and Passwords

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) will grant them full access to edit your bot. While sharing your user account token with someone (or posting it publicly) will allow 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, etc.

In the event, that your bot’s token is shared, the only thing you can do to secure it is to regenerate the bot’s token. But by then, the damage has most likely been done. In the case of a user account token, if you still have access to your account, regenerate your token by changing your password. If you cannot or don’t have access to it anymore, you will need to contact Discord support for an optimal solution.

Passwords, like tokens, should not be shared. If, however, you accidentally share your account password, you should change it 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.

Sessions

Discord recently added the ability to see all your current sessions and their respective locations.

image

If you see a device or location that you haven’t authorised, you can log out of that particular device by pressing the ‘X’ button or all known devices by clicking the button at the bottom of the page. This will log out those sessions, invalidating the tokens. 

image
image
image

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 can identify between a trusted link and an untrusted link.

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

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

  3. 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 you should still be careful when clicking links from friends.

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

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

Sharding

Sharding is only available for bots with premium hosting time (AKA only for premium bots).

Sharding brings automatic separation of your bot between servers in order to speed up its operations and keep it stable when it has joined a large number of guilds.

Learn more about the sharding definition on TechTarget.

As stated in our Terms Of Service, we can’t guarantee you stable operation of your bot when it has joined a large number of guilds unless your bot has premium hosting time.

It should be noted that sharding doesn’t allow your bot to bypass the guild cap limit which is stated in our Terms Of Service.
Once your bot reaches the guild cap limit, the bot will no longer be able to be invited to any guild, unless the bot will leave other guilds.

If you’re wondering about if it’s possible to increase a guild cap limit for your bot, yes it’s possible.
You will have to contact the developers on this subject. But keep in mind, they may refuse for any reasons they see unfit and won’t increase it for reasons like “just in advance”, etc.
Also, your bot should be a premium bot in order to stably operate with a big number of guilds.

Time Format

Custom time formatting values for $creationDate, $userJoinedDiscord, and $userJoined functions.

Time Formats

List of supported time format values :

ValueReturn Information
2006Year
06Year (Short)
__2Day count of the year (Space-Padded)
002Day count of the year (Zero-Padded)
JanMonth (Short)
JanuaryMonth
01Numerical Month (Full)
1Numerical Month
MonWeek Day (Short)
MondayWeek Day
02Day (Full)
2Day
_2Day count of the month (Space-Padded)
PMAM/PM (Uppercase)
pmAM/PM (Lowercase)
05Second
5Second (Short)
1524-Hour
312-Hour (Short)
0312-Hour
4Minute (Short)
04Minute
MSTTimezone name
-07001Timezone offset (±hhmm)
-07:001Timezone offset (±hh:mm)
-071Timezone offset (±hh)
-0700001Timezone offset (±hhmmss)
-07:00:001Timezone offset (±hh:mm:ss)

📌 All time format values are case-sensitive.

1

Replacing the sign in the format with a Z character triggers the ISO 8601 behavior of printing Z instead of an offset for the UTC (+00:00) zone.

Troubleshooting

This page contains a number of troubleshooting that can help you to solve problems that BDFD users often encounter.

Summary

Troubleshooting for…

  1. $onJoined[]
  2. Moderation And Server Management Related Commands
  3. $addReactions, $addCmdReactions and $addMessageReactions
  4. $time
  5. Economy Related Commands
  6. Leaderboards
  7. Bot Issues
  8. App Issues

Let’s Troubleshoot Everything!


$onJoined[]

The Callback Doesn’t Work

The Null Reason
You misspelled the callback name. Make sure you don’t make any mistakes in the callback name.
Also, remember that callbacks are case-sensitive: you can’t write $onjoined[Channel ID], you must write $onJoined[Channel ID].

The 1st Reason
You specified the wrong Channel ID. How to get the Channel ID correctly:

For Desktop

Before starting, make sure you have Developer Mode enabled on Discord.

dev-desktop

id-desktop

For Mobile

Before starting, make sure you have Developer Mode enabled on Discord.

dev-mobile

id-mobile

Using a Function

Using the $channelID, $mentionedChannels or $findChannel functions, you can get the Channel ID of the desired channel. Check out these functions:

  1. $channelID
  2. $mentionedChannels
  3. $findChannel

The 2nd Reason
Your bot doesn’t have the sendmessages and/or the embedlinks permission that allow the bot to send messages (or embed messages) in a given channel.
Best Practice Solution
Grant both of these permissions to the bot in the desired channel through the channel’s permissions settings:

edit-channel
perms
add
search
message
embed
save

The 3rd Reason
There’s a critical error in your code.
Callbacks can’t return errors that occurred during code execution. Therefore, sometimes it’s difficult to solve errors in the callback code.
Best Practice Solution
Try debugging your command as a text command. In most cases, they’re backward compatible with the $onJoined callback, since both, by default, process the actions of the command author (when a user joins the server, this user becomes the “author” of this callback).

The 4th Reason
Members Intent isn’t enabled.
This callback requires the Members Intent to be enabled.

Read the Gateway Intents Guide for more details.

The 5th Reason
You have several commands with this callback.
You can only have one command with this callback. If you want to make a unique welcome message for multiple servers instead of just one, then check out Per-Server $onJoined.


The Bot Can’t Assign Or Take Roles

The 1st Reason
Your bot doesn’t have the manageroles permission. Make sure that one of the roles that the bot has, has this permission enabled.

perm-mroles

The 2nd Reason
You are trying to assign or take roles that are higher than the highest role your bot has.

Gives an Error When Trying To Moderate a Member

The 1st Reason
Your bot has lower priority than the specified user.
This means that the highest role your bot has is lower in position than the highest role the specified user has.
Or, the specified user is the owner of the server.

The 2nd Reason
Your bot doesn’t have the required permissions. Make sure that the permission list of any role that the bot has, have these required permissions.

  • If you’re trying to ban a user.
    perm-ban
  • If you’re trying to kick a user.
    perm-kick
  • If you’re trying to timeout a user.
    perm-timeout
  • If you’re trying to change user’s nickname.
    perm-nick

    ⚠ Important note: bots can’t change the owner’s nickname!

Gives an Error When Trying To Purge Messages

The 1st Reason
Your bot doesn’t have the managemessages permission. Make sure that one of the roles that the bot has, has this permission enabled.

perm-mmesages

The 2nd Reason
You are trying to purge messages that have been around for more than two weeks.
BDFD uses a bulk request to purge messages, and it can’t process messages that are more than two weeks old.


$addReactions, $addCmdReactions and $addMessageReactions

The Bot Fails To Add Reactions

The 1st Reason
The user has blocked the bot, so the bot can’t react to the user’s messages. This works exactly the same if the user has blocked another user.

The 2nd Reason
You’re specifying the emoji in the function argument incorrectly.

  • Default emojis.

    - $addCmdReactions[joy]
    + $addCmdReactions[:joy:]
    + $addCmdReactions[😂]
    
  • Custom emojis.

    - $addCmdReactions[:pikachu:]
    - $addCmdReactions[\:pikachu:]
    + $addCmdReactions[<:pikachu:951437967711420456>]
    

    You must use the Emoji ID form of the desired emoji.

The 3rd Reason
Case with custom emojis.
Your bot must share a server with the specified emoji in order to use it. It works like Discord Nitro.


$time

The Function Returns an Error

The 1st Reason
Incorrect use of the function. The function doesn’t return the current time or anything like that.
The function’s role is to change the timezone for time-related functions (such as $day, $hour, and so on)

The 2nd Reason
Incorrect time zone or incorrect time zone format.
BDFD uses the official IANA time zone database for time zone information.
Please use the TZ Database name from this list in the $time function.

- $time[America]
- $time[New_York]
+ $time[America/New_York]

  • This part will have fully working and quality code examples that you can use in your bot.
  • In this part, examples and more will be based on the local economy and BDScript 2.
Variable NameDefault Variable ValueOur Variable ValueTarget’s Variable Value
Money0100120

Negative Balance

The 1st Possible Solution
Adding limiters or if statements that will prevent actions in which the executor’s or target’s balance becomes negative.
This solution can be an alternative to “Prevent actions when the amount is greater than the user’s balance”.

ArgumentContent
1st - TargetAfternoon
2nd - Amount50
3rd - CommentHappy Birthday!
View Arguments Formatting In Code.
  • Target

    $var[target;$findUser[$message[1];no]]
    
  • Amount

    $var[amount;$message[2]]
    
  • Comment

    $var[comment;$trimSpace[$replaceText[$replaceText[$message;$message[1];];$message[2];]]]
    

  • Limiters Method

    $var[ourNewBalance;$sub[$getUserVar[Money];$var[amount]]]
    
    $onlyIf[$var[ourNewBalance]>0;Error Message]
    
  • If Statements Method

    $var[ourNewBalance;$sub[$getUserVar[Money];$var[amount]]]
    
    $if[$var[ourNewBalance]<0]
        Error Message
    $else
        Code
    $endif
    

Pay Command

Expand Code Example (67 lines)
$nomention
$allowMention

$if[$argCount[$message]<2]
    $color[FF544C]
    $title[Payment System]
    $description[Missing Argumets! Example Command: `!pay <user> <amount> (comment)`]
    $stop
$endif

$var[target;$findUser[$message[1];no]]
$var[amount;$message[2]]
$var[comment;$trimSpace[$replaceText[$replaceText[$message;$message[1];];$message[2];]]]

$if[$var[target]==]
    $color[FF544C]
    $title[Payment System]
    $description[User (1st argument) not found on the server!]
    $stop
$endif

$if[$var[target]==$authorID]
    $color[FF544C]
    $title[Payment System]
    $description[You cannot pay yourself!]
    $stop
$endif

$if[$isNumber[$var[amount]]==false]
    $color[FF544C]
    $title[Payment System]
    $description[Amount (2nd argument) must be a number!]
    $stop
$endif

$if[$checkContains[$var[amount];.]==true]
    $color[FF544C]
    $title[Payment System]
    $description[Amount (2nd argument) must be an integer!]
    $stop
$endif

$if[$var[amount]<0]
    $color[FF544C]
    $title[Payment System]
    $description[Amount (2nd argument) cannot be less than 0!]
    $stop
$endif

$if[$var[comment]==]
    $var[comment;Not provided.]
$endif

$var[ourNewBalance;$sub[$getUserVar[Money];$var[amount]]]

$if[$var[ourNewBalance]<0]
    $color[FF544C]
    $title[Payment System]
    $description[❌ Hey <@$authorID>! What are you left with if you try to make such a payment?]
$else
    $color[7EFF88]
    $title[Payment System]
    $description[✔ You have successfully paid <@$var[target]> $var[amount] money! **Comment**: $var[comment]]

    $setUserVar[Money;$sum[$getUserVar[Money;$var[target]];$var[amount]];$var[target]]
    $setUserVar[Money;$var[ourNewBalance]]

    $if[$isUserDMEnabled[$var[target]]==true]
        $sendEmbedMessage[$dmChannelID[$var[target]];;Payment System;;Good time! <@$authorID> paid you $var[amount] money and left a comment: $var[comment];7EFF88]
    $endif
$endif
Expand Code Breakdown
  •   $if[$argCount[$message]<2]
          $color[FF544C]
          $title[Payment System]
          $description[Missing Argumets! Example Command: `!pay <user> <amount> (comment)`]
          $stop
      $endif
    

    Checks the number of arguments in the code.
    If there are less than 2 arguments, an embed error will be returned and code execution will be stopped.

  •   $var[target;$findUser[$message[1];no]]
      $var[amount;$message[2]]
      $var[comment;$trimSpace[$replaceText[$replaceText[$message;$message[1];];$message[2];]]]
      <...>
      $var[ourNewBalance;$sub[$getUserVar[Money];$var[amount]]]
    

    Argument formatting. *

      $var[ourNewBalance;$sub[$getUserVar[Money];$var[amount]]]
    

    Calculates the our future balance after making a payment.

  •   $if[$var[target]==]
          $color[FF544C]
          $title[Payment System]
          $description[User (1st argument) not found on the server!]
          $stop
      $endif
    

    Checks if the target is present on the current server.
    If not, an embed error will be returned and code execution will be stopped.

  •   $if[$var[target]==$authorID]
          $color[FF544C]
          $title[Payment System]
          $description[You cannot pay yourself!]
          $stop
      $endif
    

    Checks if the command author is the target.
    If yes, an embed error will be returned and code execution will be stopped.

  •   $if[$isNumber[$var[amount]]==false]
          $color[FF544C]
          $title[Payment System]
          $description[Amount (2nd argument) must be a number!]
          $stop
      $endif
    

    Checks if the specified amount is a valid number.
    If not, an embed error will be returned and code execution will be stopped.

  •   $if[$checkContains[$var[amount];.]==true]
          $color[FF544C]
          $title[Payment System]
          $description[Amount (2nd argument) must be an integer!]
          $stop
      $endif
    

    Checks if the specified amount is an integer.
    If not, an embed error will be returned and code execution will be stopped.
    Exists in order to avoid payments with floating (decimal) numbers.

  •   $if[$var[amount]<0]
          $color[FF544C]
          $title[Payment System]
          $description[Amount (2nd argument) cannot be less than 0!]
          $stop
      $endif
    

    Checks if the specified amount is less than 0.
    If yes, an embed error will be returned and code execution will be stopped.

  •   $if[$var[comment]==]
          $var[comment;Not provided.]
      $endif
    

    Checks for a comment. If there is no comment (the argument is empty), “Not provided.” will be written as comment.

  •   $if[$var[ourNewBalance]<0]
          $color[FF544C]
          $title[Payment System]
          $description[❌ Hey <@$authorID>! What are you left with if you try to make such a payment?]
      $else
          $color[7EFF88]
          $title[Payment System]
          $description[✔ You have successfully paid <@$var[target]> $var[amount] money! **Comment**: $var[comment]]
    
          $setUserVar[Money;$sum[$getUserVar[Money;$var[target]];$var[amount]];$var[target]]
          $setUserVar[Money;$var[ourNewBalance]]
    
          $if[$isUserDMEnabled[$var[target]]==true]
              $sendEmbedMessage[$dmChannelID[$var[target]];;Payment System;;Good time! <@$authorID> paid you $var[amount] money and left a comment: $var[comment];7EFF88]
          $endif
      $endif
    

    The main part of the command, where:

    1. Checking whether our balance will be negative. If yes, an embed error will be returned.

    2. Changing our variable value (money withdrawal) and the target’s variable value (money replenishment).

      $setUserVar[Money;$sum[$getUserVar[Money;$var[target]];$var[amount]];$var[target]]
      $setUserVar[Money;$var[ourNewBalance]]
      
    3. Sending an embed message to the target’s DMs that we have made a payment.
      The message will be sent only if the target’s DMs are enabled.

      $if[$isUserDMEnabled[$var[target]]==true]
          $sendEmbedMessage[$dmChannelID[$var[target]];;Payment System;;Good time! <@$authorID> paid you $var[amount] money and left a comment: $var[comment];7EFF88]
      $endif
      
Expand Attachments

p-ex-1 p-ex-2 p-ex-3 p-ex-4 p-ex-5 p-ex-6

The 2nd Possible Solution
Setting the balance to 0 if the future balance becomes negative.
This solution may be suitable for gambling-related commands, if you do not want the user’s balance to become negative in case of losses.

ArgumentContent
1st - Bet60
View Arguments Formatting In Code.
  • Bet
    $var[bet;$message[1]]
    

$var[ourNewBalance;$sub[$getUserVar[Money];$var[bet]]]

$if[$var[ourNewBalance]<0]
    $var[ourNewBalance;0]
$endif

Roulette Command

Expand Code Example (53 lines)
$nomention

$var[bet;$message[1]]

$if[$isNumber[$var[bet]]==false]
    $color[FF544C]
    $title[Roulette]
    $description[Bet must be a number!]
    $stop
$endif

$if[$checkContains[$var[bet];.]==true]
    $color[FF544C]
    $title[Roulette]
    $description[Bet must be an integer!]
    $stop
$endif

$if[$var[bet]>$getUserVar[Money]]
    $color[FF544C]
    $title[Roulette]
    $description[The bet cannot be higher than your balance!]
    $stop
$endif

$if[$var[bet]<0]
    $color[FF544C]
    $title[Roulette]
    $description[The bet cannot be less than 0!]
    $stop
$endif

$var[bet;$multi[$var[bet];2]]

$if[$random[1;3]==1]
    $var[ourNewBalance;$sum[$getUserVar[Money];$var[bet]]]
    
    $color[7EFF88]
    $title[Roulette]
    $description[Wow, you are lucky! You have won $var[bet]!]
$else
    $var[ourNewBalance;$sub[$getUserVar[Money];$var[bet]]]
    
    $color[FF544C]
    $title[Roulette]
    $if[$var[ourNewBalance]<0]
        $var[ourNewBalance;0]
        $description[What a pity! You lost and became bankrupt!]
    $else
        $description[What a pity! You have lost the $var[bet].]
    $endif
$endif

$setUserVar[Money;$var[ourNewBalance]]
Expand Code Breakdown
  •   $var[bet;$message[1]]
    

    Argument formatting.

  •   $if[$isNumber[$var[bet]]==false]
          $color[FF544C]
          $title[Roulette]
          $description[Bet must be a number!]
          $stop
      $endif
    

    Checks if the bet is a valid number.
    If not, an embed error will be returned and code execution will be stopped.

  •   $if[$checkContains[$var[bet];.]==true]
          $color[FF544C]
          $title[Roulette]
          $description[Bet must be an integer!]
          $stop
      $endif
    

    Checks if the bet is an integer.
    If not, an embed error will be returned and code execution will be stopped.
    Exists in order to avoid bets with floating (decimal) numbers.

  •   $if[$var[bet]>$getUserVar[Money]]
          $color[FF544C]
          $title[Roulette]
          $description[The bet cannot be higher than your balance!]
          $stop
      $endif
    

    Checks if the bet is higher than our balance.
    If yes, an embed error will be returned and code execution will be stopped.

  •   $if[$var[bet]<0]
          $color[FF544C]
          $title[Roulette]
          $description[The bet cannot be less than 0!]
          $stop
      $endif
    

    Checks if the bet is less than 0.
    If yes, an embed error will be returned and code execution will be stopped.

  •   $if[$random[1;3]==1]
          $var[ourNewBalance;$sum[$getUserVar[Money];$var[bet]]]
          <...>
      $else
          $var[ourNewBalance;$sub[$getUserVar[Money];$var[bet]]]
          <...>
          $if[$var[ourNewBalance]<0]
              $var[ourNewBalance;0]
              <...>
          $else
              <...>
          $endif
      $endif
    
      $setUserVar[Money;$var[ourNewBalance]]
    

    Manages roulette results. If $random[1;3] equals 1, then we win and the bet is added to the balance in the doubled amount. Otherwise, the bet will be taken away from the balance in doubled amount.
    If the future balance in case of loss will be negative, it will be set to 0.

Expand Attachments

r-ex-1 r-ex-2
r-ex-3

Desynchronized Balance

The Balance Is Different On Different Servers

This is because you’re probably using $setUserVar and $getUserVar in your economy. But these functions are based as local variables. Their values are unique for each server.
If you want the same balance on all servers, you should use $setVar and $getVar (with userID arguments). These functions are based on global user variables.

The Displayed Balance Is Different For Different Commands

Most often this is because you’ve mixed up the variable functions and you’re using the wrong variable type.
For example, if you use $setUserVar and $getUserVar in the Roulette command and $getVar in the Balance command, this will show different values. The solution to this is to replace $getVar with $getUserVar in the Balance command, or vice versa, replace $setUserVar and $getUserVar with $setVar and $getVar accordingly in the Roulette command.
Note: don’t forget that global user variables require a userID argument.


Leaderboards

The Leaderboard Is Empty

The 1st Reason
You’ve chosen the wrong leaderboard function.

The 2nd Reason
(In case you are using the $getLeaderboardValue function)
You specified the wrong variable type.

The 3rd Reason
The leaderboard haven’t generated yet.
Sometimes it takes a while to generate the leaderboard.

The User’s Value Isn’t Updated

As with the generation of the leaderboard, updating it can also take a while.
This can be mainly due to the fact that the leaderboard has a large database (i.e. the total number of users with a modified variable value other than the default).


Bot Issues

The Bot Is Offline

The 1st Reason
The node is restarting. While the node is restarting, logically, the bot can’t work.
Usually restarting doesn’t take more than 5-10 minutes.
So please wait a while and have a cup of tea or coffee while the node restarts.

The 2nd Reason
For some reason, your bot’s token is no longer valid or the BDFD app thinks so.
You can solve this problem by regenerating your bot’s token on the developer portal and then replacing the old token with the new one in the BDFD app bot’s Settings tab.

The 3rd Reason
Not a common problem, but possible. The node your bot is running on is experiencing problems.
In this case, join the support server, create a ticket using the !new command and tell the staff your bot’s ID and node number, if you know it (node number can be found out using the $botNode function when your bot is online).
The staff will inform the developers of the current problems, providing the scale of the problem (affected bots and/or nodes).
Please don’t regenerate your bot token in this case, as it leads to node change. If everyone starts changing their node because there is a problem on that node, then a healthy node can also be affected by this problem.

The Bot Doesn’t Respond

The 1st Reason
If your bot is based on text commands and you don’t have the Message Content Intent enabled.
You must enable it in your bot’s settings to use text commands.
Read the Gateway Intents Guide for more details.

The 2nd Reason
Your bot doesn’t have the necessary permissions.
In order for your bot to respond correctly to a command, it must have permissions for Send Messages, Embed Links (if your code has embed functions), and Read Messages in order for the bot to have access to the channel.

The Bot Goes Offline From Time To Time

This is due to the fact that nodes are restarted from time to time to maintain the stable operation of all the bots that also work on this node.

Desynchronization of Commands

Desynchronization of commands means, for example, that you have deleted a command but the bot still responds to it (aka. Ghost Command), or you see a different code of your command in the web app and another in the mobile app.

Ghost Command

Not many people encounter this problem, but it’s still worth mentioning.
This problem is related to database synchronization (between your application data and your bot’s data in the database).
Solution Options
The 1st Solution
Restart the app.
Close the app from Recent apps and reopen it. This may result in a deleted command reappearing due to desync with the database. You can just delete that command again.

The 2nd Solution
Attempting to forcibly restart the bot.
You can do this in the settings of your bot in the app. Restarting the bot can send a retransfer of data from the application to the database, and then the deleted command will be deleted for real.

The Solution Options Didn’t Help
In this case, join the support server, create a ticket using the !new command and tell the staff your bot’s ID.
The staff will mention one of the developers to take a look at this problem with your bot.

The Bot Takes A Long Time To Respond

The 1st Reason
Your code is too long and/or complicated.
This may be the obvious reason if it is. Executing large and complex code takes more resources.
When writing code, you should think about how to make it more compact and less complex, but in a way that makes your idea come to fruition.

The 2nd Reason
Your bot was rate limited. This can happen because of excessive requests to the Discord API, performed by BDFD functions (such as $addEmoji and others).
You should not stack such functions and try to perform them all at once.

The 3rd Reason
The node your bot is running on is experiencing some slight problems (such as a rate limit). If you’re sure this is the case, you can regenerate the bot’s token and replace it with a new one. This will cause your bot to change its node.

The Slash Commands Don’t Appear

The 1st Reason
Old version of the application. Make sure that you have the latest version of the application installed.
New versions of the application have been improved and updated, and new features have been added. In addition, errors with the validity check of the slash commands have been fixed. You will be warned if you set up your slash command incorrectly, in which case the application will not allow you to save the slash command.

The 2nd Reason
Slash commands are cached by discord, so it takes time before they appear in discord.

They’re also cached on the client side, if they were successfully cached in discord. If other users have a new slash command and you don’t, restart your discord client.
Restarting will cause existing slash commands to be cleared and new ones will cache.

The 3rd Reason
Conflict of slash commands due to other services that you’re no longer using. For example, if two slash commands of same type have the same name, but one is created using a third-party service, and the other through the BDFD App, this can cause a conflict and the slash command will not appear.
You can solve this problem by Syncing slash commands with discord in the bot’s settings. This removes third-party service slash commands and leaves only those that were created in our application.

sync

Integration Requires Code Grant

You can only get this error when trying to invite a bot to any server.
Most likely, you have accidentally or unknowingly enabled the Require OAuth2 Code Grant option in your bot’s settings in the developer portal.
This is the reason why you get this error.

This option is required only for applications with scopes such as identify, email, and others to work with the user account in Discord. BDFD doesn’t have such support, so you should not enable this option or choose any other scopes other than bot.


App Issues

The Ad Button Doesn’t Work

The 1st Reason
Unstable Internet connection. Make sure your Internet connection is stable and not too slow, because you have to load the ad first to watch it. This is why you see “Loading ad…”.

The 2nd Reason
There’re no more ads for you. If that’s the reason, there’s nothing we can do about it, it’s the provider who provides the ads, not us. Try to see the ad later. If the case persists, go to our support server, create a ticket using the !new command and inform the staff about your problem by providing a screen recording longer than 30 seconds.

The 3nd Reason
The advertising provider we use is blocked in your country or region. There is nothing we can do in this case.

Possible Solutions

  1. Clearing the application cache and restarting it.
  2. Using VPN services. This may be the best solution for the 2nd and 3rd reasons, and in some cases for the 1st reason.
  3. In a desperate case, restart the smartphone and/or reinstall the app.

    If you decide to reinstall the app, make sure that you are logged in to the app, otherwise you will lose access to your bots.

Ghost Functions From The Changelog

In this section, the easiest way to explain everything is through dialogue:

I was told by a friend that a new function, $botOwnerID, has just been added to the changelog or recently. I'm trying to use it, but it just doesn't work. What I mean is: This is normal. Right, the function has already been added and exists, but it can't be used at the moment. The nodes (the place where your bots work) have not yet been updated, or your exact node has not yet been updated. The update will slowly be released to each node over time. It isn't released to all nodes at once for the purpose of testing the stability and performance of the update. Usually, all nodes are updated by the end of the month. Allright, thank you! I will wait patiently! You're welcome, Random Guy.

The Translation Feature Doesn’t Work

The 1st Reason
There’s no translation support for your language yet. You should wait patiently for them, or if you speak English well, you can help to translate our app yourself!
If you would like to help, go to our support server and create a ticket (using the !new command). You can then apply for the Translator role there by asking support for it.

The 2nd Reason
Your main system language is incorrect.
Our app uses the main system language for translations and it disregards any secondary languages.
So, for example, if you have English as your main system language and Russian as your second system language, the app will stay in English.

In order to have the app in Russian, you should reorder your language settings and set Russian as the main one.


That’s Where The List Of Troubleshootings Ends

If you know of other problems that users often encounter or have suggestions, feel free to let us know on the support server or by contributing!

BDScript

In this section of the wiki, you will learn about the functions that exist in BDScript. Using functions is an integral part of your bot, because thanks to them you will bring functionality to your bot!

Remember that any function starts with a $ sign. For example, $nomention or $ping. It is also worth remembering that the name is case sensitive.

$addButton

Adds a button to a message.

Syntax

$addButton[New row?;Interaction ID/URL;Label;Style;(Disable?;Emoji;Message ID)]

Parameters

  • New row? (Type: Bool || Flag: Required): If set to yes, the button will appear in a new row. If set to no, the button will appear in the same row as the previous button.

    A message can have a maximum of 25 buttons (5 rows of 5 buttons).

  • Interaction ID/URL (Type: String, URL || Flag: Required): Depending on the button type, you either set it to Interaction ID which is then used in $onInteraction[ID] callback or URL if it’s a link button.

  • Label (Type: String || Flag: Emptiable): The text value visible on the button.

  • Style (Type: Enum || Flag: Required): It’s used to specify the button’s background color. If the button has a link/URL, you have to set the value to link. Check this section for more details.

  • Disable? (Type: Bool || Flag: Vacantable): If set to yes, the button can’t be pressed. Defaults to no.

  • Emoji (Type: Emoji || Flag: Vacantable): Adds an emoji inside the button. Emojis have to be either pasted as unicode, alias or be in the following format <:emoji name:emoji ID>.

  • Message ID (Type: Snowflake || Flag: Vacantable): Adds the button to the provided message ID. It’s important to note that the provided message ID author has to be the bot.

Interactive buttons can’t have duplicated ID’s in the same message. So for example, you can’t have two buttons with the ID set to test.

If URL is used in the Interaction ID/URL argument, it has to start with http:// or https://.

Button Style

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

  • primary - Blue button
  • secondary - Gray button
  • success - Green button
  • danger - Red button
  • link - Redirect button
Buttons: Primary Primary Success Success Danger Danger Secondary Secondary Other Buttons: Link Link Emoji

If link style is used, the button won’t send any interactions!

Example

$nomention
Hello
$addButton[no;test;Say hello!;primary;no;]
!example Hello Say hello!

For more info, see the Buttons Guide.

$addCmdReactions

Adds reactions to the message that triggered the command.

Syntax

$addCmdReactions[Emojis;...]

Parameters

  • Emojis (Type: Emoji || Flag: Required): The emoji(s) the bot reacts with. Use semicolons ; as a separator to separate multiple emojis.

You can use unicode emojis, emoji IDs, and emoji aliases.

For emoji aliases, make sure to put : in front and at the end of the alias.
For emoji IDs, the bot must be present in the server that the emoji originates from.

List of unicode emojis: 😋 Get Emoji
List of supported emoji aliases: Emoji Aliases

Example

$nomention
$addCmdReactions[$message]
!example ❤️

How to get emoji ID?

This method requires Developer Mode to be enabled!

  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>])

example

If you’re still having issues, check the Troubleshooting page.

$addEmoji

Adds an emoji to the server.

Syntax

$addEmoji[Name;Image URL;Return emoji?]

Parameters

  • Name (Type: String || Flag: Required): The name of the new emoji.
  • Image URL (Type: URL || Flag: Required): The image of the new emoji. The link needs to be a valid image URL.
  • Return emoji? (Type: Bool || Flag: Required): Whether to show the emoji in the bot’s message or not. (yes/no)

Example

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

example

$addField

Adds a field to an embed.

Syntax

$addField[Name;Value;(Inline?;Index)]

📌 You can add up to 25 fields per embed.

Parameters

  • Name (Type: String || Flag: Required): The name of the field. It cannot exceed more than 256 characters.
  • Value (Type: String || Flag: Required): The value of the field. It cannot exceed more than 1024 characters.
  • Inline? (Type: Bool || Flag: Optional): If yes, fields will appear in the 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. It is set to no by default.
  • Index (Type: Integer || Flag: Optional): Adds the field to a specified embed index number. (learn more)

💡 Inline fields may not appear inline on some mobile devices.

Examples

Without inline fields

$nomention
$addField[The field name 1!;The field value 1!]
$addField[The field name 2!;The field value 2!]
$addField[The field name 3!;The field value 3!]
!example The field value 1! The field value 2! The field value 3!

With inline fields

$nomention
$addField[The field name 1!;The field value 1!;yes]
$addField[The field name 2!;The field value 2!;yes]
$addField[The field name 3!;The field value 3!;yes]
!example The field value 1! The field value 2! The field value 3!

$addMessageReactions

Adds reactions to the specified message.

Syntax

$addMessageReactions[Channel ID;Message ID;Emojis;...]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of the channel where the message is located.
  • Message ID (Type: Snowflake || Flag: Required): The ID of the message to which the reactions will be added.
  • Emojis (Type: Emoji || Flag: Required): The emoji(s) to add as reaction to the message. Use semicolons ; as a separator to separate multiple emojis.

You can use unicode emojis, emoji IDs, and emoji aliases.

For emoji aliases, make sure to put : in front and at the end of the alias.
For emoji IDs, the bot must be present in the server that the emoji originates from.

List of unicode emojis: 😋 Get Emoji
List of supported emoji aliases: Emoji Aliases

Example

$nomention
$trimContent
$addMessageReactions[$channelID;$message[1];👍;✨;<:coolemoji:991742553340792882>]

Successfully added the reactions to the message.

example1

How to get emoji ID?

This method requires Developer Mode to be enabled!

  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 $addMessageReactions[]. (e.g. $addMessageReactions[$channelID;1123254137547653222;<:hollyDab:828628880629825546>])

example2

If you’re still having issues, check the Troubleshooting page.

$addReactions

Adds reactions to the bot’s response.

Syntax

$addReactions[Emojis;...]

Parameters

  • Emojis (Type: Emoji || Flag: Required): The emoji(s) the bot reacts with. Use semicolons ; as a separator to separate multiple emojis.

You can use unicode emojis, emoji IDs, and emoji aliases.

For emoji aliases, make sure to put : in front and at the end of the alias.
For emoji IDs, the bot must be present in the server that the emoji originates from.

List of unicode emojis: 😋 Get Emoji
List of supported emoji aliases: Emoji Aliases

Example

$nomention
Yes or No?
$addReactions[✅;:x:]
!reactions Yes or No?

How to get emoji ID?

This method requires Developer Mode to be enabled!

  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>])

example

If you’re still having issues, check the Troubleshooting page.

$addSelectMenuOption

Adds a new select menu option to an existing select menu.

Syntax

$addSelectMenuOption[Menu option ID;Label;Value;Description;(Default?;Emoji;Message ID)]

Parameters

  • Menu option ID (Type: String || Flag: Required): The ID used in $newSelectMenu[].
  • Label (Type: String || Flag: Required): The name of the option.
  • Value (Type: String || Flag: Required): It’s the data that gets passed to the $onInteraction[] callback. The value has to be unique in the select menu!
  • Description (Type: String || Flag: Emptiable): A text which shows up under the Label.
  • Default? (Type: Bool || Flag: Vacantable): Whether the option should be selected by default or not. Defaults to no. (yes/no) There can be only one default option!
  • Emoji (Type: Emoji || Flag: Vacantable): The emoji that shows up next to the Label.
  • Message ID (Type: String || Flag: Vacantable): The ID of a message that should have a new select menu option added to an existing select menu. By default it’s the bot’s response.

Example

$nomention
$newSelectMenu[Example;1;1;Choose some option]
$addSelectMenuOption[Example;First;first-option;The first option]
$addSelectMenuOption[Example;Second;second-option;The second option]
$addSelectMenuOption[Example;Third;third-option;The third option]

example
example

For more info, see the Select Menu Guide.

$addTextInput

Adds a new text input field to a modal.

Syntax

$addTextInput[Text input ID;Style;Label;(Minimum length;Maximum length;Required?;Value;Placeholder)]

📌 You can add up to 5 text input fields to a modal.

Parameters

  • Text input ID (Type: String || Flag: Required): The ID that is used to retrieve the text input in the field. This value must be unique!
  • Style (Type: Enum || Flag: Required): The text input field style, either short or paragraph.
  • Label (Type: String || Flag: Required): The name of the text input field. This value must be less than or equal to 45 characters.
  • Minimum length (Type: Integer || Flag: Vacantable): Minimum number of characters a user needs to input. This value must be an integer between 0 and 4000, and can’t be greater than the Maximum length.
  • Maximum length (Type: Integer || Flag: Vacantable): Maximum number of characters a user can input. This value must be an integer between 0 and 4000, and can’t be less than the Minimum length.
  • Required? (Type: Bool || Flag: Optional): Whether a user must fill in the text input field or not. Defaults to yes. (yes/no)
  • Value (Type: String || Flag: Vacantable): The text that is written by default in the text input field. This value must be less than or equal to 4000 characters and must not be less than Minimum length and no more than Maximum length.
  • Placeholder (Type: String || Flag: Vacantable): The text that is displayed if the text input field is empty. This value must be less than or equal to 100 characters.

Styles

  • short - A small text input field.
  • paragraph - A big text input field.

styles

Example

$nomention
$newModal[modal;User Bio]
$addTextInput[modalInput1;short;What is your name?;3;30;yes;;Mikołaj]
$addTextInput[modalInput2;short;What are your pronouns?;2;30;yes;;He/Him]
$addTextInput[modalInput3;paragraph;Can you tell us about yourself?;5;1000;no;;I am a Developer]

example

For more info, see the Modals Guide.

$addTimestamp

Adds a timestamp to an embed.

Syntax

$addTimestamp

Example

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

example

$addTimestamp[]

Adds a timestamp to a specific embed.

Syntax

$addTimestamp[Index]

Parameters

  • Index (Type: Integer || Flag: Optional): To which embed the timestamp should be added to. (learn more)

Example

$nomention
$description[Hi!]
$description[Timestamp!;2]
$footer[That is the timestamp =>;2]
$addTimestamp[2]

example

$allMembersCount

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

Syntax

$allMembersCount

Example

$nomention
I'm serving $allMembersCount users!
!example I'm serving 8560 users!

$allowMention

Disables replacing mentions in $message with text.

Syntax

$allowMention

Example

$nomention
$allowMention
$message

With $allowMention:

!example RainbowKey RainbowKey

Without $allowMention

!example RainbowKey @RainbowKey

$allowRoleMentions

Enables role pings only for the provided role IDs, while the roles not provided will be “fake pinged” (the role will be pinged, but users will not be notified).

Syntax

$allowRoleMentions[Role IDs;...]

Parameters

  • Role IDs (Type: Snowflake || Flag: Emptiable): The role(s) 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 I'm pinging Extremely Cool Role, but no one got notified; wow!

$allowUserMentions

Enables user pings only for the provided user IDs, while the user not provided will be “fake pinged” (the user will be pinged, but user will not be notified).

Syntax

$allowUserMentions[User IDs;...]

Parameters

  • User IDs (Type: Snowflake || Flag: Emptiable): The user(s) 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.
!example Hi Spen! I mentioned you, but you didn't get pinged.

$alternativeParsing

Changes the way how triggers are read.

Syntax

$alternativeParsing

This function was added at the end of 2019 as an experiment, and it can be unstable and break your commands. You should not use $alternativeParsing when making your bot.

Example

  1. Create two commands and set the trigger hello for one command and helloworld for the other.

  2. Add the $alternativeParsing function to the command code with the hello trigger.

    Code with trigger hello:

    $nomention
    $alternativeParsing
    $description["hello"]
    

    Code with trigger helloworld:

    $nomention
    $description["helloworld"]
    
  3. Execute commands.

    With $alternativeParsing

    hello "hello" helloworld "helloworld"

    Without $alternativeParsing

    hello "hello" helloworld "helloworld" "hello"

$and

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

Syntax

$and[Conditions;...]

Parameters

  • Conditions (Type: String || Flag: Required): Checks that will be carried out. All conditions must be true for this function to return true. Separate conditions using ;.

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.

Example

$nomention
$and[$nickname==MineBartekSA;$message==Update]
!example Update false !example false !example false !example Update true

For more info, see the If Guide.

$argCount

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

Syntax

$argCount[Text]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to get the word count for.

Example

$nomention
Word count: $argCount[$message]
!example Hello noit! Word count: 2

$argsCheck

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

Syntax

$argsCheck[How many?;Error message]

Parameters

  • How many? (Type: HowMany || Flag: Required): How many arguments there should be in the user’s message.

    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 (Type: String || Flag: Emptiable): The message that the bot will send if the user has too many/few arguments.

Example

$nomention
$argsCheck[>1;❌ Please provide something for me to say!]
$message
!example ❌ Please provide something for me to say! !example Hello World! Hello World!

$author

Adds author text to an embed.

Syntax

$author[Text;(Index)]

Parameters

  • Text (Type: String || Flag: Emptiable): The text that appears in the author text. It cannot exceed more than 256 characters.
  • Index (Type: Integer || Flag: Optional): To which embed the author text will be added. (learn more)

Example

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

$authorAvatar

Returns the author’s avatar URL.

Syntax

$authorAvatar

Example

$nomention
$image[$authorAvatar]
!authorAvatar

You can use ?size=size at the end of the avatar URL to increase/decrease the image size. Example sizes: 1024, 2048, 4096.

(e.g. $image[$authorAvatar?size=4096])

$authorIcon

Adds an icon to the author section in the embed.

Syntax

$authorIcon[Image URL;(Index)]

$authorIcon[] will not work if there is no text provided in $author[].

Parameters

  • Image URL (Type: URL || Flag: Emptiable): The image for the author icon. This must be a valid image URL.
  • Index (Type: Integer || Flag: Optional): To which embed the author icon will be added. (learn more)

Example

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

$authorID

Returns message’s author ID.

Syntax

$authorID

Example

$nomention
This command was executed by <@$authorID>!
!example This command was executed by Nicky!

$authorOfMessage

Returns the ID of the provided message’s author.

Syntax

$authorOfMessage[Channel ID;Message ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel where the message is located.
  • Message ID (Type: Snowflake || Flag: Required): The message for which the author ID will be returned.

How to get the Message/Channel ID guide.

Example

$nomention
Author of message: $username[$authorOfMessage[$message[1];$message[2]]]
Message ID: 1135158746369245314 !example 566370477967147018 1135158746369245314 Author of message: Kemi

$authorURL

Adds a hyperlink to the author text.

Syntax

$authorURL[URL;(Index)]

$authorURL[] will not work if there is no text provided in $author[].

Parameters

  • URL (Type: URL || Flag: Emptiable): The link to set as the author hyperlink.
  • Index (Type: Integer || Flag: Optional): To which embed the author URL will be added. (learn more)

Example

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

$awaitFunc

Used to initiate an awaited command.

Syntax

$awaitFunc[Name;(User ID;Channel ID)]

Parameters

  • Name (Type: String || Flag: Required): The name used inside the $awaitedCommand[] and $awaitedCommandError[] callbacks.
  • User ID (Type: Snowflake || Flag: Vacantable): The user the awaited command will trigger for. Uses command author, if User ID is not present.
  • Channel ID (Type: Snowflake || Flag: Optional): The channel where the command will be awaited. Uses current channel, if Channel ID is not present.

Example

$nomention
What do you want me to say?
$awaitFunc[say]
!say What do you want me to say? I love BDFD! I love BDFD!

For more info, see the Awaited Commands Guide.

$ban

Bans the mentioned user.

Syntax

$ban

Example

$nomention
$ban
<@$mentioned[1]> was banned!
!example Spen Spen was banned! Spen left without pizza.

$ban[]

Bans the mentioned user with a reason.

Syntax

$ban[Reason]

Parameters

  • Reason (Type: String || Flag: Emptiable): The reason for the ban, which will be saved in the audit-log.

Example

$nomention
$ban[$noMentionMessage]
<@$mentioned[1]> was banned!
!example Spen Too cute Spen was banned! Spen left without pizza.

$banID

Bans a user using their ID without reason. The user ID will be taken from the last part of the author’s message.

Syntax

$banID

Example

$nomention
$onlyPerms[ban;You need the `ban` permission to use that command!]
<@$findUser[$message;no]> was banned!
$banID
!example 854665455527526421 Chilli was banned! Chilli left without pizza.

How $findUser[] works?

$banID[]

Bans a user using their ID.

Syntax

$banID[Reason;(User ID)]

Parameters

  • Reason (Type: String || Flag: Emptiable): The reason for the ban, which will be saved in the audit-log.

    Use $getBanReason[] to get the ban reason.

  • User ID (Type: Snowflake || Flag: Vacantable): The user to ban. If empty, the ID will be taken from the last part of the author’s message.

Example

$nomention
$onlyAdmin[You need the `admim` permission to use that command!]
$argsCheck[>1;Please provide a `user`. Syntax: `!ban (user) <reason>`]
$onlyIf[$findUser[$message[1];no]!=;Failed to find user!]
<@$findUser[$message;no]> was banned!
$banID[$replaceText[$message;$message[1];;1];$findUser[$message[1];no]]
!example 854665455527526421 Hello! Chilli was banned! Chilli left without pizza.

How $findUser[] works?

$blackListIDs

Blocks certain users from using the command.

Syntax

$blackListIDs[User IDs;...;Error message]

Parameters

  • User IDs (Type: Snowflake || Flag: Emptiable): The user(s) to blacklist from using the command. Use semicolons ; as a separator to separate multiple user IDs.

    How to get user ID?

  • Error message (Type: String || Flag: Emptiable): The message that will be sent when the user running the command is blacklisted.

Example

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

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

Syntax

$blackListRoles[Role names;...;Error message]

Parameters

  • Role names (Type: String || Flag: Emptiable): The name(s) of the role(s) to blacklist. Use semicolons ; as a separator to separate multiple role names.
  • Error message (Type: String || Flag: Emptiable): The message that will be sent if the user has a role from the blacklist.

Example

$nomention
$blackListRoles[Owner;Bot;❌ You can't use this command!]
Pong! $ping ms
!example ❌ You can't use this command! Because I have a role with name "Owner". !example Pong! 2 ms

$blackListRolesIDs

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

Syntax

$blackListRolesIDs[Role IDs;...;Error message]

Parameters

  • Role IDs (Type: Snowflake || Flag: Emptiable): The role(s) that will be blacklisted. Use semicolons ; as a separator to separate multiple role IDs.
  • Error message (Type: String || Flag: Emptiable): The message that will be sent if the user has a role from the blacklist.

Example

$nomention
$blackListRolesIDs[1009019299987476540;1014547313957539901;❌ You can't use this command!]
Pong! $ping ms
!example ❌ You can't use this command! !example Pong! 4 ms

$blackListServers

Blocks certain servers from using the command.

Syntax

$blackListServers[Guild IDs;...;Error message]

Parameters

  • Guild IDs (Type: Snowflake || Flag: Emptiable): The server(s) to blacklist from using a command. Use semicolons ; as a separator to separate multiple server IDs.

    Where do I find server IDs? (click-me)

  • Error message (Type: String || Flag: Emptiable): The message that will be sent if the command is run in a blacklisted server.

Example

$nomention
$blackListServers[1009018669982031912;❌ You can't use this command!]
Pong! $ping ms
*Guild ID: $guildID*
!example ❌ You can't use this command! !example Pong! 1 ms
Guild ID: 1009018669982031912

$blackListUsers

Blocks certain users from using the command. Uses usernames instead of user IDs.

Syntax

$blackListUsers[Usernames;...;Error message]

Parameters

  • Usernames (Type: String || Flag: Emptiable): The username(s) to blacklist. Use semicolons ; as a separator to separate multiple usernames.
  • Error message (Type: String || Flag: Emptiable): The message that will be sent when the username of the user running the command is blacklisted.

Example

$nomention
$blackListUsers[RainbowKey;❌ You can't use this command!]
Pong! $ping ms
!example ❌ You can't use this command! Because my username is "RainbowKey". !example Pong! 3 ms

$boostCount

Returns the current guild’s number of nitro boosts.

Syntax

$boostCount

Example

$nomention
This server currently has $boostCount boost(s).
RainbowKey just boosted the server! !example This server currently has 12 boost(s).

$boostCount[]

Returns a guild’s number of nitro boosts.

Syntax

$boostCount[Guild ID]

Parameters

  • Guild ID (Type: Snowflake || Flag: Required): The guild to get the number of boosts for.

Example

$nomention
This server currently has $boostCount[$message[1]] boost(s).
RainbowKey just boosted the server! !example 566363823137882154 This server currently has 38 boost(s).

$botCommands

Returns a list of the bot’s commands.

Syntax

$botCommands[Separator]

Parameters

  • Separator (Type: String || Flag: Required): Will be used to separate each command.

Example

$nomention
$botCommands[🔹]
!example !help🔹!server🔹!bdfd

$botID

Returns the bot’s ID.

Syntax

$botID

Example

$nomention
My ID is: $botID
!example My ID: 1009018156494368798

$botLeave

Forces the bot to leave the current server.

Syntax

$botLeave

Example

$nomention
$sendMessage[I left this server!]
$botLeave

example

If you are using BDScript 2, put $botLeave at the very bottom of the code so that the code works correctly i.e:

❌ Not correct:

$botLeave
$nomention
$sendMessage[I left this server!]

✅ Correct:

$nomention
$sendMessage[I left this server!]
$botLeave

$botLeave[]

Forces the bot to leave the server matching the provided server ID.

Syntax

$botLeave[Guild ID]

Parameters

  • Guild ID (Type: Snowflake || Flag: Required): The ID of the guild to leave.

Example

$nomention
$sendMessage[I left out `$serverName[$message]` server.]
$botLeave[$message]
!example 1009018156494368798 I left out BDFD Support server.

example

If you are using BDScript 2, put $botLeave[] at the very bottom of the code so that the code works correctly i.e:

❌ Not correct:

$botLeave[$message]
$nomention
$sendMessage[I left this server!]

✅ Correct:

$nomention
$sendMessage[I left this server!]
$botLeave[$message]

$botListDescription

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

Syntax

$botListDescription[Text]

Parameters

  • Text (Type: String || Flag: Required): The text that the description will be set to.

Example

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

example

$botListHide

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

Syntax

$botListHide

This function does not hide the command for $botCommands[].

Example

  1. Create two commands and set the trigger !ping for one command and !secret for the other.

  2. Add the $botListHide function to the command code with the !secret trigger.

    Code with trigger !secret:

    $nomention
    This is a secret command! 🤫
    $botListHide
    

    Code with trigger !ping:

    $nomention
    Pong!
    $botListDescription[Ping? Pong!]
    
  3. Execute commands

    example

With $botListHide

example

Without $botListHide

example

$botNode

Returns the bot’s node ID.

Syntax

$botNode

See list of Nodes and Status, Click here.

Example

$nomention
The bot's node ID: $botNode
!example The bot's node ID: 21

$botOwnerID

Returns the bot owner’s ID.

Syntax

$botOwnerID

Example

$nomention
My owner's ID: $botOwnerID
!botOwnerID My owner's ID: 729343563401265193

$botTyping

This function tells Discord that the bot is typing.

Syntax

$botTyping

Example

$nomention
$botTyping
Hello $username!
  • Command started:

example

  • Command completed:
!example Hello RainbowKey!

$c

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

Syntax

$c[Comment]

Parameters

  • Comment (Type: String || Flag: Emptiable): Any text. This text will not be taken into account during processing. Commonly used to add notes to the code.

Example

$nomention
$noMentionMessage
$c[This is a say command. You are reading a comment!]
!say As you can see, the comment doesn't appear! Pretty cool; right? As you can see, the comment doesn't appear! Pretty cool; right?

$calculate

Calculates a math expression.

Syntax

$calculate[Expression]

Parameters

  • Expression (Type: String || Flag: Required): The math expression to solve.

Signs

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

Example

$nomention
$enableDecimals[yes]
$calculate[$message] 🧠
!example 10+5.9-9 6.9 🧠

How does $enableDecimals[] work?

$categoryChannels

Lists all channels of the given category.

Syntax

$categoryChannels[Category ID;Separator;(Option)]

Parameters

  • Category ID (Type: Snowflake || Flag: Required): The category from which to list the channels.
  • Seperator (Type: String || Flag: Emptiable): The separator to use when separating channel properties.
  • Option (Type: Enum || Flag: Optional): Which property to get from category channels. Default is name. See below for more information.

Options

  • name - The names of the channels.
  • id - The IDs of the channels.
  • mention - The mentions of the channels.
  • count - The amount of channels in the category.

The count option does not list anything, instead it will return the number of channels under the given category.

Example

$nomention
<#$categoryChannels[$categoryID[BDFD];>
<#;id]>
!example rules
news
update-logs
bots
bdfd-forums

How $categoryID[] works?

$categoryCount

Returns the category count of the current guild.

Syntax

$categoryCount

Example

$nomention
There are $categoryCount categories in this server!
!categories There are 3 categories in this server!

$categoryCount[]

Returns the category count of the provided guild.

Syntax

$categoryCount[Guild ID]

Parameters

  • Guild ID (Type: Snowflake || Flag: Required): The guild to get its category count.

Example

$nomention
There are $categoryCount[$message[1]] categories in the server!
!categories 790676954247725106 There are 5 categories in the server!

$categoryID

Returns the category ID of the given category name.

Syntax

$categoryID[Category name]

Parameters

  • Category name (Type: String || Flag: Required): The name of the category from which to return the ID.

Example

$nomention
Category ID: $categoryID[$message]
!categoryID Information Category ID: 790620501927526462

To get the category ID from a channel ID use $parentID.

$changeCooldownTime

Changes the cooldown metrics. These can be used in cooldown error messages. It can be useful for translations.

Syntax

$changeCooldownTime[Days;Hours;Minutes;Seconds]

Parameters

  • Days (Type: String || Flag: Required): The text to replace ‘Days’ with.
  • Hours (Type: String || Flag: Required): The text to replace ‘Hours’ with.
  • Minutes (Type: String || Flag: Required): The text to replace ‘Minutes’ with.
  • Seconds (Type: String || Flag: Required): The text to replace ‘Seconds’ with.

Sub-functions

NameType
%time-d%Day
%time-h%Hour
%time-m%Minute
%time-s%Second

Example

$nomention
Hello $displayName!
$changeCooldownTime[Days⏰;Hours⏰;Mins🕧;Secs🕧]
$cooldown[10m;Please wait %time-m%!]
!hello Hello Nicky! !hello Please wait 9.9 Mins🕧!

$changeUsername

Changes the mentioned user’s nickname.

Syntax

$changeUsername[New nickname]

Parameters

  • New nickname (Type: String || Flag: Required): The text to change the user’s nickname to. It cannot exceed more than 32 characters. Using %username% will be replaced by the real user’s username.

Example

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

$changeUsernameWithID

Changes a user’s nickname using their ID.

Syntax

$changeUsernameWithID[User ID;New nickname]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The ID of the user whose nickname will be changed.
  • New nickname (Type: String || Flag: Required): The text to change the user’s nickname to. It cannot exceed more than 32 characters, using %username% will be replaced by real user’s username.

Example

$nomention
$argsCheck[>1;Please provide text!]
$addCmdReactions[❤️]
$changeUsernameWithID[$message[1];$message[2]]
!example 154148273307910144 Owner

How $addCmdReactions[] works?

$channelCount

Returns the amount of channels in the current server.

Syntax

$channelCount

Example

$nomention
There are $channelCount channels in this server!
!example There are 19 channels in this server!

$channelExists

Checks if the provided channel exists in any server the bot is in.

Syntax

$channelExists[Channel ID]

Parameters

  • Channel ID (Type: String, Snowflake || Flag: Emptiable): The channel which the bot will check for.

Example

$nomention
$channelExists[$message]
!example 566370477967147018 true

$channelID

Returns the ID of the current channel.

Syntax

$channelID

Example

$nomention
Channel ID: $channelID
!example Channel ID: 566370477967147018

It will return none if you use it in a DM.

!example Channel ID: none

$channelID[]

Returns the channel ID for the given channel name.

Syntax

$channelID[Channel name]

Parameters

  • Channel name (Type: String || Flag: Required): The name of the channel.

Example

$nomention
Channel ID: $channelID[$message]
!example main-chat Channel ID: 566370477967147018

It supports category names.

!example BDFD Channel ID: 1009019011545178132

$channelDFromName

(deprecated)

🧙‍♂️ This function is deprecated, instead better use $channelID[].

Returns a channel’s ID from its name.

Syntax

$channelIDFromName[Channel name]

Parameters

  • Channel name (Type: String || Flag: Required): The channel name that the bot will return the channel ID for.

Example

$nomention
Channel ID: $channelIDFromName[$mesaage]
!example main-chat Channel ID: 1014546423032860754

$channelName

Returns the name for the provided channel ID.

Syntax

$channelName[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel which name will be returned.

🧙‍♂️ How do I find channel IDs? (click-me)

Example

$nomention
Channel Name: `#$channelName[$channelID]`
!example Channel Name: #main-chat

$channelNames

List all channel names separated by a given separator.

Syntax

$channelNames[Separator;(Guild ID)]

Parameters

  • Seperator (Type: String || Flag: Emptiable): The separator used to separate the channel names.
  • Guild ID (Type: Snowflake || Flag: Optional): The guild for which to return the channel names. (Defaults to the current guild)

Example

$nomention
#$channelNames[ 
#]
!example main-chat #main-chat
#media
#suggestions
#Category

It can return names of the category, channel, forum.

$channelPosition

Returns the position of the current channel.

Syntax

$channelPosition

Example

$nomention
Channel Position: $channelPosition
!example Channel Position: 1

$channelPosition[]

Returns the position of a given channel using its ID.

Syntax

$channelPosition[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of a channel whose position will be returned.

How to get a channel ID guide.

Example

$nomention
Channel Position: $channelPosition[$mentionedChannels[1;yes]]
!example main-chat Channel Position: 2

How $mentionedChannels[] works?

$channelSendMessage

Sends a message in the provided channel.

Syntax

$channelSendMessage[Channel ID;Message]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel to send the message in.
  • Message (Type: String || Flag: Required): The message that gets sent to the channel.

Example

$nomention
The message was sent to  the channel: <#835108724846493726>
$channelSendMessage[835108724846493726;Hello!]
!example The message was sent to the channel: fun

in #fun channel:

Hello!

$channelTopic

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

Syntax

$channelTopic

Example

$nomention
<#$channelID>'s channel topic is: $channelTopic
!example testing's channel topic is: A testing channel!

$channelTopic[]

Returns the topic of a channel by its ID.

Syntax

$channelTopic[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel to return its topic.

Example

$nomention
<#$noMentionMessage>'s channel topic is: $channelTopic[$noMentionMessage]
!example 860870690323300359 demo's channel topic is: Demos, examples and more!

$channelType

Returns the type of a channel.

Syntax

$channelType[Channel ID]

The different channel types that the bot will return are: text, voice, category, thread, dm, stage, announcement and forum.

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel which type will be returned.

Example

$nomention
$channelType[$channelID]

Text Channel

!channelType text

DM Channel

!channelType dm

$charCount

Returns the amount of characters in the provided “Text”.

Syntax

$charCount[Text]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to return the character count for.

Example

$nomention
Your message has $charCount[$message] characters.
!example Hello World! Your message has 12 characters.

$checkCondition

Checks if a condition is true or false.

Syntax

$checkCondition[Condition]

Parameters

  • Condition (Type: String || Flag: Required): The condition to check.

Signs

== - Equal

!= - Not Equal

< - Less Than

> - Greater Than

>= - Greater Than Or Equal To

<= - Less Than Or Equal To

Example

$nomention
$checkCondition[$message==hello]
!example BDFD false !example hello true Because hello==hello.

$checkContains

Checks if the ‘text’ contains at least one of the provided ‘phrases’.

Syntax

$checkContains[Text;Phrases;...]

Parameters

  • Text (Type: String || Flag: Emptiable): The text that will be checked.
  • Phrases (Type: String || Flag: Emptiable): The phrases/words the bot will check for in Text. Separate phrases using ;.

Example

$nomention
$checkContains[$message;hi;hello]
!example bye false !example hello true !example hi bye true

$checkUserPerms

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

Syntax

$checkUserPerms[User ID;Permissions]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user that the bot checks the permissions for.
  • Permissions (Type: Permission || Flag: Required): The permissions that the bot checks for. Separate permissions using ;.

Example

$nomention
$onlyIf[$checkUserPerms[$authorID;admin]==false;You can't use this command, because you are an administrator.] 
You aren't an admin!
!example You can't use this command, because you are an administrator.

$clear

Deletes a certain amount of messages.

When using just $clear, the author’s message must include a number.

Syntax

$clear

Discord doesn’t allow deleting messages in bulk which are over 2 weeks old.

Permissions

Required permissions that the bot must have for this function to work properly:

  • managemessages

Example

$nomention
$deletecommand
$clear

Before

5 4 3 2 1 !example 3

After

5 4 3

$clear[]

Deletes the provided amount of messages.

Syntax

$clear[Amount;(User ID;Remove pinned messages?)]

Parameters

  • Amount (Type: Integer || Flag: Required): The amount of messages to delete. (maximal 100)
  • User ID (Type: Snowflake || Flag: Vacantable): If a user ID is provided, the bot will only delete messages from that user.
  • Remove pinned messages? (Type: Bool || Flag: Optional): Decides whether to delete pinned messages or not. The default is yes.

📌 Discord doesn’t allow deleting messages in bulk which are over 2 weeks old.

Permissions

Required permissions that the bot must have for this function to work properly:

  • managemessages

Example

$nomention
$clear[$message]

Before

5 4 3 2 1 !example 3

After

5 4 3

$clearReactions

Removes reactions from the provided message.

Syntax

$clearReactions[Channel ID;Message ID;Emoji]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel that the message belongs to.
  • Message ID (Type: Snowflake || Flag: Required): The message to remove the reaction from.
  • Emoji (Type: Emoji || Flag: Required): The emoji to remove from the message. Use !all to clear all reactions.

Example

$nomention
$clearReactions[$channelID;$message;✅]

Before

Message ID: 1216863258708021248

After

Message ID: 1216863258708021248 !example 1216863258708021248

$closeTicket

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

Syntax

$closeTicket[Error message]

Parameters

  • Error message (Type: String || Flag: Emptiable): 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.

Syntax

$color[Color hex;(Index)]

Parameters

  • Color hex (Type: Color || Flag: Emptiable): The color hex to set the embed border color as. You can also use color integer number.
  • Index (Type: Integer || Flag: Optional): What embed the color border should belong to (Optional). The default is 1. (learn more)

Example

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

$colorRole

Changes the color of the mentioned role.

Syntax

$colorRole[Color hex]

Parameters

  • Color hex (Type: Color || Flag: Required): The color hex to change the mentioned role color to.

Example

$nomention
$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 the role color of <@&$mentionedRoles[1]> to `$noMentionMessage`!
!example cool role #E11F0E ✅ Changed the role color of cool role to #E11F0E!

example

$commandsCount

Returns how many commands the bot has total.

Syntax

$commandsCount

Example

$nomention
I have $commandsCount commands!
!example I have 174 commands!

$cooldown

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

Syntax

$cooldown[Duration;Error message]

Parameters

  • Duration (Type: Duration || Flag: Required): The duration of this cooldown.
  • Error message (Type: String || Flag: Emptiable): The message that is returned when the cooldown duration is still ongoing. %time% and other related functions can be used here.
TimeIn UsageLimit
Yeary191568
Weekw9988936
Dayd69922554
Hourh1678141301
Minutem100688478068
Seconds6041308684139

%time% returns how much time is left on the cooldown.

Example

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

If you are using BDScript 2, then all functions above $cooldown[] will always work.

❌ Not correct:

$nomention
$setUserVar[Money;$sum[$getUserVar[Money];5]]
$sendMessage[You worked successfully and earned 5 🪙]
$cooldown[30s;Please wait %time%, then use !work command again!]

Your bot will always add 5🪙 to “Money” variable.

✅ Correct:

$nomention
$cooldown[30s;Please wait %time%, then use !work command again!]
$setUserVar[Money;$sum[$getUserVar[Money];5]]
$sendMessage[You worked successfully and earned 5 🪙]

How $setUserVar[] and $sendMessage[] works?

Recommendation

You can also use these functions:

$createChannel

Creates a new channel.

Syntax

$createChannel[Name;Type;(Category ID)]

Discord allows users to create up to 500 channels per server. This includes all channel types.

Parameters

  • Name (Type: String || Flag: Required): The name of the new channel.

    Channel names can have a maximum of 100 characters.

  • Type (Type: Enum || Flag: Required): The channel type. Channel types:

    • category
    • text
    • voice
    • stage
    • forum
  • Category ID (Type: Snowflake || Flag: Optional): The category to put the channel in (if applicable).

How to get the Category ID guide.

Example

$nomention
$createChannel[cool-channel;text]
New channel created!
!example New channel created!

example

You can use $channelID[] to return the channel ID.

$createRole

Creates a new role.

Syntax

$createRole[Role name;Color hex;Hoist?;Mentionable?]

Discord allows users to create up to 250 roles per server.

Parameters

  • Role name (Type: String || Flag: Required): The name to give the new role.

Role names can have a maximum of 100 characters.

  • Color hex (Type: Color || Flag: Required): The color hex of the new role.
  • Hoist? (Type: Bool || Flag: Vacantable): Whether the role should be displayed separately (hoisted) or not. no means the role won’t be hoisted, yes means it will.
    example
  • Mentionable? (Type: Bool || Flag: Vacantable): Whether the role should be mentionable by everyone. no means the role won’t be mentionable, yes means it will.
    example

Example

$nomention
$createRole[Cool Role;#FFFF00;yes;no]
New role created!
!example New role created!

example

You can use $roleID[] to return the role ID.

$creationDate

Returns the creation date of any valid Discord Snowflake ID.

Syntax

$creationDate[ID;(Format)]

Uses GoLang date format

Parameters

  • ID (Type: Snowflake || Flag: Required): The ID from which to get the creation date. The ID can be a User ID, a Role ID, a Message ID, a Emoji ID, or a Guild ID.

How to get the ID guide.

  • Format (Type: String || Flag: Optional): Customize the default time format output.

Click me to check all supported time format values.

Example

  • Default format
    $nomention
    $creationDate[$authorID]
    
!example 2021-01-26
  • Custom format
    $nomention
    $creationDate[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)]
    
!example January 26, 2021 at 10:18 AM (UTC +00:00)

$cropText

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

Syntax

$cropText[Text;Max characters;Ending]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to crop.
  • Max characters (Type: Integer || Flag: Required): The maximum amount of characters. Subsequent characters are removed.
  • Ending (Type: String || Flag: Emptiable): The text to end the cropped text with (if the text was cropped).

Example

$nomention
$cropText[$message;50;...]
!example Hello everyone! This message is very cool. 😎 We hope you enjoy coding in BDFD, bye! Hello everyone! This message is very cool. 😎 We ho...

$customEmoji

Returns a custom emoji.

🧙‍♂️ Note: We recommend emoji IDs instead of $customEmoji for public bots.

Syntax

$customEmoji[emoji name]

Parameters

  • emoji name (Type: String || Flag: Required): The name of the emoji to return.

Example

$nomention
Hello there! $customEmoji[Wave]

Example

$customID

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

Syntax

$customID

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.

Syntax

$date

Example

$nomention
Today's Date: $date
!example Today's Date: 2024-06-22

$day

Returns the current day of the month.

You can use $time to change the timezone.

Syntax

$day

Example

$nomention
Today Is: $day
!example Today Is: 22

$defer

Defers response to an interaction from components and slash commands.

Syntax

$defer

Example

Sometimes the code we write needs more time to execute fully. In normal commands, this isn’t a problem, but interactions are different. Interactions have a 3-second long timeout in which our code needs to respond in. The $defer function solves this by telling Discord to wait a bit longer for our response. With $defer we have 15 minutes to finish executing our code.

This is an example of a code that will take more than 3 seconds to execute.

$nomention

$title[$getEmbedData[$channelID;$message[message-id];1;title];1]
$description[$getEmbedData[$channelID;$message[message-id];1;description];1]
$footer[$getEmbedData[$channelID;$message[message-id];1;footer];1]
$color[$getEmbedData[$channelID;$message[message-id];1;color];1]

$title[$getEmbedData[$channelID;$message[message-id];2;title];2]
$description[$getEmbedData[$channelID;$message[message-id];2;description];2]
$footer[$getEmbedData[$channelID;$message[message-id];2;footer];2]
$color[$getEmbedData[$channelID;$message[message-id];2;color];2]

Let’s execute it.

Without $defer

Without

With $defer

$nomention
$defer

$title[$getEmbedData[$channelID;$message[message-id];1;title];1]
$description[$getEmbedData[$channelID;$message[message-id];1;description];1]
$footer[$getEmbedData[$channelID;$message[message-id];1;footer];1]
$color[$getEmbedData[$channelID;$message[message-id];1;color];1]

$title[$getEmbedData[$channelID;$message[message-id];2;title];2]
$description[$getEmbedData[$channelID;$message[message-id];2;description];2]
$footer[$getEmbedData[$channelID;$message[message-id];2;footer];2]
$color[$getEmbedData[$channelID;$message[message-id];2;color];2]

With

$deleteChannels

Deletes the provided channel(s).

Syntax

$deleteChannels[Channel IDs;...]

Parameters

  • Channel IDs (Type: Snowflake || Flag: Required): The channels to delete. Use semicolons ; as a separator to separate multiple channel IDs.

Permissions

Required permissions that the bot must have for this function to work properly:

  • managechannels

Example

$nomention
Successfully deleted #$channelName[$mentionedChannels[1]]
$deleteChannels[$mentionedChannels[1]]
!example main-chat Successfully deleted #main-chat

example

How $channelName[] and $mentionedChannels[] works?

$deleteChannelsByName

Deletes all channels matching the names provided.

Syntax

$deleteChannelsByName[Channel name;...]

Parameters

  • Channel name (Type: String || Flag: Required): The name(s) of the channel(s) to delete. Use semicolons ; as a separator to separate multiple channel names.

Permissions

Required permissions that the bot must have for this function to work properly:

  • managechannels

Example

$nomention
Successfully deleted #$channelName[$channelID[$message]]!
$deleteChannelsByName[$message]
!example main-chat Successfully deleted #main-chat

example

How $channelName[] and $channelID[] works?

$deletecommand

Deletes the author’s command message.

The bot must have the manage_messages permission.

Syntax

$deletecommand

Sometimes a message may be deleted, but you will still see it. This is a discord bug.

Example

$nomention
$deletecommand
Hello world!
Hello world!

$deleteIn

Deletes the bot’s response after the provided duration.

Syntax

$deleteIn[Duration]

Parameters

  • Duration (Type: Duration || Flag: Required): The time to wait before deleting the message (e.g 3s, 30s, 1m, etc). Max duration is 40m (120m for premium bots).

Example

$nomention
Hello World!
$deleteIn[3s]

The message deletes itself after 3 seconds.

example

$deleteMessage

Deletes a message.

Syntax

$deleteMessage[Channel ID;Message ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel ID where the message is located.
  • Message ID (Type: Snowflake || Flag: Required): The ID of the message which will be deleted.

How to get the Channel ID and Message ID guide.

Permissions

Required permissions that the bot must have for this function to work properly:

  • managemessages

Example

$nomention
$deleteMessage[$channelID;$messageID]
Hello $username!

$deleteRole

Deletes a role.

Syntax

$deleteRole[Role ID]

Parameters

  • Role ID (Type: Snowflake || Flag: Required): The role to delete.

Permissions

Required permissions that the bot must have for this function to work properly:

  • manageroles

Example

$nomention
$deleteRole[$findRole[$message]]
Successfully deleted $roleName[$findRole[$message]]
!example Cool Role Successfully deleted Cool Role

example

How $findRole[], $roleName[] and $message works?

$description

Adds a description to an embed.

Syntax

$description[message;(index)]

Parameters

  • message (Type: String || Flag: Emptiable): The text to set the description as. It cannot exceed more than 4096 characters.
  • index (Type: Integer || Flag: Optional): What embed the description should belong to. The default is 1. (learn more)

Example

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

example

$disableInnerSpaceRemoval

Disables the removal of multiple spaces from within the message.

Syntax

$disableInnerSpaceRemoval

Example

$nomention
$disableInnerSpaceRemoval

Hello               $displayName!

Output Without

Output With

$disableSpecialEscaping

(for advanced users)

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

Syntax

$disableSpecialEscaping

Example

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

$discriminator

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

Syntax

$discriminator[User ID]

Discord has updated the username system, removing discriminators for users. Discriminators will only work for bots. For user it will return 0000.

Parameters

  • User ID (Type: Snowflake || Flag: Emptiable): The user to get the discriminator from.

Example

$nomention
Discriminator: $discriminator[$mentioned[1]]
!example BDFD Support Discriminator: #7678

You can use $discriminator[] get the discriminator of the author.
How $mentioned[] works?)

$displayName

Returns the author’s display name.

Syntax

$displayName

Example

$nomention
Your display name is $displayName
!example Your display name is Nicky

$displayName[]

Returns the display name of the given user.

Syntax

$displayName[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to get the display name for.

Example

$nomention
Display name: $displayName[$mentioned[1]]
!example MineBartekSA Display name: MineBartekSA

$divide

Divides the provided numbers.

Syntax

$divide[Numbers]

Parameters

  • Numbers (Type: Integer, Float || Flag: Required): The numbers to divide. Separate numbers using ;.

Example

$nomention
Answer: $divide[10;$message]
!example 5 Answer: 2

$dm

Direct messages the user who runs the command.

Syntax

$dm

Example

$nomention
$dm
Hello!

example
example

Note

If the command fails to send the message, make sure you allow direct messages from everyone.

$dm[]

Direct messages one or multiple users.

Syntax

$dm[User ID;...]

Parameters

  • User ID (Type: Snowflake || Flag: Emptiable): The user to whom to send the direct message. Use semicolons ; as a separator to separate multiple user IDs.

🧙‍♂️ You can leave the User ID argument empty to direct message the mentioned user. See Example #1 below.

Examples

Example #1

This will direct message the mentioned user.

$nomention
$dm[]
$displayName says hello 👋

example1
example1

Example #2

This will direct message all the specified users.

$nomention
$dm[871078018041409608;729343563401265193]
$displayName says hello 👋

Note

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

$dmChannelID

Retrieves the DM channel ID for the provided user id.

Syntax

$dmChannelID[User ID]

Parameters

  • user ID (Type: Snowflake || Flag: Required): The user for whom to fetch the DM channel ID

Example

$nomention
ID: $dmChannelID[$authorID]
!example ID: 1011919618610311189

$editButton

Edits an already existing button.

Syntax

$editButton[Button ID/URL;Label;Style;(Disabled;Emoji;Message ID)]

Parameters

  • Button ID/URL (Type: String, URL || Flag: Required): The required button ID or URL, you want to be edited.
  • Label (Type: String || Flag: Emptiable): The new label displayed on the button.
  • Style (Type: Enum || Flag: Required): The style of the button. All styles are listed below.
  • Disabled (Type: Bool || Flag: Vacantable): If set to yes, the button can’t be pressed. Default is no.
  • Emoji (Type: Emoji || Flag: Vacantable): Edits / Adds an emoji inside the button. Emojis have to be either pasted as Unicode or be in the following format <:emoji name:emoji ID>.
  • Message ID (Type: Snowflake || Flag: Vacantable): Adds a button to the provided message ID. It’s important to note that provided message ID author has to be the bot.

Button Style

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

  • primary - Blue button
  • secondary - Gray button
  • success - Green button
  • danger - Red button
  • link - Redirect button
Buttons: Primary Primary Success Success Danger Danger Secondary Secondary Other Buttons: Link Link Emoji

Example

Interaction command code

$nomention
$username said hello!
$editButton[test;Say hello!;primary;yes;]
$addButton[no;http://botdesignerdiscord.com;Check our website;link;no;👀]

For more info, see the Buttons Guide.

$editChannelPerms

Changes permissions for the mentioned user/role in the provided channel.

Syntax

$editChannelPerms[Channel ID;User/Role ID;Permission;...]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of the channel where the role/user is being modified.
  • User/Role ID (Type: Snowflake || Flag: Emptiable): The ID of the role/user whose permissions will be modified.
  • Permission (Type: Permission || Flag: Required): The permission(s) to be modified. (e.g. -sendmessages)
    • + - set “+” to add the permission.
    • - - set “-” to remove the permission.

Example

$nomention
$onlyPerms[managechannels;❌ You need the `MANAGE_CHANNELS` permission to use that!]

$editChannelPerms[$channelID;$mentionedRoles[1];-sendmessages]
✅ Now the role cannot send messages

image

$editEmbedIn

Edits the bot’s message after the given time, as an embed.

Syntax

$editEmbedIn[Time;(Title;Description;Footer;Color)]

📝 Optional fields can be left empty. At least one embed field (Title, Description, or Footer) needs to be inputted.

Parameters

  • Time (Type: Duration || Flag: Required): The time to wait before editing the message (e.g 3s, 30s, 10m). Max time is 40 minutes (for premium users, it’s 120 minutes). Required.
  • Title (Type: String || Flag: Vacantable): The new embed title. Optional.
  • Description (Type: String || Flag: Vacantable): The new embed description. Optional.
  • Footer (Type: String || Flag: Vacantable): The new embed footer. Optional.
  • Color (Type: Color || Flag: Vacantable): The embed border color, must be a valid color hex or color integer number. Use 0 for the default color. Optional.

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.

Syntax

$editIn[Time;New message]

Parameters

  • Time (Type: Duration || Flag: Required): The time to wait before editing the message (e.g 3s, 30s, 10m). Max is 40m (for premium users 120m).
  • New message (Type: String || Flag: Required): 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.

Syntax

$editMessage[Channel ID;Message ID;Content;(Title;Description;Color;Footer)]

🧙‍♂️ How Do I Get The Channel / Message ID? (click-me)

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel that this message belongs to.
  • Message ID (Type: Snowflake || Flag: Required): The ID of the message to edit (must be a message that the bot sent).
  • Content (Type: String || Flag: Emptiable): The new message contents.
  • Title (Type: String || Flag: Vacantable): The new embed title.
  • Description (Type: String || Flag: Vacantable): The new embed description.
  • Color (Type: Color || Flag: Vacantable): The new embed color border hex.
  • Footer (Type: String || Flag: Vacantable): The new embed footer text.

Example

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

Output

Before

example1

After

example2

$editSelectMenu

Edits a select menu.

You can edit the select menu option with $editSelectMenuOption[].

Syntax

$editSelectMenu[Menu ID;Min;Max;(Placeholder;Message ID)]

Parameters

  • Menu ID (Type: String || Flag: Required): The ID of the select menu you want to edit.
  • Min (Type: Integer || Flag: Required): The minimum amount of values that can be selected.
  • Max (Type: Integer || Flag: Required): The maximum amount of values that can be selected.
  • Placeholder (Type: String || Flag: Vacantable): The text that appears if no option is selected.
  • Message ID (Type: Snowflake || Flag: Optional): The message for which a select menu will be edited.

Example

Interaction Code

$editSelectMenu[Example;1;1;Choose some option 😀]
$addSelectMenuOption[Example;First;first-option;The first option]
$addSelectMenuOption[Example;Second;second-option;The second option]
$addSelectMenuOption[Example;Third;third-option;The third option]

Usage
Usage

For more info, see the Select Menu Guide.

$editSelectMenuOption

Edits a select menu option.

You can edit the main select menu with $editSelectMenu[].

Syntax

$editSelectMenuOption[Menu option ID;Label;Value;Description;(Default;Emoji;Message ID)]

Parameters

  • Menu option ID (Type: String || Flag: Required): The select menu ID. It has to be the same as the ID used in its $newSelectMenu[].
  • Label (Type: String || Flag: Required): The name of the option.
  • Value (Type: String || Flag: Required): The value of the option. It’s the data that gets passed to the $onInteraction[] callback. The value has to be unique in the select menu!
  • Description (Type: String || Flag: Vacantable): The description of the option. It shows up under the Label.
  • Default (Type: Bool || Flag: Vacantable): Decide if the option should be selected by default. There can be only one default option!
  • Emoji (Type: Emoji || Flag: Vacantable): The emoji of the option. It shows up next to the Label.
  • Message ID (Type: Snowflake || Flag: Optional): The message ID, menu attached to it.

Example

Interaction Code

$editSelectMenuOption[Example;First;first-option;The first option;no;1️⃣]
$editSelectMenuOption[Example;Second;second-option;The second option;no;2️⃣]
$editSelectMenuOption[Example;Third;third-option;The third option;no;3️⃣]

example1

Output

Before

example2

After

example3

For more info, see the Select Menu Guide.

$editSplitText

Edits a splitted text element using its index.

Syntax

$editSplitText[Index;Value]

Parameters

  • Index (Type: Integer || Flag: Required): The index of the element to edit.
  • Value (Type: String || Flag: Required): The new value to assign to the provided index.

Example

$nomention

$textSplit[$message; ]

$var[Index;$splitText[$sub[$getTextSplitLength;1]]]
$var[Value;$splitText[$getTextSplitLength]]

$removeSplitTextElement[$getTextSplitLength]
$removeSplitTextElement[$getTextSplitLength]

$var[Text;$joinSplitText[ ]]

$textSplit[$var[Text];]
$editSplitText[$var[Index];$var[Value]]

Original Text: $var[Text]
New Text: $joinSplitText[]

example

For more info, see the Text Splitting Guide.

$editThread

Modifies an existing thread.

🧙‍♂️ You can use !unchanged as an argument for the option to remain in its current state.

Syntax

$editThread[Thread ID;(Name;Archived;Archive duration;Locked;Slowmode)]

Parameters

  • Thread ID (Type: Snowflake || Flag: Required): The thread channel to edit.
  • Name (Type: String || Flag: Optional): The new name of the thread.
  • Archived (Type: Bool || Flag: Optional): Whether to archive this thread or not.
  • Archive duration (Type: Integer || Flag: Optional): 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 (Type: Bool || Flag: Optional): Whether to lock this thread or not. Note that archived threads can’t be locked.
  • Slowmode (Type: Integer || Flag: Optional): The slowmode of this channel, expressed in seconds.

Example

$nomention
$editThread[1098166444111433819;Cool Thread 😎;no;!unchanged;!unchanged;5]

$else

A block of code to be executed, if the $if[] condition is false.

Syntax

$else

Example

$nomention
$if[$authorID==$botOwnerID]
  $sendMessage[You are the developer of this bot!]
$else
  $sendMessage[You are not the developer of this bot!]
$endif
!example You are the developer of this bot! !example You are not the developer of this bot!

For more info, see the If Guide.

$elseif

Checks provided condition only if previous $if[] or $elseif[] conditions returned false. If the provided condition is true, the following block of code will be executed.

Only for BDScript 2!

Syntax

$elseif[Condition]

Parameters

  • Condition (Type: String || Flag: Required): Check that will be carried out.

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.

Example

$nomention
$if[$authorID==$botOwnerID]
  $sendMessage[Developer]
$elseif[$authorID==$serverOwner]
  $sendMessage[Server Owner]
$endif
!example Developer !example Server Owner

For more info, see the If Guide.

$embeddedURL

Sets the title to be a hyperlink.

📝 Only works if $title is also used.

Syntax

$embeddedURL[Link;(Index)]

Parameters

  • Link (Type: URL || Flag: Emptiable): The link to set the title hyperlink to.
  • Index (Type: Integer || Flag: Optional): What embed the title hyperlink should belong to. The 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 an error.

Syntax

$embedSuppressErrors[Title;Description;(Color;Author;Footer;Footer icon)]

All fields are optional, leave the field empty to not include it. At least one field needs to be inputted, however.

Parameters

  • Title (Type: String || Flag: Emptiable): The title of the embed.
  • Description (Type: String || Flag: Emptiable): The embed description.
  • Color (Type: Color || Flag: Vacantable): The embed border color, must be a valid color hex.
  • Author (Type: String || Flag: Vacantable): The embed author text.
  • Footer (Type: String || Flag: Vacantable): The embed footer text.
  • Footer icon (Type: URL || Flag: Vacantable): The embed footer icon, must be a valid image URL.

Examples

Example #1

$nomention
$embedSuppressErrors[Error!;❌ Invalid math expression!;#ff0000;;Calculator]

Result: **$calculate[$message]**

example

Example #2

You can pass error from limiter functions into the embed by leaving the Description argument to be empty.

$nomention
$embedSuppressErrors[Error!;;#ff0000]
$argsCheck[>1;You must type at least one word]

You typed "$message"

example_2

$emoteCount

Returns the number of emojis in the current server.

Syntax

$emoteCount

Example

$nomention
There are $emoteCount emojis in $serverName[$guildID]!
!example There are 26 emojis in Bot Designer for Discord Official Server!

$enabled

Allows you to enable/disable commands.

Syntax

$enabled[Enabled;Error message]

Parameters

  • Enabled (Type: Bool || Flag: Required): If the command should be enabled or disabled. Use yes to enable the command, no to disable it.
  • Error message (Type: String || Flag: Emptiable): 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 code. Put this in the reply text/code section:

    $onlyAdmin[❌ Only admins can enable commands!]
    $setServerVar[enabled;yes]
    I successfully enabled the command!
    
  3. Create a command for the disable code. Put this in the reply text/code section:

    $onlyAdmin[❌ Only admins can disable commands!]
    $setServerVar[enabled;no]
    I successfully disabled the command!
    
  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.

Syntax

$enableDecimals[Enable?]

Parameters

  • Enable? (Type: Bool || Flag: Required): Whether to enable decimals in math functions or not, yes means it’s enabled and no means it’s disabled.

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.

Example

$nomention
$enableDecimals[yes]
Result: $random[1;5]
!example Result: 3.381

How $random[] works?

$endif

Ends an if statement.

Syntax

$endif

Example

$nomention
$if[$message==BDFD]
  I love BDFD!
$endif

With $endif

!example BDFD I love BDFD!

Without $endif

!example BDFD $if not closed with $endif

For more info, see the If Guide.

$ephemeral

Makes the bot’s response ephemeral.

🧙‍♂️ What are ephemeral responses? (click-me)

Syntax

$ephemeral

⚠️ You can get an ephemeral response only through an interaction (slash commands, buttons, select menus, etc.)

Example

$nomention
$ephemeral
hello!

example1
example2

$eval

Evaluates the provided BDScript code. Can only be used in BDScript 2.

⚠️ Should be used with caution! ⚠️

Syntax

$eval[Source code]

Parameters

  • Source code (Type: String || Flag: Emptiable): The code to be evaluated.

Example

$nomention
$eval[$message]
!example $sendMessage[Hello! My username is $username]] Hello! My username is Nicky

How $message works?

⚠️ Should be used with caution! ⚠️

It is recommended to restrict the command to be only used by the bot developers, this can be done with:

$nomention
$onlyForIDs[$botOwnerID;❌ You are not my owner!]
$eval[$message]

How $onlyForIDs[] and $botOwnerID works?

$executionTime

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

Syntax

$executionTime

You cannot use this function in $sendMessage[], $channelSendMessage[], $sendEmbedMessage[], $sum[], $sub[], $divide[], $multi[], $calculate[], $random[], $textSplit[], $splitText[], etc…

Example

$nomention
Pong! $executionTime ms
!example Pong! 12 ms

$findChannel

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

This function can only find channels of the current server.

Syntax

$findChannel[Channel]

Parameters

  • Channel (Type: String || Flag: Emptiable): The channel name/ID/mention to find.

Example

$nomention
Channel ID: $findChannel[$mentionedChannels[1]]
!example main-chat Channel ID: 566370477967147018

How $mentionedChannels[] works?

$findRole

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

This function can only find roles of the current server.

Syntax

$findRole[Role]

Parameters

  • Role (Type: String || Flag: Emptiable): The role name, ID, or mention to find.

Example

$nomention
Role ID: $findRole[$message]
!example Support Role ID: 568155071997542410

How $message works?

$findUser

Finds a user’s ID using username, ID, or mention in the current server.

Syntax

$findUser[User;(Return author ID?)]

Parameters

  • User (Type: String || Flag: Emptiable): The user’s username, ID, or mention to find.
  • Return author ID? (Type: Bool || Flag: Optional): Whether to return the author ID if no user was found. The default is yes.

Example

$nomention
User ID: $findUser[$message]
!example BDFD Support User ID: 1009018156494368798

How $message works?

$footer

Sets the embed footer text.

Syntax

$footer[Text;(Index)]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to set the footer as. It cannot exceed more than 2048 characters.
  • Index (Type: Integer || Flag: Optional): What embed the footer text should belong to. The 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.

Syntax

$footerIcon[Icon URL;(Index)]

Parameters

  • Icon URL (Type: URL || Flag: Emptiable): The URL to set the footer icon as. Must be a valid image URL.
  • Index (Type: Integer || Flag: Vacantable): What embed the footer icon should belong to. The default is 1. (learn more)

Example

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

example

$getBanReason

Gets the user’s ban reason.

Syntax

$getBanReason[User ID;(Guild ID)]

Parameters

  • User ID (Type: Snowflake || Flag: Required): User to get the ban reason for
  • Guild ID (Type: Snowflake || Flag: Optional): The server id from which to get the ban reason.

Example

$nomention
Ban Reason: $getBanReason[154148273307910144]
!example Ban Reason: Too cute

$getBotInvite

Returns the bot’s invite URL.

Syntax

$getBotInvite

Invitation perms can be configured in the BDFD App:

  1. Select the bot,
  2. Click “➤ Invite bot to server” button,
  3. Select “🔓 Edit invite link permissions”,
  4. Pick permissions

Example

$nomention
Invite Me! $getBotInvite
!example Invite Me! https://discordapp.com/oauth2/authorize?client_id=390515191819010058&scope=bot&permissions=2146958847

The invitation link in this example is fake, so it doesn’t work.

$getChannelVar

Returns the value of the provided channel variable.

Syntax

$getChannelVar[Variable name;(Channel ID)]

Parameters

  • Variable name (Type: String || Flag: Required): The name of the variable to get.
  • Channel ID (Type: Snowflake || Flag: Optional): The channel to get the value for. If no “Channel ID” is present, then the current channel will be used.

Example

$nomention
Command used `$getChannelVar[Uses]` times in this channel
!example Command used 1 times in this channel

For more info, see the Variables Guide.

$getCooldown

Returns how long is left on the cooldown, in seconds.

This function can be used in the “Error message” field of cooldown functions.

Syntax

$getCooldown[Cooldown type (normal/server/global)]

Parameters

  • Cooldown type (Type: Enum || Flag: Required): The type of the cooldown. Cooldown types:

Example

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

$getCustomStatus

Returns a user’s custom status.

Syntax

$getCustomStatus[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user whose custom status to get.

Example

$nomention
Custom status: $getCustomStatus[$authorID]
!example Custom status: Hello! I'm RainbowKey

How $authorID works?

$getEmbedData

Fetches embed data from the provided message.

Syntax

$getEmbedData[Channel ID;Message ID;Embed index;Embed property (title/description/footer/color/image/timestamp)]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel this message belongs to.
  • Message ID (Type: Snowflake || Flag: Required): The message to get this embed data from.
  • Embed index (Type: HowMany || Flag: Required): The embed of this message to get data from. Use 1 for the first embed of this message. (learn more)
  • Embed property (Type: Enum || Flag: Required): The embed property to return. Embed properties:
    • title - The title of the embed.
    • description - The description of the embed.
    • footer - The footer of the embed.
    • color - The color border hex of the embed.
    • image - The image of the embed.
    • timestamp - The timestamp of the embed.

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 the provided invite code.

Syntax

$getInviteInfo[Invite code;Invite property]

Parameters

  • Invite code (Type: String || Flag: Required): The invite code to get info about.
  • Invite property (Type: Enum || Flag: Required): 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

$getLeaderboardPosition

Get position in leaderboard for given variable.

Syntax

$getLeaderboardPosition[Variable type;Variable name;Sort type;(User ID)]

Parameters

  • Variable type (Type: Enum || Flag: Required): The type of the variable. Variable types:
  • Variable name (Type: String || Flag: Required): The variable name to generate the leaderboard for.
  • Sort type (Type: Enum || Flag: Required): The sort type. Sort types:
    • asc - Sorts the values in ascending order.
    • desc - Sorts the values in descending order.
  • User ID: (Type: Snowflake || Flag: Optional): ID of the user from whom you want to get a position in the leaderboard.

Example

$nomention
My position in leaderboards: $getLeaderboardPosition[user;Coins;desc]
!example My position in leaderboards: 2

$getLeaderboardValue

Gets a leaderboard value.

Syntax

$getLeaderboardValue[Variable type;Variable name;Sort type;Position;(Return type)]

Parameters

  • Variable type (Type: Enum || Flag: Required): The type of the variable. Variable types:
  • Variable name (Type: String || Flag: Required): The variable name to generate the leaderboard for.
  • Sort type (Type: Enum || Flag: Required): The sort type. Sort types:
    • asc - Sorts the values in ascending order.
    • desc - Sorts the values in descending order.
  • Position (Type: HowMany || Flag: Required): The leaderboard position to get, e.g 1, 3, etc.
  • Return type (Type: Enum || Flag: Optional): The return type. Return types:
    • id - Returns the ID of the user belonging to this position.
    • value - Returns the variable value of this position.
    • none - If this field is excluded, it will return Username - Value.

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 the provided message.

Syntax

$getMessage[Channel ID;Message ID;(Property)]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel that this message belongs to.
  • Message ID (Type: Snowflake || Flag: Required): The message to get the data from.
  • Property (Type: Enum || Flag: Optional): The message data to get. The 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 who reacted to a message.

Syntax

$getReactions[Channel ID;Message ID;Separator;Emoji]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel that the message belongs to.
  • Message ID (Type: Snowflake || Flag: Required): The message to get the user-reactions from.
  • Separator (Type: String || Flag: Required): The separator between each user.
  • Emoji (Type: Emoji || Flag: Required): The emoji to get the user’s reactions for.

Example

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

example

$getRoleColor

Returns a role’s color hex.

Syntax

$getRoleColor[Role ID]

Parameters

  • Role ID (Type: Snowflake || Flag: Required): The role to get the color hex from.

Example

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

example

$getServerInvite

Returns the current server’s invite URL.

Syntax

$getServerInvite

Permissions

Required permissions that the bot must have for this function to work properly :

  • createinstantinvite

Example

$nomention
$getServerInvite

example

$getServerInvite[]

Returns the provided server’s invite URL.

🧙‍♂️ Note: The bot must be present in the provided server for it to create an invite.

Syntax

$getServerInvite[Guild ID]

Parameters

  • Guild ID (Type: Snowflake || Flag: Required): The server for which to get the invite.

🧙‍♂️ How do I find a server/guild ID? (click-me)

Permissions

Required permissions that the bot must have for this function to work properly :

  • createinstantinvite

Example

$nomention
$getServerInvite[$message[1]]

example

$getServerVar

Returns the value of the provided server variable.

Syntax

$getServerVar[Variable name;(Guild ID)]

Parameters

  • Variable name (Type: String || Flag: Required): The name of the variable to get.
  • Guild ID (Type: Snowflake, String || Flag: Optional): The server to get the value for. If no guild ID is inputted, then the current server is used.

For more info, see the Variables Guide.

$getTextSplitIndex

Retrieves index from the provided value in $textSplit[]. Returns -1 if it couldn’t find the value.

Syntax

$getTextSplitIndex[Value]

Parameters

  • Value (Type: String || Flag: Emptiable): The value to search in the text split.

Example

$nomention
$textSplit[hello_world_!;_]
> $getTextSplitIndex[$message]
!example world 2 !example bdfd -1

For more info, see the Text Splitting Guide.

$getTextSplitLength

Returns the number of splits in $textSplit[].

Syntax

$getTextSplitLength

Example

$nomention
$textSplit[hello%world%!;%]
> $getTextSplitLength
!example 3

For more info, see the Text Splitting Guide.

$getTimestamp

Returns the current unix timestamp in seconds.

Syntax

$getTimestamp

Example

$nomention
Unix Timestamp: $getTimestamp

example

📄 For more info about UNIX timestamps on Discord click here.

$getTimestamp[]

Returns the current unix timestamp in the selected time unit.

Syntax

$getTimestamp[Time unit]

Parameters

  • Time unit (Type: Enum || Flag: Required): Sets timestamp time unit.

📝 Time unit value can either be :

  • s (seconds)
  • ms (milliseconds)
  • ns (nanoseconds)

Example

$nomention
Unix Timestamp
 In Seconds - $getTimestamp[s]
 In Milliseconds - $getTimestamp[ms]
 In Nanoseconds - $getTimestamp[ns]

example

📄 For more info about UNIX timestamps on Discord click here.

$getUserStatus

Returns the provided user’s status/presence.

🧙‍♂️ The user must share atleast 1 server with the bot, for this function to work.

Syntax

$getUserStatus[User ID]

The different statuses this function will return are: online, dnd, idle and offline.

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to get the status for.

Privileged Intents

This function requires the following privileged intents:

Example

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

example

$getUserVar

Returns a local-user variable value.

Syntax

$getUserVar[Variable name;(User ID;Guild ID)]

Parameters

  • Variable name (Type: String || Flag: Required): The name of the variable to get.
  • User ID (Type: String, Snowflake || Flag: Vacantable): The user to get the variable value for. If no user is provided, the author is used.
  • Guild ID (Type: Snowflake || Flag: Optional): The guild to get the variable value for. If no guild is provided, the current guild is used.

Example

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

example

For more info, see the Variables Guide.

$getVar

Gets the value of a global/global-user variable.

Syntax

$getVar[Variable name;(User ID)]

🧙‍♂️ For a global variable, a User ID doesn’t need to be provided. For a global-user variable, User ID must be provided.

Parameters

  • Variable name (Type: String || Flag: Required): The name of the variable to get the value from.
  • User ID (Type: Snowflake, String || Flag: Vacantable): The user to get the value for (if global-user).

Example

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

example

For more info, see the Variables Guide.

$giveRole

(deprecated)

🧙‍♂️ This command is deprecated, instead better use $roleGrant[].

Adds a role to the provided user.

Syntax

$giveRole[User/Role ID;(Role ID)]

Parameters

  • User/Role ID (Type: Snowflake || Flag: Required): The user to add the specified role to or the role to add to the mentioned users. If only this parameter is provided, it will be read as “Role ID”.
  • Role ID (Type: Snowflake || Flag: Optional): The role to add to the user. If this parameter is used, it reads the first parameter as “User ID”.

Examples

Example #1

$nomention
$onlyPerms[manageroles;Missing permissions!]

$giveRole[807004801753284618]
Added $roleName[807004801753284618] to $username[$mentioned[1]]!

example1

Example #2

$nomention
$onlyPerms[manageroles;Missing permissions!]
$trimContent

$giveRole[$mentioned[1];$message[2]]
Added the role **$roleName[$message[2]]** to **$username[$mentioned[1]]**!

example2

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

Syntax

$globalCooldown[Duration;Error message]

Parameters

  • Duration (Type: Duration || Flag: Required): The duration until the user can use this command again.
  • Error message (Type: String || Flag: Emptiable): The message to return when the cooldown duration is still ongoing.

🧙‍♂️ You can use %time% in the “Error message” argument to get how much time is left until the cooldown is over.

Example

$nomention
$globalCooldown[30s;$displayName, You are on cooldown for %time%!]

Hello $displayName!

example

$globalUserLeaderboard

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

Syntax

$globalUserLeaderboard[Variable name;Sort type (asc/desc)]

Parameters

  • Variable name (Type: String || Flag: Required): The variable to create the leaderboard for.
  • Sort type (Type: Enum || Flag: Optional): The sort type of the values (default is desc). Sort types:
    • asc - Sorts the values in ascending order.
    • desc - Sorts the values in descending order.

🧙‍♂️ $globalUserLeaderboard automatically generates a description. So, $description should not be used in the code.

Example

$nomention
$globalUserLeaderboard[Money;desc]

$guildExists

Checks if the provided guild/server exists.

Returns true if the server exists. Returns false if the server doesn’t exist or the bot isn’t present in the provided server.

Syntax

$guildExists[Guild ID]

Parameters

  • Guild ID (Type: Snowflake, String || Flag: Emptiable): The ID of the hypothetical server.

Example

$nomention
$guildExists[$message[1]]
!example 566363823137882154 true

$guildID

Returns the current server’s ID.

Syntax

$guildID

Example

$nomention 
Server ID is : $guildID

example

$guildID[]

Finds a server ID using a server’s name.

🧙‍♂️ Note: The bot must be present in the server in order to get the server ID.

Syntax

$guildID[Server name]

Parameters

  • Server name (Type: String || Flag: Emptiable): The name of the server.

Example

$nomention
$noMentionMessage ID is : $guildID[$noMentionMessage]

example

$hasRole

Returns whether or not a user has the provided role.

🧙‍♂️ “true” means the user has the role, “false” means they don’t.

Syntax

$hasRole[User ID;Role ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to check for the role.
  • Role ID (Type: Snowflake || Flag: Emptiable): The role that the bot is checking the user for.

Example

$nomention
$hasRole[$authorID;858376972303204362]
!example true

$highestRole

Returns the ID of the current server’s highest role (according to its position).

Syntax

$highestRole

Example

$nomention
The server's highest role: <@&$highestRole> ($highestRole)

example

$highestRole[]

Returns the ID of the provided user’s highest role (according to its position).

Syntax

$highestRole[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user for which to return the 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 current server that has all the provided permissions.

Syntax

$highestRoleWithPerms[Permissions]

Parameters

  • Permissions (Type: Permission || Flag: Required): The permissions that the role needs to have.

Example

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

example

$hostingExpireTime

Returns your bot’s hosting expiration date.

Syntax

$hostingExpireTime

Example

$nomention 
$hostingExpireTime 

example1

$hostingExpireTime[]

Returns your bot’s hosting expiration date. If “yes” is provided, the function returns the expiration date in a UNIX timestamp.

Syntax

$hostingExpireTime[Return unix timestamp?]

Parameters

  • Return unix timestamp? (Type: Bool || Flag: Required): Whether to return the expiration date in a UNIX timestamp or not.

Example

$nomention
I will be offline <t:$hostingExpireTime[yes]:R>

example2

$hour

Returns the current hour.

You can use $time to change the timezone.

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

Syntax

$hour

Example

$nomention
Current Hour: $hour
!hour

$hypesquad

Returns the hypesquad house name of the provided user.

Syntax

$hypesquad[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The ID of the user whose hypesquad house name should be returned.

Example

$nomention
You are in $hypesquad[$authorID] house.

example

$if

Executes the following block of code if the provided condition is true.

Syntax

$if[Condition]

Parameters

  • Condition (Type: String || Flag: Required): Check that will be carried out.

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.

Example

$nomention
$if[$authorID==$botOwnerID]
  $sendMessage[You are the developer of this bot!]
$endif
!example You are the developer of this bot! !example Nothing

For more info, see the If Guide.

$ignoreChannels

The command can’t be executed in any of the provided channels. If the channel is ignored, then the provided “Error message” is returned.

Syntax

$ignoreChannels[Channel IDs;...;Error message]

Parameters

  • Channel IDs (Type: Snowflake || Flag: Emptiable): The channels to ignore. Use semicolons ; as a separator to separate multiple channel IDs.
  • Error message (Type: String || Flag: Emptiable): The message that is returned when the channel is ignored.

Example

$nomention
$ignoreChannels[1099033713687404614;❌ That command can't be used in this channel!]

Hello $username!

Ignored channel

example1

Whitelisted channel

example2

$ignoreLinks

Ignores image links in the message.

Syntax

$ignoreLinks

Example

$nomention
$ignoreLinks
Here's a toaster IRL:
https://media.discordapp.net/attachments/1011682358031826994/1027580044928888832/856506821023629332.png

With

Without

$image

Adds an image to the embed.

Syntax

$image[Image URL;(Index)]

Parameters

  • Image URL (Type: URL || Flag: Emptiable): The URL of the image that appears. Must be a valid image URL.
  • Index (Type: Integer || Flag: Optional): What embed the image should belong to. The default is 1. (learn more)

Example

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

example

$input

Retrieves input from a modal.

Syntax

$input[Text Input ID]

Parameters

  • Text Input ID (Type: String || Flag: Required): The input ID in $addTextInput[].

Example

Interaction command code

$nomention
Name : $input[modalInput1]
Pronouns : $input[modalInput2]
About me : $input[modalInput3]

example

For more info, see the Modals Guide.

$isAdmin

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

“true” means the user has the administrator permission, “false” means they don’t.

Syntax

$isAdmin[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to check.

Example

$nomention
Are you an admin?: `$isAdmin[$authorID]`
!example Are you an admin?: true

$isBanned

Returns whether a user is banned from the current server or not. Requires the BAN_MEMBERS permission.

🧙‍♂️ “true” means the user is banned, “false” means they aren’t.

Syntax

$isBanned[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to check its ban status.

Example

$nomention
$isBanned[$message[1]]

example

$isBoolean

Returns whether the provided text is a boolean or not.

“true” means the text is a boolean, “false” means it isn’t.

Syntax

$isBoolean[Text]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to check.

Supported Booleans

PositiveNegative
truefalse
yesno
onoff
enabledisable

Example

$nomention
Is boolean?: `$isBoolean[$message]`
!example yes Is boolean?: true !example false Is boolean?: true !example text Is boolean?: false

$isBooster

Returns if user is boosting guild with nitro.

“true” means the user is a booster, “false” means it isn’t.

Syntax

$isBooster[(User ID;Guild ID)]

Parameters

Example

$nomention
Booster? $isBooster[$mentioned[1]]
!example kubastick Booster? true

You can use $isBooster[] to get the status of author.
How $mentioned[] works?

$isBot

Returns whether the provided user is a bot or not.

“true” means the user is a bot, “false” means they aren’t.

Syntax

$isBot[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Emptiable): The user to check.

Example

$nomention
Bot?: $isBot[$mentioned[1]]
!example MineBarekSA Bot?: false !example BDFD Support Bot?: true

$isHoisted

Returns whether a role is displayed separately or not.

🧙‍♂️ “true” means the role is hoisted, “false” means it isn’t.

Syntax

$isHoisted[Role ID]

Parameters

  • Role ID (Type: Snowflake || Flag: Required): The role to check its hoisted status.

Example

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

example

$isMentionable

Returns whether a role is mentionable by everyone or not.

🧙‍♂️ “true” means the role is mentionable, “false” means it isn’t.

setting

Syntax

$isMentionable[Role ID]

Parameters

  • Role ID (Type: Snowflake || Flag: Required): The role to check for its mentionable status.

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.

Syntax

$isNSFW[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel to check.

Example

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

example

$isNumber

Returns whether the provided value is a number or not.

🧙‍♂️ “true” means the value is a number, “false” means it isn’t.

Syntax

$isNumber[Value]

Parameters

  • Value (Type: String || Flag: Emptiable): 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.

Syntax

$isSlash

Example

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

example

$isTicket

Checks whether the current or specified channel is a ticket or not.

🧙‍♂️ “true” means the channel is a ticket, “false” means it isn’t.

Syntax

$isTicket[(Channel ID)]

Parameters

  • Channel ID (Type: Snowflake || Flag: Optional): The channel to check. (Defaults to the current channel)

Example

$nomention
$onlyIf[$isTicket[]==true;This command can only be used in a ticket!]
This is a ticket!

example
example

To create a ticket, use the $newTicket[] function.

$isTimedOut

Checks whether the specified user is timed out or not.

🧙‍♂️ “true” means the user is timed out, “false” means they aren’t.

Syntax

$isTimedOut[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to check.

Example

$nomention
User is timed out: $isTimedOut[$mentioned[1]]

example

$isUserDMEnabled

Checks whether the bot can DM the user or not.

🧙‍♂️ “true” means the bot can DM the user, “false” means it can’t.

Syntax

$isUserDMEnabled[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to check.

Example

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

example

$isValidHex

Checks whether the given color hex is valid or not.

🧙‍♂️ “true” means the color hex is valid, “false” means it isn’t.

Syntax

$isValidHex[Color hex]

Parameters

  • Color hex (Type: String || Flag: Emptiable): The color hex to check.

Example

$nomention
$isValidHex[$message[1]]

example

$joinSplitText

Joins $textSplit[] values with a provided separator.

Syntax

$joinSplitText[Separator]

Parameters

  • Separator (Type: String || Flag: Emptiable): The separator to be put between the text split values.

Example

We are joining the text split value with a new line, replacing the provided separator in $textSplit[].

$nomention
$textSplit[$message;-]
$joinSplitText[+]
!example hello-world-! hello+wolrd+!

For more info, see the Text Splitting Guide.

$kick

Kicks the user who ran the command.

Syntax

$kick

Permissions

Required permissions that the bot must have for this function to work properly:

  • kick

$kick[]

Kicks the provided user.

Syntax

$kick[user ID;(reason)]

Parameters

  • user ID (Type: Snowflake || Flag: Required): The user to kick from the server.
  • reason (Type: String || Flag: Vacantable): The audit-log reason for the kick.

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.

Note: The user running the command must have the “kick” permission.

Syntax

$kickMention[Reason]

Parameters

  • Reason (Type: String || Flag: Emptiable): The audit-log reason for the kick.

Permissions

Required permissions that the bot must have for this function to work properly:

  • kick

Example

$nomention
$kickMention[$noMentionMessage]
✅ Kicked `$username[$mentioned[1]]#$discriminator[$mentioned[1]]`!

example

$lowestRole

Returns the ID of the current server’s lowest role (according to its position).

Syntax

$lowestRole

Example

$nomention
The server's lowest role: <@&$lowestRole> ($lowestRole)

example

$lowestRole[]

Returns the ID of the provided user’s lowest role (according to its position).

Syntax

$lowestRole[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user for which to return the 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.

Syntax

$lowestRoleWithPerms[Permissions;...]

Parameters

  • Permissions (Type: Permission || Flag: Required): The permissions that the role needs to have. Use semicolons ; as a separator to separate multiple permissions.

Example

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

example

$max

Returns the largest number from the provided numbers.

Syntax

$max[A;B;...]

Parameters

  • A,B,... (Type: Integer || Flag: Required): The numbers to get the maximum from. At least two numbers must be provided! Use semicolons ; as a separator to separate multiple numbers.

Example

$nomention
$max[100;20;50]

example

$membersCount

Returns the amount of members in the current guild.

Syntax

$membersCount

Example

$nomention
This server has $membersCount members 

example1

Note

You can use $membersCount in the bot status to display how many users are in all servers of the bot.

example2

$membersCount[]

Returns the amount of members in the current guild with provided presence.

Syntax

$membersCount[Presence]

Parameters

  • Presence (Type: Enum || Flag: Required): Returns the amount of members that have their presences set. Presence types:
    • online
    • offline
    • idle
    • dnd
    • invisible

Privileged Intents

This function requires the following privileged intents:

Example

$nomention 
there are $membersCount[online] online users in this server

example

$mentioned

Returns the ID of the mentioned user.

Syntax

$mentioned[Mention number;(Return author?)]

Parameters

  • Mention number (Type: HowMany || Flag: Required): The user-mention to get from the author’s message (1 = first user-mention, 2 = second, etc).
  • Return author? (Type: Bool || Flag: Optional): 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.

Syntax

$mentionedChannels[Mention number;(Return current?)]

Parameters

  • Mention number (Type: HowMany || Flag: Required): The channel-mention to get from the author’s message (1 = first channel-mention, 2 = second, etc).
  • Return current? (Type: Bool || Flag: Optional): 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.

Syntax

$mentionedRoles[Mention number]

Parameters

  • Mention number (Type: HowMany || Flag: Required): 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).

Syntax

$message

Example

$nomention
$message
!say Hello everyone 👋 Hello everyone 👋

$message[]

Returns an argument from the message or the input of a slash command option.

Syntax

$message[Argument number;(Argument name)]

Parameters

  • Argument number (Type: HowMany, String || Flag: Required): Returns the argument matching the provided number.
  • Argument name (Type: String || Flag: Optional): Returns the input of the matching slash command option.

🧙‍♂️ 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

If you want this function to work in a slash command only, then you can use $message[Argument name]. If this function should work in a normal and slash command, then you can use $message[Argument number;Argument name].

🧙‍♂️ For example, $message[message] would just return the input of the slash command option named “message”. $message[1;text] would return the first word of the message or the input of the slash command option named “text”.

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

Examples

Normal command

$nomention
First word: $message[1]
Second word: $message[2]
Third word: $message[3]

example1

Slash command

We retrieve the input of the slash command option named “message”.

$nomention
$message[message]

example2 example3

Normal and Slash command

We retrieve the first argument of the message or the input of the slash command option named “text”.

$nomention
$message[1;text]

Normal

example4

Slash

example5 example6

$messageID

Returns the ID of the author’s message.

📝 If $messageID is written in $onInteraction commands, it will return the bot’s message ID.

Syntax

$messageID

Example

$nomention
$messageID

example

$min

Returns the smallest number from the provided numbers.

Syntax

$min[A;B;...]

Parameters

  • A,B,... (Type: Integer || Flag: Required): The numbers to get the minimum from. At least two numbers must be provided! Use semicolons ; as a separator to separate multiple numbers.

Example

$nomention
$min[3;5;1]

example

$minute

Returns the current minute of this hour.

🧙‍♂️ You can use $time to change the timezone.

Syntax

$minute

Example

$nomention
Current Minute: $minute

example

$modifyChannel

Edits a channel with the data provided.

🧙‍♂️ You can use !unchanged as an argument for the option to remain in its current state.

Syntax

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

Parameters

  • channelID (Type: Snowflake || Flag: Required): The channel the bot will edit.
  • channelName (Type: String || Flag: Vacantable): New channel name.
  • topic (Type: String || Flag: Vacantable): New channel topic/description.
  • NSFW (Type: Bool || Flag: Vacantable): Whether the channel will be marked as NSFW or not.
  • position (Type: Integer || Flag: Vacantable): The new channel position (1 = top).
  • categoryID (Type: Snowflake || Flag: Vacantable): The category to which the channel should belong to.

🧙‍♂️ You can use $channelID[category/channelName] to get the ID of a category or channel.

Permissions

Required permissions that the bot must have for this function to work properly :

  • managechannels

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

(deprecated)

🧙‍♂️ This command is deprecated, instead better use $editChannelPerms[].

Modifies a channel’s permissions.

Syntax

$modifyChannelPerms[Channel ID;Permissions;User/Role ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel to change the permissions for.
  • Permissions (Type: Permission || Flag: Required): The permissions to add/remove. + means allow, - means deny, / means neutral permission.
  • User/Role ID (Type: Snowflake || Flag: Required): The role or user to modify the permissions for. Use $guildID for @everyone.

Example

Lock:

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

example1

Unlock:

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

example2

$modifyRole

Modifies an existing role.

Syntax

$modifyRole[Role ID;(Role name;Color hex;Hoisted?;Mentionable?)]

🧙‍♂️ You can use !unchanged as an argument to leave the setting as-is.

Parameters

  • Role ID (Type: Snowflake || Flag: Required): The ID of the role to modify.
  • Role name (Type: String || Flag: Optional): The new role name.
  • Color hex (Type: Color || Flag: Optional): The new role color.
  • Hoisted? (Type: Bool || Flag: Optional): Whether the role should be displayed separately or not.
  • Mentionable? (Type: Bool || Flag: Optional): Whether the role should be mentionable by everyone or not.

Permissions

Required permissions that the bot must have for this function to work properly:

  • manageroles

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.

Syntax

$modifyRolePerms[Role ID;Permissions;...]

Parameters

  • Role ID (Type: Snowflake || Flag: Required): The role to modify the permissions for. Use $guildID for the @everyone role.
  • Permissions (Type: Permission || Flag: Required): The permissions to toggle. Use semicolons ; as a separator to separate multiple permissions.

$modulo

Returns remainder between numbers.

Syntax

$modulo[A;B]

Parameters

  • A (Type: Integer || Flag: Required): The dividend.
  • B (Type: Integer || Flag: Required): The divisor.

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.

Syntax

$month

Example

$nomention
Current Month: $month

example

$multi

Muliplies the provided numbers.

Syntax

$multi[Number;..]

Parameters

  • Number (Type: Float, Integer || Flag: Required): The numbers to multiply. Use semicolons ; as a separator to separate multiple numbers.

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.

Syntax

$mute[mutedRoleName]

Parameters

  • mutedRoleName (Type: String || Flag: Required): 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

$newModal

Creates a new modal.

Syntax

$newModal[Modal ID;Title]

Parameters

  • Modal ID (Type: String || Flag: Required): The ID of the $newModal[] which is used in $onInteraction[] callback.
  • Title (Type: String || Flag: Required): The title displayed in the modal.

Example

$nomention
$newModal[modal;User Bio]
$addTextInput[modalInput1;short;What is your name?;3;30;yes;;Mikołaj]
$addTextInput[modalInput2;short;What are your pronouns?;2;30;yes;;He/Him]
$addTextInput[modalInput3;paragraph;Can you tell us about yourself?;5;1000;no;;I am a Developer]

example

For more info, see the Modals Guide.

$newSelectMenu

Adds a select menu to a message.

Syntax

$newSelectMenu[Menu ID;Min;Max;(Placeholder;Message ID)]

Parameters

  • Menu ID (Type: String || Flag: Required): The menu ID which is used in the $onInteraction[] callback and inside the first argument of $addSelectMenuOption[].
  • Min (Type: Integer || Flag: Required): The minimum amount of values that can be selected.
  • Max (Type: Integer || Flag: Required): The maximum amount of values that can be selected.
  • Placeholder (Type: String || Flag: Vacantable): The text that appears if no option is selected.
  • Message ID (Type: Snowflake || Flag: Vacantable): The ID of a message that should have a select menu added to it. By default, it’s the bot’s response.

Example

$nomention
A cool message
$newSelectMenu[Example;1;1;Choose some option]
$addSelectMenuOption[Example;First;first-option;The first option]
$addSelectMenuOption[Example;Second;second-option;The second option]
$addSelectMenuOption[Example;Third;third-option;The third option]

example

For more info, see the Select Menu Guide.

$newTicket

Creates a new ticket.

Syntax

$newTicket[Category ID/Name;No question message;In ticket message;Message to user;Error message;(Ticket number;Return ID of the ticket message?)]

Parameters

  • Category ID/Name (Type: String || Flag: Emptiable): The category to put the ticket channels in. Can be a category ID or name.

    🧙‍♂️ Setup the ticket category permissions:
    tickets

  • No question message (Type: String || Flag: Emptiable): The message that appears in {subject} when the user doesn’t provide a subject.

  • In ticket message (Type: String || Flag: Emptiable): The message that is sent in the new ticket channel.

  • Message to user (Type: String || Flag: Emptiable): The message that gets sent in the current channel.

  • Error message (Type: String || Flag: Emptiable): The message that gets returned when the ticket can’t be created.

  • Ticket number (Type: Integer || Flag: Optional): For custom ticket number.

  • Return ID of the ticket message? (Type: Bool || Flag: Optional): Whether you want the ticket message to return its ID.

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
example2

$nickname

Returns the nickname of the author of the message.

🧙‍♂️ Nickname means the user’s server nickname. If the user doesn’t have a nickname then their display name is returned instead.

Syntax

$nickname

Example

$nomention
Your nickname is `$nickname`

example

$nickname[]

Returns the nickname of the given user.

🧙‍♂️ Nickname means the user’s server nickname. If the user doesn’t have a nickname then their display name is returned instead.

Syntax

$nickname[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to get the nickname for.

Example

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

example

$nomention

Disables the default author mention.

Syntax

$nomention

Example

With $nomention:

example

Without $nomention:

example

$noMentionMessage

Returns the user’s full message without any mentions (without the command trigger).

Syntax

$noMentionMessage

Example

$nomention
$noMentionMessage

example

$noMentionMessage[]

Returns an argument from the user’s message omitting any mentions.

Syntax

$noMentionMessage[Argument number]

Parameters

  • Argument number (Type: HowMany || Flag: Required): Returns the argument matching the provided number (excluding mentions).

🧙‍♂️ For example, $noMentionMessage[1] would just return the first word of the message, ignoring any possible mentions before. You can also use $noMentionMessage[>] to get the last argument/word of the user’s message.

Example

$nomention
1. $noMentionMessage[1]
3. $noMentionMessage[3]
Last: $noMentionMessage[>]

example

$nodeVersion

Returns the version of the current node.

Syntax

$nodeVersion

Example

$nomention
Node version: $nodeVersion
!example Node version: 05-07-2023-c8800d6

You can use $botNode to find out which node your bot is on.

$nodeVersion[]

Returns the version of the specified node.

Syntax

$nodeVersion[Node Number]

Parameters

  • Node Number (Type: Integer || Flag: Required): The number of the node for which to return its version.

You can use $botNode to find out which node your bot is on.

Example

$nomention
13 Node Version: $nodeVersion[13]
!example 13 Node Version: 05-07-2023-c8800d6

$numberSeparator

Separates the thousands in a number.

Syntax

$numberSeparator[Number;(Separator)]

Parameters

  • Number (Type: Integer || Flag: Required): The number to apply the separator to.
  • Separator (Type: String || Flag: Vacantable): The separator between each thousand. The default is ,.

Example

$nomention
$numberSeparator[5000]

image

$onlyAdmin

Allows command execution only for users with administrator permission.

Syntax

$onlyAdmin[Error message]

Parameters

  • Error message (Type: String || Flag: Emptiable): The error message that is returned when the user isn’t an administrator.

Example

$nomention
$onlyAdmin[❌ Only administrators can use this command!]

$c[Put your code here.]

$onlyBotChannelPerms

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

Syntax

$onlyBotChannelPerms[Channel ID;Permissions;...;Error message]

Parameters

  • Channel ID (Type: Snowflake || Flag: Emptiable): The channel to check the permissions for. Use $channelID for the current channel.
  • Permissions (Type: Permission || Flag: Required): The permissions that the bot needs to execute the command. Use semicolons ; as a separator to separate multiple permissions.
  • Error message (Type: String || Flag: Emptiable): The message that is returned when the bot doesn’t have the needed permissions.

Example

$nomention
$onlyBotChannelPerms[$channelID;sendmessages;embedlinks;❌ Missing permissions!]
$description[Hey! I have `Embed links` permission in the current channel.]

$onlyBotPerms

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

Syntax

$onlyBotPerms[Permissions;...;Error message]

Parameters

  • Permissions (Type: Permission || Flag: Emptiable): The permissions that the bot needs to run the command. Use semicolons ; as a separator to separate multiple permissions.
  • Error message (Type: String || Flag: Emptiable): The message to return when the bot doesn’t have all the provided permissions.

Example

$nomention
$onlyBotPerms[sendmessages;embedlinks;❌ Missing permissions!]
$description[Hey! I have `Embed links` permission.]

$onlyForCategories

The command can only be executed in the provided categories.

Syntax

$onlyForCategories[Category IDs;...;Error message]

Parameters

  • Category IDs (Type: Snowflake || Flag: Emptiable): The categories where the command can be executed in. Use semicolons ; as a separator to separate multiple category IDs.
  • Error message (Type: String || Flag: Emptiable): The message that is returned when the command is executed in non-whitelisted categories.

Example

$nomention
$onlyForCategories[790620501927526462;❌ This command can't be executed in this category!]

$c[Put your code here.]

$onlyForChannels

The command can only be executed in the provided channels.

Syntax

$onlyForChannels[Channel IDs;...;Error message]

Parameters

  • Channel IDs (Type: Snowflake || Flag: Emptiable): The channels that the command can be executed in. Use semicolons ; as a separator to separate multiple channel IDs.
  • Error message (Type: String || Flag: Emptiable): The message that is returned when the command is used in a non-whitelisted channel.

Example

$nomention
$onlyForChannels[1050809741137412177;816767374610923601;❌ This command can't be executed in this channel!]

$c[Put your code here.]

$onlyForIDs

The command can only be executed by the provided users.

Syntax

$onlyForIDs[User IDs;...;Error message]

Parameters

  • User IDs (Type: Snowflake || Flag: Emptiable): The users that can use this command. Use semicolons ; as a separator to separate multiple user IDs.
  • Error message (Type: String || Flag: Emptiable): The error message that is returned, when the user running the command is not whitelisted.

Example

$nomention
$onlyForIDs[$botOwnerID;❌ You are not my owner!]
$eval[$message]

$c[This can only be executed in BDScript 2.]

$onlyForRoles

The command can only be executed by users with any of the provided roles.

Syntax

$onlyForRoles[Role names;...;Error message]

Parameters

  • Role names (Type: String || Flag: Emptiable): The roles that can use this command. Use semicolons ; as a separator to separate multiple role names.
  • Error message (Type: String || Flag: Emptiable): The message to return when the user doesn’t have the required roles.

Example

$nomention
$onlyForRoles[Moderator;Admin;❌ You don't have any of the required roles to use this command!]

$c[Put your code here.]

$onlyForRoleIDs

The command can only be executed by users with any of the provided roles.

Syntax

$onlyForRoleIDs[Role IDs;...;Error message]

Parameters

  • Role IDs (Type: Snowflake || Flag: Emptiable): The role IDs which are allowed to execute the command. Use semicolons ; as a separator to separate multiple role IDs.
  • Error message (Type: String || Flag: Emptiable): The message to return when the user doesn’t have the required roles.

Example

$nomention
$onlyForRoleIDs[790625761480146967;❌ You don't have any of the required roles to use this command!]

$c[Put your code here.]

$onlyForServers

The command can only be executed in the provided servers.

Syntax

$onlyForServers[Server IDs;...;Error message]

Parameters

  • Server IDs (Type: Snowflake || Flag: Emptiable): The servers that the command can be executed in. Use semicolons ; as a separator to separate multiple server IDs.
  • Error message (Type: String || Flag: Emptiable): The message that is returned when the command is used in a non-whitelisted server.

Example

$nomention
$onlyForServers[566363823137882154;❌ This command can't be executed in this server!]

$c[Put your code here.]

$onlyForUsers

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

Syntax

$onlyForUsers[Usernames;...;Error message]

Parameters

  • Usernames (Type: String || Flag: Emptiable): The names of the users that can execute this command. Use semicolons ; as a separator to separate multiple usernames.
  • Error message (Type: String || Flag: Emptiable): The message that is returned when the command is used by a non-whitelisted user.

Example

$nomention 
$onlyForUsers[Nicky;❌ Only users with the username `Nicky` can execute this command!]

$c[Put your code here.]

$onlyIf

If value1 is related accordingly (based on the “sign”) with value2 then the code runs. If not, the provided error message is returned.

Syntax

$onlyIf[Condition;Error message]

Parameters

  • Condition (Type: String || Flag: Required): The condition to check (e.g. value1!=value2).
  • Error message (Type: String || Flag: Emptiable): The message to return when the condition isn’t true.

Signs

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

⚠️ The signs <, >, <= and >= only work with numbers.

Examples

Equal (==)

$nomention
$onlyIf[$message[1]==BDFD;❌ The first argument of your message must be "BDFD"!]

Not Equal (!=)

$nomention
$onlyIf[$message[1]!=BDFD;❌ The first argument of your message can't be "BDFD"!]

Less Than (<)

$nomention
$onlyIf[$message[1]<3000;❌ The number must be less than 3000!]

Greater Than (>)

$nomention
$onlyIf[$message[1]>3000;❌ The number must be greater than 3000!]

Less Than Or Equal To (<=)

$nomention
$onlyIf[$message[1]<=50000;❌ The number must be less than or qual to 50000!]

Greater Than Or Equal To (>=)

$nomention
$onlyIf[$message[1]>=50000;❌ The number must be greater than or qual to 50000!]

$onlyIfMessageContains

Checks if the provided message contains every provided word, otherwise the provided error message is returned.

Syntax

$onlyIfMessageContains[Message;Word;...;Error message]

Parameters

  • Message (Type: String || Flag: Emptiable): The text to check.
  • Word (Type: String || Flag: Emptiable): The words that the message must contain. Use semicolons ; as a separator to separate multiple words.
  • Error message (Type: String || Flag: Emptiable): The message that is returned if the text doesn’t contain all the provided words.

Example

$nomention
$onlyIfMessageContains[$message;Hello;Hi;❌ Your message must contain `Hello` and `Hi`!]

$c[Put your code here.]

$onlyNSFW

Only allows the command to be executed in NSFW channels.

Syntax

$onlyNSFW[Error message]

Parameters

  • Error message (Type: String || Flag: Emptiable): The message that is returned when the command is executed outside of an NSFW channel.

Example

$nomention
$onlyNSFW[❌ That command can only be executed in NSFW channels.]

$c[Put your code here.]

$onlyPerms

The command can only be executed if the user running the command has all of the provided permissions.

Syntax

$onlyPerms[Permissions;...;Error message]

Parameters

  • Permissions (Type: Permission || Flag: Emptiable): The required permissions. Use semicolons ; as a separator to separate multiple permissions.
  • Error message (Type: String || Flag: Emptiable): The message that is returned when the user is missing the required permissions.

Example

$nomention
$onlyPerms[kick;❌ You need the `kick` permission to use this command!]
$kickMention[$noMentionMessage]

$optOff

Can only be used in BDScript 2. Executes functions with turned off optimizations.

As stated in the function description, $optOff disables the optimization of the functions in its arguments.
This means that functions such as $random, $randomText and others won’t return the previous response, but instead a new response will be returned.

Syntax

$optOff[Functions to be executed]

Parameters

  • Functions to be executed (Type: String || Flag: Emptiable): The functions to execute with turned off optimizations.

Example

Let’s try to run this simple code without $optOff:

The 1st random: $random[1;101]
The 2nd random: $random[1;101]
The 3rd random: $random[1;101]

Example

As we can see, all three randoms returned the same number. Let’s fix this by adding $optOff:

$optOff[
The 1st random: $random[1;101]
The 2nd random: $random[1;101]
The 3rd random: $random[1;101]
]

Example

But what if we want to make only the 1st random different from others? In that case we shouldn’t put all this code into $optOff, but only put a particular random into it - the 2nd one:

The 1st random: $random[1;101]
The 2nd random: $optOff[$random[1;101]]
The 3rd random: $random[1;101]

Example

As you can see, the 3rd random will inherit the response of the 2nd one, since it’s not included in $optOff.

$or

Returns true if at least one of the provided conditions is true, otherwise false is returned.

Syntax

$or[Conditions;...]

Parameters

  • Conditions (Type: String || Flag: Required): The condition to check. Separate conditions using ;.

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.

Example

$nomention
$or[$nickname==MineBartekSA;$message==Update]
!example Update true !example false !example true !example Update true

$parentID

Returns the current channel’s parent category ID.

Syntax

$parentID

Example

$nomention
Current category: $parentID

example

$parentID[]

Returns the parent category ID for the given channel ID.

Syntax

$parentID[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel from which to retrieve the category ID.

Example

$nomention
Category ID: $parentID[$mentionedChannels[1]]

example

$ping

Returns the ping of the bot’s node, in milliseconds.

Syntax

$ping

Example

$nomention
Pong! `$pingms`

example

$pinMessage

Pins the bot’s response message in the current channel.

⚠️ A channel can have a maximum of 50 pinned messages.

Syntax

$pinMessage

Example

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

example

$pinMessage[]

Pins a specific message using its channel and message ID.

⚠️ A channel can have a maximum of 50 pinned messages.

Syntax

$pinMessage[Channel ID;Message ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of the channel where the message is located.
  • Message ID (Type: Snowflake || Flag: Required): The ID of the message to pin.

Example

$nomention
$pinMessage[$channelID;$messageID]
I have pinned your message!

example

$premiumExpireTime

Returns how long until premium expires.

🧙‍♂️ Returns “expired” if the bot is not premium.

Syntax

$premiumExpireTime[(Unix timestamp)]

Parameters

  • Unix timestamp (Type: Bool || Flag: Optional): If “yes” is written, it will return the premium expiration value in UNIX timestamp and if “no”, it will output as normal time format. Defaults to “no”.

Example

When no premium

$nomention
My premium expires in: $premiumExpireTime

example

When premium

$nomention
My premium expires in: $premiumExpireTime (UNIX Timestamp : $premiumExpireTime[yes])

example

$publishMessage

Publishes a message from an announcement channel to all following servers.

Syntax

$publishMessage[channel ID;message ID]

Parameters

  • channel ID (Type: Snowflake || Flag: Required): The channel where the message is.
  • message ID (Type: Snowflake || Flag: Required): The message which will be published.

Example

$nomention
$publishMessage[$mentionedChannels[1;no];$noMentionMessage]
Message has been published!

Screenshot_20221023_010339 Screenshot_20221023_004859

$random

Returns a random number between 0 and 9.

Syntax

$random

Example

$nomention
The random number is **$random**!

example

$random[]

Returns a random number between ‘minimum’ and ‘maximum’.

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

Syntax

$random[minimum;maximum]

Parameters

  • minimum (Type: Integer, Float || Flag: Required): The minimum value.
  • maximum (Type: Integer, Float || Flag: Required): The maximum value.

Example

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

example

$randomCategoryID

Returns a random category ID from the current server or from the provided server.

Syntax

$randomCategoryID[(Guild ID)]

Parameters

  • Guild ID (Type: Snowflake || Flag: Optional): The server from which to get a random category ID. (Defaults to the current server)

Example

$nomention
Random Category: $channelName[$randomCategoryID[]]
!example Random Category: BDFD

$randomChannelID

Returns a random channel ID from the current server.

Syntax

$randomChannelID

Example

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

example

$randomGuildID

Returns a random guild ID from servers the bot is in.

Syntax

$randomGuildID

Example

$nomention
Random Guild: $serverName[$randomGuildID]
!example Random Guild: Bot Designer for Discord Official Server

$randomMention

Returns a random mention of a user from the current server.

Syntax

$randomMention

Example

$nomention
Random User: $randomMention

example

$randomRoleID

Returns a random role ID from the current server or from the provided server.

Syntax

$randomRoleID[(Guild ID)]

Parameters

  • Guild ID (Type: Snowflake || Flag: Optional): The server from which to get a random role ID. (Defaults to the current server)

Example

$nomention
Random Role: $roleName[$randomRoleID[]]
!example Random Role: Owner

It can return the @everyone role ID!

!example Random Role: everyone

$randomString

Generates a random combination of letters/numbers.

Syntax

$randomString[Length]

Parameters

  • Length (Type: Integer || Flag: Required): How long the string should be (max 10).

Example

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

example

$randomText

Picks one value from the provided values randomly.

Syntax

$randomText[Text;...]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to choose from. Separate different texts with ;.

Example

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

example

$randomUser

Returns a random username from the current server.

Syntax

$randomUser

Example

$nomention
Random Username: $randomUser

example

$randomUserID

Returns a random user ID from the current server.

Syntax

$randomUserID

Example

$nomention
Random User ID: $randomUserID

example

$registerGuildCommands

Registers all guild slash commands in the current guild.

Syntax

$registerGuildCommands

Example

$nomention
$registerGuildCommands
Successfully registered all guild slash commands!

example

$registerGuildCommands[]

Registers provided guild slash commands in the current guild.

📝 Slash commands doesn’t need to be enabled or marked as guild command.

Syntax

$registerGuildCommands[Slash command name;...]

Parameters

  • Slash command name (Type: String || Flag: Required): Name of the guild slash command to register. Use semicolons ; as a separator to separate multiple guild slash command names.

Examples

Example #1:

$nomention
$registerGuildCommands[help]
Successfully registered the guild slash command `/help`!

example1

Example #2:

$nomention
$argsCheck[>1;Provide guild slash command names!]

$unregisterGuildCommands[$unescape[$toLowercase[$replaceText[$trimSpace[$message]; ;]]]]
Successfully registered the provided guild slash commands!

example2

$removeAllComponents

Removes all components from the current message.

Note : Components are buttons and select menus.

Syntax

$removeAllComponents

$removeAllComponents[]

Removes all components from a message.

Note : Components are buttons and select menus.

Syntax

$removeAllComponents[Message ID]

Parameters

  • Message ID (Type: Snowflake || Flag: Required): The message from which all components will be removed.

Example

$nomention
$removeAllComponents[1093603455320457307]

Note : When providing “Message ID”, make sure the message author is the bot.

$removeButtons

Removes all buttons from the current message.

Syntax

$removeButtons

For more info, see the Buttons Guide.

$removeButtons[]

Removes all buttons from a message.

Syntax

$removeButtons[Message ID]

Parameters

  • Message ID (Type: Snowflake || Flag: Required): The message from which all buttons will be removed.

📝 When providing “Message ID”, make sure the message author is the bot.

Example

$nomention
$removeButtons[$message[1]]
Successfully removed all buttons from the message.

example example

For more info, see the Buttons Guide.

$removeComponent

Removes a certain component from a message.

Syntax

$removeComponent[Custom ID;(Message ID)]

Parameters

  • Custom ID (Type: String || Flag: Required): The select-menu/button custom ID to remove from the message.
  • Message ID (Type: Snowflake || Flag: Vacantable): The message to remove the component from, uses the bot’s current message if no Message ID is provided.

$removeContains

Removes messages that contains provided words. Removes up to the given Amount of latest messages.

Syntax

$removeContains[Word;...;Amount]

Parameters

  • Word (Type: String || Flag: Emptiable): The words/phrases to delete. Use semicolons ; as a separator to separate multiple words/phrases.
  • Amount (Type: Integer || Flag: Required): The number of messages containing given words to delete (Max is 100).

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!

$removeEmoji

Removes the given emoji from the server.

Syntax

$removeEmoji[Emoji ID]

Parameters

  • Emoji ID (Type: Snowflake || Flag: Required): The ID of the emoji which will be removed from the server.

Example

$nomention
$removeEmoji[$message[1]]
Successfully removed the emoji.

example1
example2

How to get emoji ID?

This method requires Developer Mode to be enabled!

  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. Remove <:emojiName:/<a:emojiName: and > to leave just the Discord emoji ID. (e.g. <:hollyDab:828628880629825546> -> 828628880629825546)
  5. Input the Discord emoji ID into $removeEmoji[]. (e.g. $removeEmoji[828628880629825546])

example3

$removeLinks

Removes all links from the bot’s reply.

Syntax

$removeLinks

Example

$nomention
$removeLinks
A cool link: https://botdesignerdiscord.com/

image

$nomention
A cool link: https://botdesignerdiscord.com/

example

$removeLinks[]

Removes all links from the provided text.

Syntax

$removeLinks[text]

Parameters

  • text (Type: String || Flag: Emptiable): The text from which all links will be removed.

Example

$nomention
$removeLinks[$noMentionMessage]

example

$removeSplitTextElement

Removes a certain element from the $textSplit[] values.

🧙‍♂️ This function is unneeded, if $textSplit[] isn’t present in the code.

Syntax

$removeSplitTextElement[Index]

Parameters

  • Index (Type: Integer || Flag: Required): The index of the $textSplit[] value to remove.

For more info, see the Text Splitting Guide.

$repeatMessage

Repeats the provided text a certain amount of times.

Syntax

$repeatMessage[Amount;Message]

Parameters

  • Amount (Type: Integer || Flag: Required): The number of times to repeat the given text (max 10 times).
  • Message (Type: String || Flag: Emptiable): 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 ‘Amount’.

Syntax

$replaceText[Text;Sample;New;(Amount)]

Parameters

  • Text (Type: String || Flag: Emptiable): The text where the bot is searching for the ‘Sample’.
  • Sample (Type: String || Flag: Emptiable): The text to replace with ‘New’.
  • New (Type: String || Flag: Emptiable): The text to replace ‘Sample’ with.
  • Amount (Type: Integer || Flag: Optional): The number of times, at most, the bot should replace the sample. Use -1 to replace all ‘Sample’ in ‘Text’ with ‘New’.

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!

$repliedMessageID

Returns the ID of the replied message.

📌 If the message is not a reply, no response will be returned.

Syntax

$repliedMessageID

Example

$nomention
The message ID you replied to is: $repliedMessageID

example

$repliedMessageID[]

Returns the ID of the replied message form the given message.

Syntax

$repliedMessageID[Channel ID;Message ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel where the message is located.
  • Message ID (Type: Snowflake || Flag: Required): The message from which the ID of the replied message will be taken from.

Example

$nomention
The message ID you replied to is: $repliedMessageID[$channelID;$messageID]

example

$reply

Replies to the author’s message.

Syntax

$reply

Example

$nomention
$reply
$allowUserMentions[]
Hello $displayName 👋🏻

image

$reply[]

Replies to a provided message.

Syntax

$reply[Channel ID;Message ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel where the message is.
  • Message ID (Type: Snowflake || Flag: Required): The message to reply.

Example

$nomention
$reply[$mentionedChannels[1];$noMentionMessage]
Replied!

image

$replyIn

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

Syntax

$replyIn[Time]

Parameters

  • Time (Type: Duration || Flag: Required): How long the command is delayed for (e.g: 10s, 10m, 40m). (max is 40 minutes (120 minutes for premium users), min is 1 second)

Example

The bot replies after 3 seconds of the command execution.

$nomention
$replyIn[3s]
Hi $displayName!

example

$resetChannelVar

Resets a channel variable back to its default value (the one provided in the app) for every channel in every server.

🧙‍♂️ Use this function wisely!

Syntax

$resetChannelVar[Variable name]

Parameters

  • Variable name (Type: String || Flag: Required): The name of the variable to reset.

$resetServerVar

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

🧙‍♂️ Use this function wisely!

Syntax

$resetServerVar[Variable name]

Parameters

  • Variable name (Type: String || Flag: Required): The name of the variable to reset.

$resetUserVar

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

🧙‍♂️ Use this function wisely!

Syntax

$resetUserVar[Variable name;(User ID)]

Parameters

  • Variable name (Type: String || Flag: Required): The name of the variable to reset.
  • User ID (Type: Snowflake || Flag: Optional): The user to reset the variable for. If no user is provided, the variable will be reset for everyone.

$roleCount

Returns how many roles are in the current server.

Syntax

$roleCount

Example

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

example

$roleExists

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

🧙‍♂️ “true” means the role exists, “false” means it doesn’t.

Syntax

$roleExists[Role ID]

Parameters

  • Role ID (Type: Snowflake, String || Flag: Emptiable): The role to check for.

Examples

Example #1

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

example1

Example #2

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

example2

$roleGrant

Adds or removes roles from the provided user.

Syntax

$roleGrant[User ID;+/-Role ID;...]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to grant roles to.
  • Role ID (Type: Snowflake || Flag: Required): The role to add or remove. Prepend + (to add it) or - (to remove it) to the role ID. Use semicolons ; as a separator to separate multiple role IDs.

Examples

Example #1

$nomention
$roleGrant[3869969062509936;-9368562753613496]

Example #2

$nomention
$roleGrant[$mentioned[1];+$mentionedRoles[1]]
<@$mentioned[1]> user was given <@&$mentionedRoles[1]> role

example2

$roleID

Returns a role’s ID using its name.

Syntax

$roleID[Role name]

Parameters

  • Role name (Type: String || Flag: Required): The name of the role for which to get its ID.

Example

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

example

$roleInfo

Returns information about the mentioned role. $roleInfo allows you to create a role info command without using a bunch of different functions at once.

Syntax

$roleInfo[Message]

Parameters

  • Message (Type: String || Flag: Required): The message format. Check below for more information.

Message format

You can use the following “commands” within $roleInfo[]:

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

🧙‍♂️ $roleInfo[] automatically generates a description. So, $description[] should not be used in the code.

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 using its ID.

Syntax

$roleName[Role ID]

Parameters

  • Role ID (Type: Snowflake || Flag: Required): The role for which to get its name.

Example

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

example

$roleNames

Returns the name of every role in the current server.

Syntax

$roleNames

Example

$nomention
$description[Server Roles: $roleNames]

example

$rolePosition

Returns a role’s position (1 being the highest role).

Syntax

$rolePosition[Role ID]

Parameters

  • Role ID (Type: Snowflake || Flag: Required): The role for which to get its position.

Example

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

example

$round

Rounds up the provided number.

Syntax

$round[Number;(Decimal place)]

Parameters

  • Number (Type: Float || Flag: Required): The number to round.
  • Decimal place (Type: Integer || Flag: Vacantable): The number of decimal places to round the number to. Defaults to 0.

Example

$nomention
$round[100.123;1]

example

$scriptLanguage

Returns the name of scripting language used by the command.

Syntax

$scriptLanguage

Example

$nomention
This command uses `$scriptLanguage`.

Note: After each execution of the command, we changed the script to another one.

Output value

  • BDScript
  • BDScript 2
  • BDScript Unstable

$second

Returns the current second of this minute.

🧙‍♂️ You can use $time to change the timezone.

Syntax

$second

Example

$nomention
Current Second: $second

example

$sendEmbedMessage

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

Syntax

$sendEmbedMessage[Channel ID;Content;(Title;Title URL;Description;Color;Author;Author icon;Footer;Footer icon;Thumbnail;Image;Add timestamp?;Return ID?)]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of the channel where the message will be sent to.
  • Content (Type: String || Flag: Emptiable): The text that is shown above the embed.
  • Title (Type: String || Flag: Vacantable): The text that will be used as the title.
  • Title URL (Type: URL || Flag: Vacantable): The URL that will be applied to the title.
  • Description (Type: String || Flag: Vacantable): The description that will be applied to the embed.
  • Color (Type: Color || Flag: Vacantable): The color hex or integer to set the embed border color as.
  • Author (Type: String || Flag: Vacantable ): The text that appears at the author.
  • Author icon (Type: URL || Flag: Vacantable): The image that appears next to the author. Must be a valid image URL.
  • Footer (Type: String || Flag: Vacantable): The text to set the footer as.
  • Footer icon (Type: URL || Flag: Vacantable): The image that appears next to the footer. Must be a valid image URL.
  • Thumbnail (Type: URL || Flag: Vacantable): The image to set as the thumbnail.
  • Image (Type: URL || Flag: Vacantable): The image that appears above the footer. Must be a valid image URL.
  • Add timestamp? (Type: Bool || Flag: Vacantable): Adds a timestamp to the footer (use yes or no).
  • Return ID? (Type: Bool || Flag: Vacantable): Outputs the message ID outside the embed (use yes or no).

Example

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

image

$sendMessage

Sends a new message to the current channel.

Syntax

$sendMessage[Text;(Return message ID?)]

Parameters

  • Text (Type: String || Flag: Required): The text to send in the new message.
  • Return message ID? (Type: Bool || Flag: Optional): Whether to return the ID of the newly sent message, in another message. Defaults to 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 current server.

Syntax

$serverChannelExists[Channel ID]

Parameters

  • Channel ID (Type: Snowflake, String || Flag: Emptiable): Returns “true” if the channel exists, otherwise “false” is returned.

Example

$nomention
$serverChannelExists[$message[1]]

example

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

Syntax

$serverCooldown[Duration;Error message]

Parameters

  • Duration (Type: Duration || Flag: Required): The duration of this cooldown.
  • Error message (Type: String || Flag: Emptiable): 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 Error message.

$serverCount

Returns how many servers the bot is in.

Syntax

$serverCount

Example

$nomention
I'm currently in $serverCount servers!

example

Can be used in bot status

$serverDescription

Returns server description. Returns an empty result if the server has no description.

Syntax

$serverDescription

Example

$nomention
Hey, this server has a great description: $serverDescription

Example

$serverDescription[]

Returns the server’s description of provided guild ID. Returns an empty result if the server has no description.

Syntax

$serverDescription[Guild ID]

Parameters

  • Guild ID (Type: Snowflake || Flag: Required): The server from which to get the description.

Example

$nomention
Server description: $serverDescription[$message[1]]

example

$serverEmojis

Returns all emojis of the provided guild.

Syntax

$serverEmojis[Guild ID;Separator]

Parameters

  • Guild ID (Type: Snowflake || Flag: Required): The guild from which to return emojis.
  • Separator (Type: String || Flag: Emptiable): The separator to separate the emojis with.

Example

$nomention
$serverEmojis[$guildID; ]

example

$serverIcon

Returns the current server’s icon.

Syntax

$serverIcon

Example

$nomention
$image[$serverIcon]

example

$serverIcon[]

Returns server icon for the given server ID.

Syntax

$serverIcon[Server ID]

Parameters

  • Server ID (Type: Snowflake || Flag: Required): The server from which to get the icon.

Example

$nomention
$image[$serverIcon[566363823137882154]]

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.

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

Syntax

$serverInfo[Message;(Thumbnail?)]

Parameters

  • Message (Type: String || Flag: Required): The message format. Check below for more information.
  • Thumbnail? (Type: Bool || Flag: Optional): Whether or not to show the server icon as the thumbnail. The default is yes.

Subset-Functions

You can use the following “subset-functions” within $serverInfo[]:

  • {name} - Returns the server’s name.
  • {region} - Returns the server’s region.
  • {emoji} - Returns the server’s emojis in a list.
  • {owner} - Returns the server owner’s username.
  • {ID} - Returns the server’s ID.
  • {verificationLvl} - Returns the server’s verification level.
  • {large} - Finds out if the server is considered “large”. Returns true or false.

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

Creates a server leaderboard (top-10).

🧙‍♂️ $serverLeaderboard automatically generates a description. So, $description should not be used in the code.

Syntax

$serverLeaderboard[Variable name;(Sort type)]

Parameters

  • Variable name (Type: String || Flag: Required): The variable to create the leaderboard for.
  • Sort type (Type: Enum || Flag: Optional): The sort type of the values (default is desc). Sort types:
    • asc - Sorts the values in ascending order.
    • desc - Sorts the values in descending order.

$serverName

Returns a server’s name.

Syntax

$serverName[Guild ID]

Parameters

  • Guild ID (Type: Snowflake || Flag: Required): The server to get the name of. Use $guildID for the current server.

🧙‍♂️ The bot must be present in the server to return its name.

Example

$nomention
Server Name: $serverName[$guildID]

example

$serverNames

Returns 10 server names in which the bot is in.

Syntax

$serverNames

Example

$nomention
$serverNames
!example Bot Designer for Discord Official Server, B. Support, Bot Designer List, BDFD Appeals Server, Synthexia, Roblox, Minecraft, Discord Developers, Discord API, BDFD Development

$serverNames[]

Returns x server names in which the bot is in.

Syntax

$serverNames[Amount;Separator]

Parameters

  • Amount (Type: Integer || Flag: Required): The amount of server names you want. Use -1 if you want to return all server names.
  • Separator (Type: String || Flag: Emptiable): A custom separator for separating the server names.

Example

$nomention
$serverNames[3;
]

example

$serverOwner

Returns the ID of the current server’s owner.

Syntax

$serverOwner

Example

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

$serverOwner[]

Returns the ID of the provided server’s owner.

Syntax

$serverOwner[Guild ID]

Parameters

  • Guild ID (Type: Snowflake || Flag: Required): The server to get the owner ID for.

The bot must be present in the server in order to get the server owner ID.

Example

$nomention
This server is owned by <@$serverOwner[$guildID]>!
!example This server is owned by RainbowKey!

$serverRegion

(deprecated)

This function is deprecated, because Discord removed the server region setting. For more information, click here.

Returns the server’s region.

Syntax

$serverRegion

Example

$nomention
Server Region: $serverRegion
!example Server Region: europe

$serverVerificationLvl

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

Syntax

$serverVerificationLvl

Example

$nomention
This server's verification level is $serverVerificationLvl
!example This server's verification level is Low

$setChannelVar

Updates a variable’s value for a channel.

Syntax

$setChannelVar[Variable name;New value;(Channel ID)]

Parameters

  • Variable name (Type: String || Flag: Required): The variable to update.
  • New value (Type: String || Flag: Emptiable): The new variable value.
  • Channel ID (Type: Snowflake || Flag: Optional): The channel to assign the new value to. If no “Channel ID” is present, the current channel will be used.

📝 Channel variable values have a max character limit of 499 (for premium users, it’s 4999).

For more info, see the Variables Guide.

$setServerVar

Updates a variable’s value for a server.

Syntax

$setServerVar[Variable name;New value;(Server ID)]

Parameters

  • Variable name (Type: String || Flag: Required): The variable to update.
  • New value (Type: String || Flag: Emptiable): The new variable value.
  • Server ID (Type: Snowflake || Flag: Optional): The server to assign the new value to. Uses the current server if no “Server ID” is provided.

📝 Server variable values have a max character limit of 499 (for premium users, it’s 4999).

For more info, see the Variables Guide.

$setUserVar

Updates a variable’s value for a user.

Syntax

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

Parameters

  • Variable name (Type: String || Flag: Required): The variable to update.
  • New value (Type: String || Flag: Emptiable): The new variable value.
  • User ID (Type: Snowflake || Flag: Optional): The user to assign the new value to. Uses the author if no “User ID” is provided.
  • Guild ID (Type: Snowflake || Flag: Optional): The guild to assign the new value to. Uses the current guild if no “Guild ID” is provided.

📝 User variable values have a max character limit of 4999.

For more info, see the Variables Guide.

$setVar

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

Syntax

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

Parameters

  • Variable name (Type: String || Flag: Required): The variable to update.
  • New value (Type: String || Flag: Emptiable): The new variable value.
  • User ID (Type: Snowflake || Flag: Optional): The user to globally assign the new value to. Sets the variable type as global-user, if “User ID” is present.

📝 Global variable values have a max character limit of 499 (for premium users, it’s 4999).

For more info, see the Variables Guide.

$shardID

Returns the shard ID of the current guild.

Syntax

$shardID

Example

$nomention
$shardID

example

$shardID[]

Returns the shard ID of the provided guild.

Syntax

$shardID[guild ID]

Parameters

  • guild ID (Type: Snowflake || Flag: Required): The guild to get it’s shard ID.

$slashCommandsCount

Returns the number of slash commands the bot has enabled.

Syntax

$slashCommandsCount

Example

$nomention
I have $slashCommandsCount slash commands!

example

$slashID

Returns ID of the executed slash command.

Syntax

$slashID

Example

$nomention
ID of this slash command: $slashID

Without

$slashID[]

Returns ID of the provided slash command.

Syntax

$slashID[Slash command name]

Parameters

  • Slash command name (Type: String || Flag: Required): Name of the global slash command.

Example

$nomention
ID of `$message` slash command: $slashID[$message]

With

$slowmode

Sets a slowmode for the provided channel.

With slowmode enabled in a channel, it will 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.

Syntax

$slowmode[Channel ID;Slowmode time]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel in which the slowmode is being modified in.

  • Slowmode time (Type: Duration || Flag: Required): The new slowmode delay (e.g. 5, 10s, 40m, 1h, etc). Use 0/0s to disable the slowmode.

    🧙‍♂️ Slowmode time can’t be set over 6 hours/21600 seconds.

Permissions

Required permissions that the bot must have for this function to work properly:

  • managechannels

Example

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

example

$sort

Sorts the provided numbers.

Syntax

$sort[Numbers;...;Direction;Return amount;Separator]

Parameters

  • Numbers (Type: Float, Integer || Flag: Required): The numbers to sort. Use semicolons ; as a separator to separate multiple numbers.
  • Direction (Type: Enum || Flag : Required): The direction in which to sort. Direction types:
    • asc - Sorts the numbers in ascending order.
    • desc - Sorts the numbers in descending order.
  • Return amount (Type: Integer || Flag: Required): How many numbers will be returned. Use -1 to return all numbers.
  • Separator (Type: String || Flag: Required): The separator between each number.

Example

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

example

$splitText

Retrieves a value from $textSplit[].

⚠️ This function is used with $textSplit[].

Syntax

$splitText[Index]

Parameters

  • Index (Type: HowMany || Flag: Required): The split value to get (e.g. 2 for the second split). You can also use > to return the last split value i.e $splitText[>].

Example

$nomention
$textSplit[Hi-Hello-Hey;-]
$splitText[2]

The above example will return output as Hello.

For more info, see the Text Splitting Guide.

$startThread

Creates a new thread in the provided channel.

Syntax

$startThread[Name;Channel ID;Message ID;(Archive duration;Return thread/channel ID)]

Parameters

  • Name (Type: String || Flag: Required): The name of the newly created thread.
  • Channel ID (Type: Snowflake || Flag: Required): The channel where the thread will be created.
  • Message ID (Type: Snowflake || Flag: Emptiable): The message from which the thread will be created. Can be left empty.
  • Archive duration (Type: Integer || Flag: Optional): The duration after which the thread will be auto-archived due to inactivity. Accepts 60 (1 hour), 1440 (1 day), 4320 (3 days), or 10080 (7 days) as input. Defaults to 60.
  • Return thread/channel ID (Type: Bool || Flag: Optional): Whether to return the thread channel ID or not. Defaults to no.

Permissions

Required permissions that the bot must have for this function to work properly:

  • createpublicthreads

Example

$nomention
I created a new thread! <#$startThread[Cool Thread;$channelID;;1440;yes]>

example

$sub

Returns the subtraction of the provided numbers.

Syntax

$sub[Number;...]

Parameters

  • Number (Type: Integer, Float || Flag: Required): The numbers to subtract. Separate multiple values using ;.

Example

$nomention
$sub[20;10;5]

example

$sum

Returns the addition of the provided numbers.

Syntax

$sum[Number;...]

Parameters

  • Number (Type: Integer, Float || Flag: Required): The numbers to add. Separate multiple values using ;.

Example

$nomention
$sum[5;5;5]

example

$suppressErrors

Blocks sending any error messages whenever an error occurs.

Syntax

$suppressErrors

Example

$nomention
$suppressErrors
$argsCheck[>1;Usage : ` !command <math expression> `]
$calculate[$message]

example

$suppressErrors[]

Blocks sending any error messages whenever an error occurs and sends the provided custom error instead.

Syntax

$suppressErrors[Error message]

Parameters

  • Error message (Type: String || Flag: Emptiable): The custom error message to send.

Example

$nomention
$suppressErrors[**Error** : ` Invalid math expression! `]
$argsCheck[>1;Usage : ` !command <math expression> `]
$calculate[$message]

example

$takeRole

(deprecated)

📌 As of December 2021, this function has been deprecated in favor of $roleGrant[].

📌 In order to remove a role from a user, the bot must have the manageroles permission.

Removes a role from the provided/mentioned user.

Syntax

$takeRole[User/Role ID;(Role ID)]

Parameters

  • User/Role ID (Type: Snowflake || Flag: Required): The user to remove the specified role from or the role to remove from the mentioned users. If only this parameter is provided, it will be read as “Role ID”.
  • Role ID (Type: Snowflake || Flag: Optional): The role to remove from the user. If this parameter is used, it reads the first parameter as “User ID”.

Examples

Example #1

$nomention
$allowRoleMentions[]

$takeRole[$mentionedRoles[1]]
Removed <@&$mentionedRoles[1]> from the mentioned users!

example1

Example #2

$nomention
$allowMention
$allowRoleMentions[]

$takeRole[$message[1];$mentionedRoles[1]]
Removed the role <@&$mentionedRoles[1]> from <@$message[1]>!

example2
example2

$textSplit

Splits the provided text by a given separator and saves the value temporarily.

📌 To retrieve the split values, use $splitText.

Syntax

$textSplit[Text;Separator]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to split.
  • Separator (Type: String || Flag: Emptiable): The separator to split the text with. If this parameter is empty, it separates the text by each character.

Example

$nomention
$textSplit[Coffee, Tea, Milk;,]
$splitText[1]

Screenshot_20221029_203537

In the above example, $textSplit splits the provided text using a comma (,) as the separator. After that, $splitText is used to retrieve the first split value.

$threadAddMember

Adds a user to a thread.

Syntax

$threadAddMember[Thread ID;User ID]

Parameters

  • Thread ID (Type: Snowflake || Flag: Required): The ID of the thread channel to add the user to.
  • User ID (Type: Snowflake || Flag: Required): The user to add to the thread.

Example

$nomention
$var[thread;$startThread[Cool Thread;$channelID;;60;yes]]
$threadAddMember[$var[thread];$authorID]

example1
example2

$threadRemoveMember

Removes a user from a thread.

Syntax

$threadRemoveMember[Thread ID;User ID]

Parameters

  • Thread ID (Type: Snowflake || Flag: Required): The ID of the thread channel to remove the user from.
  • User ID (Type: Snowflake || Flag: Required): The user to remove from the thread.

Example

$nomention
$threadRemoveMember[878305123707785218;$authorID]

example

$thumbnail

Adds an embedded thumbnail to the bot’s response message.

Syntax

$thumbnail[Image URL;(Index)]

Parameters

  • Image URL (Type: URL || Flag: Emptiable): The image to set as the thumbnail.
  • Index (Type: Integer || Flag: Optional): What embed index the thumbnail should belong to, default to 1.

Permissions

Required permissions that the bot must have for this function to work properly:

  • sendmessages
  • sendmessagesinthreads
  • embedlinks

Example

$nomention
$description[This is the thumbnail ↘️]
$thumbnail[$authorAvatar]

example

$time

Changes the timezone for date/time functions.

Syntax

$time[Timezone]

Parameters

  • Timezone (Type: String || Flag: Required): The timezone to use in the date/time functions. Accepts TZ database timezone name as input.

Example

$nomention

$time[America/New_York]
New York : $hour:$minute:$second

$time[Europe/Warsaw]
Warsaw : $optOff[$hour:$minute:$second]

Screenshot_20221029_234758

$timeout

Timeouts a user for a certain duration.

Syntax

$timeout[Duration;(User ID)]

Parameters

  • Duration (Type: Duration || Flag: Required): The amount of time the user should be timed out for. It shouldn’t exceed more than “28 days”.
  • User ID (Type: Snowflake || Flag: Optional): The user to timeout. If this parameter is empty, timeouts the mentioned users.

Permissions

Required permissions that the bot must have for this function to work properly:

  • moderatemembers

Examples

  • Without ID

    $nomention
    $timeout[$message[1]]
    

  • With ID

    $nomention
    $allowMention
    $timeout[$message[1];$findUser[$message[2];no]]
    

$title

Adds an embedded title to bot’s response message.

Syntax

$title[Text;(Index)]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to set the title as. It cannot exceed more than 256 characters.
  • Index (Type: Integer || Flag: Optional): What embed index the title should belong to, defaults to 1.

Permissions

Required permissions that the bot must have for this function to work properly:

  • sendmessages
  • sendmessagesinthreads
  • embedlinks

Example

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

example

$toLowercase

Converts the provided text to lowercase format.

Syntax

$toLowercase[Text]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to convert.

Example

$nomention
$toLowercase[$message]
!example BOT DESIGNER For discord bot designer for discord

$toTitleCase

Converts the first letter of each word to uppercase in the provided text.

Syntax

$toTitleCase[Text]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to convert.

Example

$nomention
$toTitleCase[$message]
!example bot designer for discord Bot Designer For Discord

$toUppercase

Converts the provided text to uppercase format.

Syntax

$toUppercase[Text]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to convert.

Example

$nomention
$toUppercase[$message]
!example bot designeR FOR DISCORD BOT DESIGNER FOR DISCORD

$trimContent

Removes duplicate spaces from incoming message content.

Syntax

$trimContent

Example

$nomention
$trimContent

1. $message[1]
2. $message[2]
3. $message[3]

Example

📌 Removing $trimContent from the above code would result in the following output :

Remove

$trimSpace

Removes all leading and trailing white-space characters from the provided text.

Syntax

$trimSpace[Text]

Parameters

  • Text (Type: String || Flag: Emptiable): The text from which white-space characters will be removed.

Example

$nomention
>$trimSpace[        Hi
        ]<
!example >Hi<

$tts

Enables Text-to-Speech (TTS) functionality on the bot’s response message.

📌 The TTS feature is currently supported only in Discord Desktop and Webapp.

Syntax

$tts

Permissions

Required permissions that the bot must have for this function to work properly:

  • tts

Example

$nomention
$tts
Hello! Can you hear me?

$unban

Unbans a user by providing their username in the author’s message.

Syntax

$unban

Permissions

Required permissions that the bot must have for this function to work properly :

  • ban

Example

$nomention
$unban
Successfully unbanned user!

example
example2

$unbanID

Unbans a user by using their ID taken from the last argument of the author’s message.

Syntax

$unbanID

Permissions

Required permissions that the bot must have for this function to work properly :

  • ban

Example

$nomention
$unbanID
Successfully unbanned user!

example

$unbanID[]

Unbans a user by using their ID.

Syntax

$unbanID[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The ID of the user to unban.

Permissions

Required permissions that the bot must have for this function to work properly :

  • ban

Example

$nomention
$unbanID[$message[1]]
Successfully unbanned user!

example

$unescape

Unescapes semicolons ; from the provided text. It allows interpreting of escaped semicolons as unescaped ones.

Syntax

$unescape[Text]

Parameters

  • Text (Type: String || Flag: Emptiable): The text to unescape.

Example

$nomention
$randomText[$unescape[$message]]
!example a;b;c b

$unmute

(deprecated)

📌 As of December 2021, this function has been deprecated in favor of $untimeout[].

Unmutes the mentioned user.

Syntax

$unmute[Muted]

Parameters

  • Muted (Type: String || Flag: Required): The name of the “Muted” role (case sensitive).

Permissions

Required permissions that the bot must have for this function to work properly:

  • manageroles

Example

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

example

$unpinMessage

Unpins a pinned message from the channel.

Syntax

$unpinMessage[Channel ID;Message ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel where the message is located.
  • Message ID (Type: Snowflake || Flag: Required): The ID of the message to unpin.

Permissions

Required permissions that the bot must have for this function to work properly :

  • managemessages

Example

$nomention
$unpinMessage[$mentionedChannels[1];$noMentionMessage]
A message has been unpinned!

Screenshot_20220925_163311
InShot_20220925_163609635

$unregisterGuildCommands

Unregisters all guild slash commands from the current guild.

Syntax

$unregisterGuildCommands

Example

$nomention
$unregisterGuildCommands
Successfully unregistered all guild slash commands!

example

$unregisterGuildCommands[]

Unregisters provided guild slash commands from the current guild.

Syntax

$unregisterGuildCommands[Slash command name;...]

Parameters

  • Slash command name (Type: String || Flag: Required): Name of the guild slash command to unregister. Use semicolons ; as a separator to separate multiple guild slash command names.

Example

$nomention
$argsCheck[>1;Provide guild slash command names!]

$unregisterGuildCommands[$unescape[$toLowercase[$replaceText[$trimSpace[$message]; ;]]]]
Successfully unregistered the provided guild slash commands!

example

$untimeout

Untimeouts a timed out user.

Syntax

$untimeout[(User ID)]

Parameters

  • User ID (Type: Snowflake || Flag: Optional): The ID of the user to untimeout. If this parameter is empty, untimeouts the mentioned users.

Permissions

Required permissions that the bot must have for this function to work properly :

  • moderatemembers

Example

  • Without ID

    $nomention
    $untimeout[]
    

  • With ID

    $nomention
    $allowMention
    $untimeout[$findUser[$message[1];no]]
    

$uptime

Returns how long the bot has been online.

Syntax

$uptime

Example

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

ex

$url

Encodes or decodes the provided text in the URL encoding format.

URL encoding is a method of converting reserved, unsafe, or non-ASCII characters to a URL format that is universally accepted and understood by all web browsers and servers while URL decoding is the vice-versa of URL encoding.

Syntax

$url[Mode;Text]

Parameters

  • Mode (Type: Enum || Flag: Required): Whether to encode or decode the provided text. Accepts either encode or decode as input.
  • Text (Type: String || Flag: Emptiable): The text to change.

Example

  • Encoding

    $nomention
    https://example.url/encode?convert=$url[encode;Hello world!!]
    

    example

  • Decoding

    $nomention
    $url[decode;https://example.url/decode?convert=Hello+world%21%21]
    

    example

$useChannel

Redirects the bot’s response message to a different channel.

📌 $useChannel cannot redirect the original slash command response.

Syntax

$useChannel[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of the channel to which the message will be redirected.

Example

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

ex1
ex2

$userAvatar

Returns a user’s avatar URL.

Syntax

$userAvatar[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to return the avatar for.

Example

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

example

📌 You can optionally append a query string ?size=VALUE at the end of the URL to increase the size of the avatar. The size’s value supports any power of two between 16 and 4096.

$userBadges

Returns a list of user badges separated by a space or the given separator.

Syntax

$userBadges[User ID;(Separator)]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to get the badges from.
  • Separator (Type: String || Flag: Optional): Will be used to separate each badge.
ReturnsName
staffDiscord Employee
partnerPartnered Server Owner
hype_squadHypeSquad Events Member
bug_hunter_level_1Bug Hunter Level 1
hype_squad_braveryHouse Bravery Member
hype_squad_brillianceHouse Brilliance Member
hype_squad_balanceHouse Balance Member
premium_early_supporterEarly Nitro Supporter
team_pseudo_userUser is a team
bug_hunter_level_2Bug Hunter Level 2
verified_botVerified Bot
verified_developerEarly Verified Bot Developer
certified_moderatorModerator Programs Alumni
bot_http_interactionsBot uses only HTTP interactions and is shown in the online member list
active_developerUser is an Active Developer

Example

$nomention
`$userBadges[$authorID;` `]`
!example main-chat hype_squad_balance partner

$userBanner

Returns user banner if the given user has one.

Syntax

$userBanner[user ID]

The function is unable to return the user’s server banner.

Parameters

  • user ID (Type: Snowflake || Flag: Required): The user to get the banner for.

Example

$nomention
$sendMessage[$userBanner[$findUser[$message]]?size=4096]

example

example

You can use ?size=size at the end of the banner URL to increase/decrease the image size. Example sizes: 1024, 2048, 4096. (e.g. $image[$userBanner[$findUser[$message]]?size=4096])

$userBannerColor

Returns the color of the given user banner. Returns an empty string if no banner color is set.

Syntax

$userBannerColor[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to get the banner color from.

Example

$nomention
#$userBannerColor[$authorID]
!example #32D167

example

$userExists

Checks if a user exists in Discord using thier ID. Returns “true” if the user exists, otherwise “false” is returned.

Syntax

$userExists[User ID]

Parameters

  • User ID (Type: String, Snowflake || Flag: Required): The ID of the user to check.

Example

$nomention
$userExists[$mentioned[1]]
!example Spen true

$userID

Fetches a user’s ID using their username or user-tag.

Syntax

$userID[Username#Discriminator / Username]

Parameters

  • Username#Discriminator / Username (Type: String || Flag: Emptiable): The user’s username or user-tag (User#0000) for whom to return the ID for.

Example

$nomention
$userID[$username]
!example 803569638084313098

$userInfo

Allows you to make a ‘user info’ command without using a bunch of different functions at once. Returns information of the first mentioned user.

📌 $userInfo automatically generates a description. So, $description of index 1 should be avoided in the code.

Syntax

$userInfo[Message]

Parameters

  • Message (Type: String || Flag: Required): The message format. Check below for more information.

    📌 Following are sub-functions which you can use inside $userInfo to return information of the mentioned user :

    • {username} : Returns the user’s username.
    • {ID} : Returns the ID of the user.
    • {BOT} : Returns “true” if the user is a bot otherwise, “false”.
    • {discriminator} : Returns the user’s discriminator.

Example

$nomention
$title[User Info]
$userInfo[Username: {username}
User ID: {ID}
Bot?: {BOT}
Discriminator: {discriminator}]

example

📌 $userInfo automatically generates a thumbnail of the mentioned user. If you want to remove it, put $thumbnail[] (with empty argument) below $userInfo function.

$userJoined

Returns the server joining date of a given user.

Syntax

$userJoined[User ID;(Format)]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user whose join date will be returned.

  • Format (Type: String || Flag: Optional): Customize the default time format output.

    📌 Click me to check all supported time format values.

Example

  • Default format
    $nomention
    $userJoined[$authorID]
    
!example 2022-08-16
  • Custom format
    $nomention
    $userJoined[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)]
    
!example August 16, 2022 at 8:39 AM (UTC +00:00)

$userJoinedDiscord

(deprecated)

📌 As of November 2022, this function has been deprecated in favor of $creationDate[].

📌 Besides user IDs, $userJoinedDiscord[] can also return the creation date of any valid Discord Snowflake ID.

Returns the account creation date of a given user.

Syntax

$userJoinedDiscord[User ID;(Format)]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user whose account creation date will be returned.
  • Format (Type: String || Flag: Optional): Customize the default time format output.

Example

  • Default format
    $nomention
    $userJoinedDiscord[$authorID]
    
!example 2021-01-26
  • Custom format
    $nomention
    $userJoinedDiscord[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)]
    
!example January 26, 2021 at 10:18 AM (UTC +00:00)

$userLeaderboard

Returns the top 10 users’ usernames and values for a given user variable.

📌 $userLeaderboard automatically generates a description. So, $description of index 1 should be avoided in the code.

Syntax

$userLeaderboard[Variable name;(Sort)]

Parameters

  • Variable name (Type: String || Flag: Required): The variable to create the leaderboard for.
  • Sort (Type: Enum || Flag: Optional): Sorts the leaderboard values in ascending (asc) or descending (desc) order. Defaults to desc.

Example

$nomention
$userLeaderboard[Money;asc]

Screenshot_20221023_113048

📌 Why is my leaderboard showing inaccurate values?
Leaderboard values are not updated in real-time. The previous values are cached for a short duration. It will take about 5 minutes to show the updated values.

$username

Returns the username of the author of the message.

Syntax

$username

Example

$nomention
Hello $username!
!echo Hello Spen!

$username[]

Returns the username for the provided user ID.

Syntax

$username[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to get the username for.

Example

$nomention
$username just hugged $username[$mentioned[1]]!

example

$userPerms

Returns a user’s permissions.

Syntax

$userPerms[User ID;Return amount;Separator]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user to get permissions for.
  • Return amount (Type: Integer || Flag: Required): The number of permissions to return. Use -1 to return all.
  • Separator (Type: String || Flag: Required): A text/character which is used for separating each permission.

Example

$nomention
$userPerms[$authorID;-1;, ]
!example CREATE_INSTANT_INVITE, ADMINISTRATOR, ADD_REACTIONS, STREAM, VIEW_CHANNEL, SEND_MESSAGES, EMBED_LINKS, ATTACH_FILES, READ_MESSAGE_HISTORY, MENTION_EVERYONE, USE_EXTERNAL_EMOJIS, CONNECT, SPEAK, USE_VAD, CHANGE_NICKNAME, USE_APPLICATION_COMMANDS, REQUEST_TO_SPEAK, CREATE_PUBLIC_THREADS, CREATE_PRIVATE_THREADS, USE_EXTERNAL_STICKERS, SEND_MESSAGES_IN_THREADS

$userReacted

Checks if a user reacted to a message with the provided emoji. Returns “true” if the user did react otherwise, “false”.

Syntax

$userReacted[Channel ID;Message ID;User ID;Emoji]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel where the message is located.
  • Message ID (Type: Snowflake || Flag: Required): The message to check the reactions for.
  • User ID (Type: Snowflake || Flag: Required): The user to check the reaction for.
  • Emoji (Type: Emoji || Flag: Required): The emoji of the reaction to check.

Example

$nomention
$userReacted[$channelID;$message;$authorID;🍀]

Screenshot_20221023_105811

$userRoles

Returns all role names given to the user.

Syntax

$userRoles[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user for whom to return the role names.

Example

$nomention
$description[<@$mentioned[1;yes]>'s roles: 
$userRoles[$mentioned[1;yes]]]

example

$userServerAvatar

Returns the URL for the server avatar of a given user.

Syntax

$userServerAvatar[User ID]

Parameters

  • User ID (Type: Snowflake || Flag: Required): The user from whom to get the server avatar. If the user doesn’t have a server avatar, then the default user avatar will be returned instead.

Example

$nomention
$image[$userServerAvatar[$authorID]?size=4096]

example

$var

Creates a temporary variable.

Unlike, it’s counterpart variables (i.e $setVar, $setUserVar etc.) which needs you to create a variable in the app, $var[] doesn’t require you to do that. Instead, it creates the variable automatically during it’s runtime and gets deleted once the command execution terminates.

The data stored in the temporary variable can only be retrieved during its execution period and is removed once it’s finished.

📌 This function can only be used in BDScript 2 script language.

Syntax

$var[Name;(Value)]

Parameters

  • Name (Type: String || Flag: Required): The name of the temporary variable.
  • Value (Type: String || Flag: Vacantable): The data to store

📌 To retrieve the temporary stored value, type $var[Name], where “Name” is the temporary variable name.

Example

$nomention
$argsCheck[>1;Type a message!]

$var[ID;$sendMessage[$toLowercase[$message];yes]]

$addButton[no;interactionID;Example;secondary;;;$var[ID]]

Example

$varExistError

Returns a custom error if a certain variable doesn’t exist in the app.

Syntax

$varExistError[Name;Error message]

Parameters

  • Name (Type: String || Flag: Required): The variable that should exist.
  • Error message (Type: String || Flag: Emptiable): The custom error message to return if the variable doesn’t exist.

Example

$nomention
$varExistError[Cool;Add the 'Cool' variable in the app.]
You are now cool!
!example Add the 'Cool' variable in the app. !example You are now cool!

$varExists

Checks if a variable exists. Returns true if it exists, otherwise false.

Syntax

$varExists[Name]

Parameters

  • Name (Type: String || Flag: Required): The variable’s name to check.

Example

$nomention
$varExists[$message]
!example Hi false !example Money true

$variablesCount

Returns how many of a certain variable type the bot has.

Syntax

$variablesCount[Type]

Parameters

  • Type (Type: Enum || Flag: Required): The variable type to return the count for. Accepts either user, server, channel, or globaluser as input.

Example

$nomention
$variablesCount[server]
!example 4

$year

Returns the current year.

📌 You can use $time to change the timezone.

Syntax

$year

Example

$nomention
Current Year: $year
!year Current Year: 2024

Callbacks

Callbacks in BDFD are functions for triggers which are executed when a certain action is performed. 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.

$awaitedCommand

Triggered when an awaited command gets initiated.

$awaitedCommand[] is a callback, which means it’s used in the command trigger (not the code). The command is ran when an awaited command gets initiated.

Syntax

$awaitedCommand[Name;(Filter)]

Parameters

  • Name (Type: String || Flag: Required): The name used in the $awaitFunc[] function.
  • Filter (Type: String || Flag: Optional): It is used to limit the user input.

Supported filters

  • <numeric> - Accepts only number input.
  • <word1/word2> - Accepts only specified words provided inside <>. Use / as a separator for multiple words.

Example

Without filter

Trigger: $awaitedCommand[say;]

$nomention
$message
!say What do you want me to say? I love BDFD! I love BDFD!

With choose filter

Trigger: $awaitedCommand[odd;<yes/no/cancel>]

$nomention
$if[$message==yes]
   Your answer is correct!
$elseif[$message==no]
   Your answer is incorrect!
$elseif[$message==cancel]
   Command cancelled!
$endif
!odd Is "19" an odd number? yes Your answer is correct! !odd Is "19" an odd number? no Your answer is incorrect! !odd Is "19" an odd number? cancel Command cancelled!

With numeric filter

Trigger: $awaitedCommand[odd;<numeric>]

$nomention
You have provided a number: $message
!number Provide a number! 7 You have provided a number: 7

For more info, see the Awaited Commands Guide.

$awaitedCommandError

Triggered when an awaited command doesn’t match with provided filter.

$awaitedCommandError[] is a callback, which means it’s used in the command trigger (not the code). The command is ran when an awaited command doesn’t match with provided filter.

Syntax

$awaitedCommandError[Name]

Parameters

  • Name (Type: String || Flag: Required): The name used in the $awaitFunc[] function.

Example

Trigger: $awaitedCommandError[number]

$nomention
Invalid number!
!number Provide a number! abc Invalid number!

For more info, see the Awaited Commands Guide.

$onJoined

Triggered when a user joins the server.

$onJoined[Channel ID] 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 can only have 1 single $onJoined[] per bot.

Syntax

$onJoined[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of the channel where the message should be sent to.

Example

  1. Create a command with the trigger $onJoined[Channel ID].

    🧙‍♂️ You must replace “Channel ID” with a valid channel ID or a server variable that holds the channel ID (See more here…)!

    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! ✨

    Welcome Nicky. Say hi! Nicky, welcome to Cool Server!

Not Working? Check out the Troubleshooting section.

Troubleshooting

Is $onJoined[] bugged or not working?

  • You must have at least version 1.17.9 of the app.

  • Go to Discord Developer Portal and select your bot. Then, click on bot’s tab and enable Member Intents.
    image
    image

  • Open BDFD app and select your bot. Go to bot settings and enable Member Intents.
    Screenshot_20220808_042857
    Screenshot_20220808_043030

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

  • Make sure $onJoined[channelID] is written in the “command trigger” field and not in the code.
    image

  • Make sure your bot has VIEW_CHANNEL, EMBED_LINKS, SEND_MESSAGES permission in the channel provided in $onJoined[], and that you inputted a valid channel ID.

  • Also, make sure you don’t have more than 1 $onJoined[].

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. Create a variable named “welcome” and the value set to nothing.
    image

  2. Create 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]]
    

    📝 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[Channel ID] in your welcome command trigger, with $onJoined[$getServerVar[welcome]] and you’re all set!

$onLeave

Triggered when a user leaves the server.

$onLeave[Channel ID] 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 can only have 1 single $onLeave[] per bot.

Syntax

$onLeave[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of the channel where the message should be sent to.

Example

  1. Create a command with the trigger $onLeave[Channel ID].

    🧙‍♂️ You must replace “Channel ID” with a valid channel ID or a server variable that holds the channelID (See more here…)!

    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! ✨

    Goodbye User. User just left the server :c

Not Working? Check out the Troubleshooting section.

Troubleshooting

Is $onLeave[] bugged or not working?

  • You must have at least version 1.17.9 of the app.

  • Go to Discord Developer Portal and select your bot. Then, click on bot’s tab and enable Member Intents.
    image
    image

  • Open BDFD app and select your bot. Go to bot settings and enable Member Intents.
    Screenshot_20220808_042857
    Screenshot_20220808_043030

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

  • Make sure $onLeave[channelID] is written in the “command trigger” field and not in the code.
    image

  • Make sure your bot has VIEW_CHANNEL, EMBED_LINKS, SEND_MESSAGES permission in the channel provided in $onLeave[], and that you inputted a valid channel ID.

  • Also, make sure you don’t have more than 1 $onLeave[].

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. Create a variable named “leave” and the value set to nothing.
    image

  2. Create 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]]
    

    📝 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[Channel ID] 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.

Syntax

$onBanAdd[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of the channel where the message should be sent to.

Example

  1. Create a command with $onBanAdd[Channel ID] as the trigger.

    🧙‍♂️ You must replace “Channel ID” with a valid channel ID or a server variable that holds the channel ID (See more here…)!

    example1

  2. Input your code/reply text.

    🧙‍♂️ You can use functions like $username, $authorID, $authorAvatar, $getBanReason[] here.

    example2

  3. Now you have a ban message! ✨

    User was struck with the ban hammer! User left.

Advanced

Per-Server $onBanAdd

Both free and premium users can use $onBanAdd[], and all users can put $getServerVar[] within $onBanAdd[]. 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 $onBanAdd[] (e.g. set their own logging channel), follow these steps:

  1. Create a variable named “logs” and the value set to nothing.
    image

  2. Create a command for setting the logging channel, then put the following in your code:

    $nomention
    $onlyAdmin[You need the admin permission to use that!]
    $argsCheck[>1;Please mention a channel!]
    Logging channel updated!
    $setServerVar[logs;$mentionedChannels[1]]
    

    📝 Servers will need to setup the channel they want the ban message to send to (by running a command with the code above).

  3. Now replace $onBanAdd[Channel ID] in your command trigger, with $onBanAdd[$getServerVar[logs]] and you’re all set!

$onBanRemove

Triggered when a user gets unbanned from the server.

$onBanRemove[Channel ID] 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.

Syntax

$onBanRemove[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The ID of the channel where the message should be sent to.

Example

  1. Create a command with $onBanRemove[Channel ID] as the trigger.

    🧙‍♂️ You must replace “Channel ID” with a valid channel ID or a server variable that holds the channel ID (See more here…)!

    example1

  2. Input your code/reply text.

    🧙‍♂️ You can use functions like $username, $authorID, $authorAvatar here.

    example2

  3. Now you have an unban message! ✨

    Carl-bot (235148962103951360) was unbanned!

Advanced

Per-Server $onBanRemove

Both free and premium users can use $onBanRemove[], and all users can put $getServerVar[] within $onBanRemove[]. 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 $onBanRemove[] (e.g. set their own logging channel), follow these steps:

  1. Create a variable named “logs” and the value set to nothing.
    image

  2. Create a command for setting the logging channel, then put the following in your code:

    $nomention
    $onlyAdmin[You need the admin permission to use that!]
    $argsCheck[>1;Please mention a channel!]
    Logging channel updated!
    $setServerVar[logs;$mentionedChannels[1]]
    

    📝 Servers will need to setup the channel they want the unban message to send to (by running a command with the code above).

  3. Now replace $onBanRemove[Channel ID] in your command trigger, with $onBanRemove[$getServerVar[logs]] and you’re all set!

$onMessageDelete

Triggered when a user deletes a message.

$onMessageDelete[Channel ID] 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.

Syntax

$onMessageDelete[Channel ID]

Parameters

  • Channel ID (Type: Snowflake || Flag: Required): The channel to which the resulting message will be sent.

Example

  1. Create a command with the trigger $onMessageDelete[Channel ID].

    🧙‍♂️ You must replace “Channel ID” with a valid channel ID or a server variable that holds the channel ID (See more here…)!

    example1

  2. Input your code/reply text.

    🧙‍♂️ You can use functions like $messageID, $getTimestamp here.

    example2

  3. Now, you have a logging message! ✨

    Hey Hello Hey A message was deleted!
    Message ID: 1133145902865985646

Advanced

Per-Server $onMessageDelete

Both free and premium users can use $onMessageDelete[], and all users can put $getServerVar[] within $onMessageDelete[]. 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 $onMessageDelete[] (e.g. set their own message logging channel), follow these steps:

  1. Create a variable named “logs” and the value set to nothing.
    image

  2. Create a command for setting the logging channel, then put the following in your code:

    $nomention
    $onlyAdmin[You need the admin permission to use that!]
    $argsCheck[>1;Please mention a channel!]
    Message logging channel updated!
    $setServerVar[logs;$mentionedChannels[1]]
    

    📝 Servers will need to setup the channel they want the logging message to send to (by running a command with the code above).

  3. Now replace $onMessageDelete[Channel ID] in your command trigger, with $onMessageDelete[$getServerVar[logs]] and you’re all set!

$onInteraction

Triggered upon an interaction being emitted (e.g. a button being clicked).

Syntax

$onInteraction

Supports

Example

$nomention
$if[$customID==interaction]
  $sendMessage[Hello!]
$endif

$if[$customID==onlyauthor-$authorID]
  $sendMessage[Hello $displayName!]
$endif
!example Click Interaction ID: interaction Hello! !example Click Interaction ID: onlyauthor-$authorID Hello Nicky! !example Click Interaction ID: onlyauthor-$authorID Hello MineBartekSA! I can't use the button

How $if[] or $customID[] works?

$onInteraction[]

Triggered upon an interaction being emitted (e.g. a button being clicked).

Syntax

$onIneraction[Interaction ID]

Parameters

  • Interaction ID (Type: String || Flag: Required): The custom/menu/button/interaction ID used during the creation of buttons, menus, text fields, and other components.

Supports

Example

  1. Create two commands and set the trigger $onInteraction[example] for one command and !example for the other.

    • Code with trigger !example:

      $nomention
      Click!
      $addButton[no;example;Click!;primary]
      
    • Code with trigger $onInteraction[example]:

      $nomention
      $sendMessage[Hello $displayName!]
      
  2. Execute commands

    !example Click! Click Me! Hello Nicky!

How $addButton[] works?

Premium

Bot Designer for Discord’s premium points system allows you to support the developers financially and gain some sweet perks!

Purchasing Premium Points

  1. Open BDFD app and click on profile icon.

    InShot_20220809_185729644

  2. Then, click “Buy premium points”.

    Screenshot_20220809_190558

  3. Choose your preferable package and confirm your purchase.

    Screenshot_20220809_114500

Redeeming Premium

After a successful purchase of premium points, here’s how to redeem them :

  1. Select your bot in app homepage and click “Add premium time” button in dashboard tab.

    Screenshot_20220809_112223

  2. Select the amount of points you want to spend, then confirm.

    IMG_20220809_152453

    One premium point equals one week (7 days) of premium hosting.

Premium Perks

AI

Main

  • $getServerVar[] in triggers (custom prefixes).
  • Awaited reactions.
  • Access to $messageContains[] and $alwaysReply callbacks.
  • Custom images.
  • Access to $ignoreTriggerCase and $sendNotification functions.
  • Unlimited commands and variables.
  • Ad-free hosting time.
  • Priority bot hosting and startup.
  • Maximum 120 minutes duration in $replyIn & $editEmbedIn.
  • Increased server and global variable character limits.
  • Bot guild list.
  • Embed builder.
  • Sharding.

Discord Server Perks

  • The premium role. Run !getPremiumRole.
  • Access to the premium chat.
  • Additional role income in our server economy system.

Guides

Support

For any premium related issues/support, contact us at premium-support@mail.botdesignerdiscord.com.

You can also ask questions about premium in our Community Discord Server.

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

$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 an auto-response or auto-moderation system.

Syntax

$messageContains[Word;...]

Parameters

  • Word (Type: String || Flag: Required): The phrases/words the bot checks for. Separate phrases using ;.

Example

  1. Create a new command with command trigger set as $messageContains[].

  2. Put text in the reply message/code.

    example

  3. Now, let’s say in chat someone types : Hello Bot!, Hello, Hey Everyone!, Hi Noituri etc. The bot will respond with “Hello there! How are you?”.

    Hello Hello there! How are you? Hi Noituri Hello there! How are you?

$reaction

(for premium users)

This is a callback. It gets triggered whenever an awaited reaction occurs.

Syntax

$reaction[Name]

Parameters

  • Name (Type: String || Flag: Required): The value used in “command name” argument of $awaitReactions[].

Example

Trigger $reaction[click]

$nomention
$sendMessage[$username clicked on the reaction]
!example Click Nicky clicked on the reaction

For more info, see the Awaited Reactions Guide.

$ai

Allows you to communicate with AI.

Syntax

$ai[Prompt;(System prompt;Response token limit)]

4 characters in the AI answer = 1 token

Parameters

  • Prompt (Type: String || Flag: Required): Prompt to the AI, for example: “Say something funny!”.
  • System prompt (Type: String || Flag: Optional): System prompt to the AI, for example: “Act funny”.
  • Response token limit (Type: Integer || Flag: Optional): Limit length of the response generated by AI.

Example

$nomention
$ai[What is 2+5?;You are a math teacher]
!example The answer is 7

We spent 3 tokens because the bot response length is 15. 15/4=3 (no rounding)

Use $aiQuota to know how many tokens you have left.

$aiQuota

Returns the remaining tokens for a bot.

Syntax

$aiQuota

4 characters = 1 token

Example

$nomention
Remaining tokens: $aiQuota
!example Remaining tokens: 2497

New tokens will be awarded and summed up every 24 hours!

Token limit (per bot): 2500 (Can be expanded over time)

$awaitReactions

(for premium bots)

This function is used to await a reaction.

Syntax

$awaitReactions[<Command name;Reaction>;...]

Parameters

  • Command name (Type: String || Flag: Required): The name which will be used inside the $reaction[] callback.
  • Reaction (Type: Emoji || Flag: Required): The reaction to await. The reaction must be either a Unicode Emoji or a Discord custom emoji id.

Example

$nomention
Yes or no?
$awaitReactions[✅;yes;❌;no]
$addReactions[✅;❌]
!reactions Yes or No?

For more info, see the Awaited Reactions Guide.

$customImage

(for premium bots)

This function is used to return the URL of an image uploaded in the app.

Syntax

$customImage[Custom image tag]

Parameters

  • Custom image tag (Type: String || Flag: Required): The image tag you set in the app while uploading the image.

Example

$nomention
$customImage[NiceImage]
!example

For more info, see the Custom Images Guide.

$usedEmoji

(for premium bots)

This function returns the emoji which triggered a $reaction[] callback.

This function can only be used inside a $reaction[] callback.

Syntax

$usedEmoji

Example

$nomention
$sendMessage[Emoji: $usedEmoji]
!example Yes or No? Emoji: ✅

For more info, see the Awaited Reactions Guide.

$ignoreTriggerCase

(for premium bots)

$ignoreTriggerCase is a function that makes the command trigger not case sensitive. For example, !help and !HeLp would both work.

Syntax

$ignoreTriggerCase

Example

Trigger: !hello

$nomention
$ignoreTriggerCase
Hello World!

With $ignoreTriggerCase

!hello Hello World! !HeLLo Hello World!

Without $ignoreTriggerCase

!hello Hello World! !HeLLo

$sendNotification

(for premium bots)

Sends a notification to your mobile phone.

Syntax

$sendNotification[Message;(Image URL)]

Parameters

  • Message (Type: String || Flag: Required): The text that is displayed in the notification.
  • Image URL (Type: String || Flag: Optional): The URL for the image to be attached.

Example

$nomention
$sendNotification[Hello, I miss you!;$userAvatar[$botID]]

example

Awaited reactions

(for premium bots)

Awaited reactions are similar to awaited commands. Unlike awaited commands which wait for a message, they wait for a reaction instead.

accept Do you accept? Accepted accept Do you accept? Declined

📝 Reaction roles are not possible at the moment since awaited reactions can only be triggered by the author and they expire whenever the bot goes offline.

Getting Started

To create an awaited reaction command, following functions and callback are used :

$awaitReactions[]

This function is used to await a reaction command.

Syntax

$awaitReactions[<Command name;Reaction>;...]

Parameters

  • Command name (Type: String || Flag: Required): It’s the name which will be used inside the $reaction[] callback.
  • Reaction (Type: Emoji || Flag: Required): It awaits the given emoji. Emoji must be either in Unicode or in Discord emoji ID format.

📝 You can group reactions by specifying more “command names” and “reactions” in $awaitReactions[].

⚠️ In group reactions, when one reaction is used, the others stop working i.e let’s say, a command awaits two reactions (✔️ & ❌). If the user reacts ✔️ then ❌ stops working.

$reaction[]

$reaction[] is a callback. It gets triggered whenever an awaited reaction occurs.

Syntax

$reaction[Name]

Parameters

  • Name (Type: String || Flag: Required): It’s the value which is used in the “command name” argument of $awaitReactions[].

$usedEmoji

This function is used to return the emoji which was triggered in the $reaction[] command.

Syntax

$usedEmoji

Example

Screenshot_20220809_194823 Screenshot_20220809_194754 Screenshot_20220809_194805

accept Do you accept? Accepted ✅

Custom Images

(for premium bots)

Upload custom images in the app from your device, without any image links. You can use the custom image as an embed image using $customImage[].

Uploading

  1. Select your bot and click “Image functions” in dashboard tab.

    example1

  2. Click the “Add image” button.

    example2

  3. Provide an image name and tag. The tag is used in $customImage[] to get the image. The name can be anything.

    example3

  4. Upload your image by clicking “Selected Image” and save the changes.

Retrieving

$customImage[]

This function is used to return the uploaded image in the app.

Syntax

$customImage[Custom image tag]

Parameters

  • Custom image tag (Type: String || Flag: Required): The tag that you set the custom image to, previously.

Example

$nomention
$customImage[NiceImage]
!example

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

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

  3. Change all the command triggers to $getServerVar[prefix]trigger-here. For example, !ping would become $getServerVar[prefix]ping.

  4. You’re all set, enjoy!

    !prefix . Set Testing's prefix to .

Embed Builder

(for premium users)

Embed Builder is a feature which allows creating embed easily and fast with live embed and code preview support.

Using Embed Builder

  • Select your bot in BDFD app homepage.

  • In Dashboard tab, click “Embed Builder”.

    Screenshot_20220828_201116

  • Fill out the necessary fields as per your choice.

    Screenshot_20220828_202359

  • Once done, copy the generated code from “Code preview” and paste in your respective command code.

JavaScript

📌 As of mid 2020, JavaScript script language in BDFD has been deprecated.

Besides using the official BDFD script language (i.e BDScript) to develop Discord Bots. Bot Designer For Discord also supports developing bots using JavaScript.

In this wiki page and the following sub-wikis, you will learn and explore more about BDFD JavaScript.

Introduction

BDFD JavaScript (a.k.a BDJS) is an another script language available in the app which can be used as alternative to BDScript for developing a Discord Bot. Unlike BDScript, BDJS executes a JavaScript code. It uses ECMAScript 2015 (ES6) JavaScript version. BDJS has limited Discord API functions support available.

BDFD JavaScript provides a different runtime than Node.JS or Web Browser.

📌 BDFD JavaScript is not recommended to be used by users who aren’t familiar with JavaScript language. It’s a language which is entirely different from BDScript and without any proper JS knowledge, the user would get confused whether be it in understanding or writing codes.

📚 Want to learn JavaScript and don’t know where to get started?
Then, check out the following JavaScript learning resources :

MDN Web Docs
Modern JavaScript Tutorial

Enabling JavaScript

To enable JavaScript in BDFD, follow the steps described below :

  1. In bot list, click the gear icon ⚙️ and toggle on “Enable features for advanced users”.

    ezgif com-gif-maker (1)

  2. Then, create a new command and switch “Scripting Language” to “Javascript”.

    ezgif com-gif-maker

    📌 You cannot use BDScript functions anymore once you enable “Javascript” in a command.

  3. That’s it! Now, you can start writing your JavaScript code.

Objects

Here is the list of all Discord API supported objects :

NameTypeDescription
authorIdStringReturns ID of the user who triggered the command.
channelIdStringReturns ID of the current channel.
commandPrefixStringReturns the value which was set in Command Trigger.
messageStringReturns message content of the user who triggered the command.
rolementionsArray of StringsReturns an array of strings containing all mentioned role IDs.
usermentionsArray of StringsReturns an array of strings containing all mentioned user IDs.

ban

Bans a user from the current guild.

Syntax

ban(userID)

Parameters

  • userID : The user to ban. Value must be a valid user snowflake ID.

Permissions

Required permission which the bot must have for this function to work properly:

  • ban

Example

try {
  const msg = message.replace(commandPrefix, '').trim();

  if (!msg) {
    setResponse(`Usage : \` ${commandPrefix} [@user] \``);
  } else {
    const mention = /^<@!?(\d{17,20})>/.test(msg);

    if (!mention || !userMentions[0])
      throw new Error('Mention an user!');

    if (userMentions[0] === authorId)
      throw new Error('You can\'t ban yourself!');

    sendChannelMessage(channelId, `*<@${authorId}> bans <@${userMentions[0]}>!!*`);

    ban(userMentions[0]);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220917_165612
InShot_20220917_172017419

banWithReason

Bans a user from the current guild with reason.

Syntax

banWithReason(userID, reason)

Parameters

  • userID : The user to ban. Value must be a valid user snowflake ID.
  • reason : The ban reason to add in Audit Logs and Guild Bans. Reason must not exceed more than 512 characters.

Permissions

Required permission which the bot must have for this function to work properly:

  • ban

Example

try {
  const msg = message.replace(commandPrefix, '').trim().split(' ');

  if (!msg[0]) {
    setResponse(`Usage : \` ${commandPrefix} [@user] [Reason] \``);
  } else {
    const
      mention = /^<@!?(\d{17,20})>$/.test(msg.shift()),
      reason = msg.join(' ').trim();

    if (!mention || !userMentions[0])
      throw new Error('Mention an user!');

    if (userMentions[0] === authorId)
      throw new Error('You can\'t ban yourself!');

    if (!reason)
      throw new Error('Missing reason!!');

    if (reason.length > 512)
      throw new Error('Failed to ban! Reason must be lower or equal to 512 characters');

    sendChannelMessage(channelId, `*<@${authorId}> bans <@${userMentions[0]}> with reason \` ${reason} \`!!*`);

    banWithReason(userMentions[0], reason);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220922_153202
InShot_20220922_153537132

channelTyping

Emits the TYPING_START event. It shows “Bot is typing…” in the channel where the command was triggered.

Syntax

channelTyping()

Permissions

Required permissions which the bot must have for this function to work properly:

  • sendmessages
  • sendmessagesinthreads
  • readmessages

Example

channelTyping();
setResponse('Wow! I did type.');

ezgif com-gif-maker

createChannel

Creates a new channel in the current guild.

Syntax

createChannel(name, type)

Parameters

  • name : The name of the channel.
  • type : The type of the channel to create. Value must be either text or voice.

Permissions

Required permission which the bot must have for this function to work properly:

  • managechannels

Example

try {
  const
    msg = message.replace(commandPrefix, '').trim().replace(/  +/g, ' ').split(' '),
    type = msg.shift().toLowerCase();

  if (!type) {
    setResponse(`Usage : \` ${commandPrefix} [Type] [Name] \``);
  } else {
    if (type === 'text' || type === 'voice') {

      if (!msg.join(' '))
        throw new Error('Provide a channel name!');
 
      if (msg.join(' ').length > 100)
        throw new Error('Couldn\'t create channel! Channel name must be lower than or equal to 100 characters!');

      sendChannelMessage(channelId, `A ${type} channel has been created!`);

      createChannel(msg.join(' '), type);
    } else throw new Error('Invalid Channel Type!! Must be either "Text" or "Voice"');
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220922_092653
InShot_20220922_092945515

giveRole

Assigns a role to a specified user.

Syntax

giveRole(userID, roleID)

Parameters

  • userID : The user to get the role. Value must be a valid user snowflake ID.
  • roleID : The role to assign to the user. Value must be a valid role snowflake ID.

Permissions

Required permission which the bot must have for this function to work properly:

  • manageroles

Example

try {
  const msg = message.replace(commandPrefix, '').trim().replace(/  +/g, ' ').split(' ', 2);

  if (!msg[0]) {
    setResponse(`Usage : \` ${commandPrefix} [@user] [@role] \``);
  } else {
    const
      userMention = /^<@!?(\d{17,20})>$/.test(msg[0]),
      roleMention = /^<@&!?(\d{17,20})>$/.test(msg[1]);

    if (!userMention || !userMentions[0])
      throw new Error('Mention an user!');

    if (!roleMention || !roleMentions[0])
      throw new Error('Mention a role!');

    sendChannelMessage(channelId, `Gave <@&${roleMentions[0]}> to <@${userMentions[0]}>!`);

    giveRole(userMentions[0], roleMentions[0]);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220917_225634
InShot_20220918_000019652

kick

Kicks a user from the current guild.

Syntax

kick(userID)

Parameters

  • userID : The user to kick. Value must be a valid user snowflake ID.

Permissions

Required permission which the bot must have for this function to work properly:

  • kick

Example

try {
  const msg = message.replace(commandPrefix, '').trim();

  if (!msg) {
    setResponse(`Usage : \` ${commandPrefix} [@user] \``);
  } else {
    const mention = /^<@!?(\d{17,20})>/.test(msg);

    if (!mention || !userMentions[0])
      throw new Error('Mention an user!');

    if (userMentions[0] === authorId)
      throw new Error('You can\'t kick yourself!');

    sendChannelMessage(channelId, `*<@${authorId}> kicked <@${userMentions[0]}>!!*`);

    kick(userMentions[0]);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220919_163929
InShot_20220919_164211838

kickWithReason

Kicks a user from the current guild with reason.

Syntax

kickWithReason(userID, reason)

Parameters

  • userID : The user to kick. Value must be a valid user snowflake ID.
  • reason : The kick reason to add in Audit Logs. Reason must not exceed more than 512 characters.

Permissions

Required permission which the bot must have for this function to work properly:

  • kick

Example

try {
  const msg = message.replace(commandPrefix, '').trim().split(' ');

  if (!msg[0]) {
    setResponse(`Usage : \` ${commandPrefix} [@user] [Reason] \``);
  } else {
    const
      mention = /^<@!?(\d{17,20})>$/.test(msg.shift()),
      reason = msg.join(' ').trim();

    if (!mention || !userMentions[0])
      throw new Error('Mention an user!');

    if (userMentions[0] === authorId)
      throw new Error('You can\'t kick yourself!');

    if (!reason)
      throw new Error('Missing reason!!');

    if (reason.length > 512)
      throw new Error('Failed to kick! Reason must be lower or equal to 512 characters');

    sendChannelMessage(channelId, `*<@${authorId}> kicks <@${userMentions[0]}> with reason \` ${reason} \`!!*`);

    kickWithReason(userMentions[0], reason);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220925_104418
InShot_20220925_104547037

pinMessage

Pins a message to the channel.

Syntax

pinMessage(channelID, messageID)

Parameters

  • channelID : The channel where the message is located. Value must be a valid channel snowflake ID.
  • messageID : The ID of the message. Value must be a valid message snowflake ID.

Permissions

Required permission which the bot must have for this function to work properly:

  • managemessages

Example

try {
  const msg = message.replace(commandPrefix, '').replace(/  +/g, ' ').trim().split(' ', 2);

  if (!msg[0]) {
    setResponse(`Usage : \` ${commandPrefix} [#channel] [Message ID] \``);
  } else {

    if (!/^<#!?(\d{17,20})>$/.test(msg[0]))
      throw new Error('Mention a valid channel!');

    if (!/^\d{17,20}$/.test(msg[1]))
      throw new Error('Provide a valid message ID!');

    sendChannelMessage(channelId, 'A message has been pinned!');
    
    pinMessage(msg[0].match(/\d/g).join(''), msg[1]);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220925_162848
Screenshot_20220925_162938

removeChannel

Removes a specified channel from the current server.

Syntax

removeChannel(channelID)

Parameters

  • channelID : The channel to be removed. Value must be a valid channel snowflake ID.

Permissions

Required permission which the bot must have for this function to work properly:

  • managechannels

Example

try {
  const msg = message.replace(commandPrefix, '').trim().split(' ');

  if (!msg[0]) {
    setResponse(`Usage : \` ${commandPrefix} [#channel] \``);
  } else {
    const isChannel = /^<#!?(\d{17,20})>$/.test(msg[0]);

    if (!isChannel)
      throw new Error('Mention a valid channel!');

    const channelID = msg[0].match(/\d/g).join('');

    sendChannelMessage(channelId, `Channel <#${channelID}> has been deleted!`);

    removeChannel(channelID);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220919_171553
InShot_20220919_171824516

sendChannelMessage

Sends a message to the provided channel.

Syntax

sendChannelMessage(channelId, message)

Parameters

  • channelId : The channel to send the message. Value must be a valid channel snowflake ID.
  • message : The message to send to the provided channel ID.

Permissions

Required permissions which the bot must have for this function to work properly:

  • sendmessages
  • sendmessagesinthreads
  • readmessages

Example

try {
  const msg = message.replace(commandPrefix, '').replace(/  +/g, ' ').trim().split(' ', 2);

  if (!msg[0]) {
    setResponse(`Usage : \` ${commandPrefix} [#channel] [Message] \``);
  } else {
    const isChannel = /^<#!?(\d+)>$/.test(msg[0]);

    if (!isChannel)
      throw new Error('Mention a valid channel!');

    if (!msg[1])
      throw new Error('Provide a message!');

    const
      channelID = msg[0].match(/\d/g).join(''),
      content = message.replace(commandPrefix, '').replace(msg[0], '').trim();

    if (content.length > 2000)
      throw new Error('Failed to send the message! Reached maximum message character limit.');

    sendChannelMessage(channelID, content);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220917_102010

setEmbedImage

Adds an image to an embed.

Syntax

setEmbedImage(imageURL)

Parameters

  • imageURL : The image to set in the embed. Value must be a valid image link. (Optional)

Example

setEmbedImage('https://http.cat/200');
setEmbedResponse();

Screenshot_20220917_134716

setEmbedResponse

Sends an embedded message to the current channel.

Syntax

setEmbedResponse(title, description, footer)

Parameters

  • title : Adds a title to the embed.
  • description : Adds a description to the embed.
  • footer : Adds a footer to the embed.

📌 All parameters are optional.

Permissions

Required permissions which the bot must have for this function to work properly:

  • embedlinks
  • sendmessages
  • sendmessagesinthreads
  • readmessages

Example

const date = new Date().toDateString();
setEmbedResponse('Hey' , 'This is an Embed!', 'Executed in ' + date);

Screenshot_20220917_005110

setResponse

Sends a message to the current channel.

Syntax

setResponse(replyText)

Parameters

  • replyText : The provided text to send. (Optional)

Permissions

Required permissions which the bot must have for this function to work properly:

  • sendmessages
  • sendmessagesinthreads
  • readmessages

Example

setResponse(`Hi! <@${authorId}>`);

Screenshot_20220916_205326

takeRole

Removes a role from a specified user.

Syntax

takeRole(userID, roleID)

Parameters

  • userID : The user of whose role is to get removed. Value must be a valid user snowflake ID.
  • roleID : The role to take from the user. Value must be a valid role snowflake ID.

Permissions

Required permission which the bot must have for this function to work properly:

  • manageroles

Example

try {
  const msg = message.replace(commandPrefix, '').trim().replace(/  +/g, ' ').split(' ', 2);

  if (!msg[0]) {
    setResponse(`Usage : \` ${commandPrefix} [@user] [@role] \``);
  } else {
    const
      userMention = /^<@!?(\d{17,20})>$/.test(msg[0]),
      roleMention = /^<@&!?(\d{17,20})>$/.test(msg[1]);

    if (!userMention || !userMentions[0])
      throw new Error('Mention an user!');

    if (!roleMention || !roleMentions[0])
      throw new Error('Mention a role!');

    sendChannelMessage(channelId, `Removed <@&${roleMentions[0]}> from <@${userMentions[0]}>!`);

    takeRole(userMentions[0], roleMentions[0]);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220919_074515
InShot_20220919_023352223

unban

Unbans a user from the current guild.

Syntax

unban(userID)

Parameters

  • userID : The user to unban. Value must be a valid user snowflake ID.

Permissions

Required permission which the bot must have for this function to work properly:

  • ban

Example

try {
  const msg = message.replace(commandPrefix, '').replace(/  +/g, ' ').trim().split(' ', 1);

  if (!msg.length) {
    setResponse(`Usage : \` ${commandPrefix} [User ID] \``);
  } else {
    const id = /^\d{17,20}$/.test(msg);

    if (!id)
      throw new Error('Invalid ID!');

    if (msg[0] === authorId)
      throw new Error('You are not banned!');

    sendChannelMessage(channelId, `<@${authorId}> unbans \` ${msg} \`!!`);
    
    unban(msg)
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220921_230659
InShot_20220921_230931790

unpinMessage

Unpins a message from the channel.

Syntax

unpinMessage(channelID, messageID)

Parameters

  • channelID : The channel where the message is located. Value must be a valid channel snowflake ID.
  • messageID : The ID of the message. Value must be a valid message snowflake ID.

Permissions

Required permission which the bot must have for this function to work properly:

  • managemessages

Example

try {
  const msg = message.replace(commandPrefix, '').replace(/  +/g, ' ').trim().split(' ', 2);

  if (!msg[0]) {
    setResponse(`Usage : \` ${commandPrefix} [#channel] [Message ID] \``);
  } else {

    if (!/^<#!?(\d{17,20})>$/.test(msg[0]))
      throw new Error('Mention a valid channel!');

    if (!/^\d{17,20}$/.test(msg[1]))
      throw new Error('Provide a valid message ID!');

    sendChannelMessage(channelId, 'A message has been unpinned!');
    
    unpinMessage(msg[0].match(/\d/g).join(''), msg[1]);
  };
} catch (err) {
  setResponse('Command Error : ` ' + err.message + ' `');
};

Screenshot_20220925_163311
InShot_20220925_163609635