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
📎 Links
- Discord Server
- Website
- Android App
- iOS App
- Web App (Alpha Version)
📓 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
2023
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
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
andforum
channel types to$createChannel[]
- Added
stage
,announcement
, andforum
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 toCustom 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
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 is0
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
anduserID
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
November
- Added
$rolePosition[]
- Released translation strings to volunteers
- Added
kick()
andban()
to JS - Released new stable version
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
-
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. -
You agree to not decompile or modify our software in any way. We may take legal steps if we detect these actions.
-
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.
-
You agree not to spam or overuse our computing/storage resources.
-
You agree not to resell your Bot Designer for Discord account, "Premium Points", or "promo codes".
-
You agree not to exploit a detected bug. It should be sent as a report to the developers instead.
-
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.
-
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.
-
When submitting or using Bot Designer for Discord's "Template store" feature, you are agreeing to the Template Store Terms.
-
You agree to our Privacy Policy.
-
You agree to first contact support before reversing your payment method if you have purchased Premium Points.
-
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
.
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 a Discord bot in BDFD.
Creating a Bot
-
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. -
Then, press the "Add Bot" button to create a discord bot.
-
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.
Inviting the bot
To add the bot into a server, see this guide.
Hosting the bot
You can host your Discord bot in the app by either watching free ads or purchasing premium.
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
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.
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.
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.
Example
Output
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:
- Standard Intents1
- Privileged Intents
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:
$awaitedCommand[]
$messageContains[]
$argsCheck
$banID
(First & Second Usage)$getEmbedData
$getMessage
(Only forcontent
type)$ignoreTriggerCase
$message
$noMentionMessage
$removeContains
$trimContent
$unban
$unbanID
Enabling Privileged Gateway Intents
To enable Privileged Gateway Intents in your bot, follow these steps:
-
Open your bot dashboard in the BDFD app (Make sure your app version is
2.2.2
or above). -
Click on the "Settings" tab, and then on "Go to gateway intents settings".
-
After that, click on "Change gateway intents on Developer Portal".
-
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
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:
-
Select the bot you want to add the new variable to.
-
Go to "Variables" tab.
-
Then, click "+ New variable" button.
-
Give the variable a name and value.
-
Finally, save the changes!
Editing Variables
Here's how you can modify an existing variable's name/default value:
-
Select the bot you want to edit the variable for.
-
Go to "Variables" tab.
-
Click the edit/pencil icon near the variable name that you want to edit.
-
Provide a new variable name and/or value.
-
Finally, save the changes!
Deleting Variables
Here's how you can delete variables:
-
Select the bot you want to delete the variable for.
-
Go to "Variables" tab.
-
Select the variable you want to delete.
-
Finally, confirm the deletion!
📌 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:
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.]
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.]
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:
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.]
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.]
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:
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]!
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:
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]]
This command returns how many cookies the server has currently.
$nomention
Total Server Cookies: 🍪 $getServerVar[ServerCookies]
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:
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]]
This command returns how many command uses the channel has currently.
$nomention
Command used `$getChannelVar[Uses]` times in this channel
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.
- $globalUserLeaderboard - Global-User Variables.
- $userLeaderboard - User Variables.
- $serverLeaderboard - Server Variables.
- $getLeaderboardValue - Fetchs leaderboard value.
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 $if
s or $try
s.
$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
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
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
$addButton[]
$editButton[]
$removeButtons
$removeButtons[]
$removeComponent[]
$onInteraction
$onInteraction[]
Button Style
primary
: Blue buttonsecondary
: Gray buttonsuccess
: Green buttondanger
: Red buttonlink
: Redirect button
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 tolink
.
$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 toyes
the button will appear in a new row. If it's set tono
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 aninteraction ID
which is then used in the$onInteraction[ID]
callback or aURL
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 tolink
. Check this section for more details. -
disable?
(Type: Bool || Flag: Vacantable)
: If set toyes
the button can't be pressed. Defaults asno
. -
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 totest
.
If
url
is used ininteraction ID/url
argument, it has to start withhttp://
orhttps://
Example
$nomention
Hi
$addButton[no;test;Say hello!;primary;no;]
$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 aninteraction ID
which is then used in the$onInteraction[ID]
callback or aURL
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 tolink
. Check this section for more details.disable?
(Type: Bool || Flag: Vacantable)
: If set toyes
the button can't be pressed. Defaults asno
. (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;]
$removeButtons
Removes all buttons from the triggered message.
Syntax
$removeButtons
Example
Trigger: $onInteraction[test]
$nomention
$username removed all buttons from this message
$removeButtons
$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]
$removeComponent
Removes a certain component from a message.
Syntax
$removeComponent[interaction ID;(message ID)]
This function supports select-menu and button.
Parameters
interaction ID
(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]
Create interaction
Example with $onInteraction[]
callback:
- Create two commands with
!example
and$onInteraction[test]
triggers. - 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 thenew row?
argument so that the button would appear in the next row.
- Execute command
!example
Example with $onInteraction
callback:
- Create two commands with
!example
and$onInteraction
triggers. - 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 thenew row?
argument so that the button would appear in the next row.
- Execute command
!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, eithershort
orparagraph
.
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 theMaximum 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 theMinimum 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 thanMinimum length
and no more thanMaximum 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.
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 thelabel
.Default
- should the option be selected by default. There can be only one default option!Emoji
- it shows up next to thelabel
.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
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
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️⃣]
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]
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>
.
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 chooseOAuth2
tab. - In
OAuth2
tab, clickURL 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
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
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
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.
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[command name]
callback
This callback receives information about current user input. It's used for adding suggestions.
command name
is the name of a slash command.
Avaliable functions
$appendOptionSuggestion[name;suggestion]
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 butvalue
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 isInteger
,value
can't be set toHello
but it can be set to123
$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 option:
Slash command code:
$message[arg]
$onAutoComplete[]
callback:
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.
2.
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[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, ifuser ID
is not given.channel ID
(Type: Snowflake || Flag: Optional)
: The channel where the command will be awaited. Uses current channel, ifchannel ID
is not given.
Example
$nomention
What do you want me to say?
$awaitFunc[say]
$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
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
With numeric filter
Trigger: $awaitedCommand[odd;<numeric>]
$nomention
You have provided a number: $message
$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!
Creating an awaited command
Without filter
- Create two commands with
!say
and$awaitedCommand[say;]
triggers. - 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
- Execute command
!say
With choose filter
- Create two commands with
!odd
and$awaitedCommand[odd;<yes/no/cancel>]
triggers. - 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
- Execute command
!odd
With numeric filter
- Create two commands with
!number
and$awaitedCommand[number;<numeric>]
triggers. - 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
- Execute command
!number
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"
}
]
}
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
API: pastebin.com
If Statements
Interprets commands conditionally.
Every if statement starts with $if[condition]
and has to end with $endif
.
$else
is optional.
Basics
- Use
$if[]
to specify a block of code to be executed, if a specified condition is true. - Use
$else
to specify a block of code to be executed, if the same condition is false. - Use
$elseif[]
to specify a new condition to check, if the first condition is false (can be only used in BDScript 2) - Use
$else
and$if[]
to specify a new condition to check, if the first condition is false. - Use
$endif
to end a if statement.
Examples:
$if[$username==kubastick]
Hi Kuba!
$else
Hi $username!
$endif
$if[$getUserVar[money]>0]
You're not broke
$endif
$if[$username==noituri]
$if[$message[<]==nice]
Noit said nice
$endif
$endif
Only for BDScript 2:
$if[$message==test]
You said test
$elseif[$message==BDFD]
Bot Designer for Discord
$elseif[$username==noituri]
Hi Noituri!
$else
I don't know what to say
$endif
Note: You can use multiple
$elseif
s
Explaination
$if[]
uses the format of: if x
is related accordingly (based on the "sign") with y
then the code below runs.
Signs
==
- Equal
!=
- Not Equal
<
- Less Than
>
- Greater Than
>=
- Greater Than Or Equal To
<=
- Less Than Or Equal To
- These signs could vary in meaning based on the order or intent of the if statement.
- If you are using text as your
x
and/ory
, you can not use any other signs besides==
and!=
. However for numbers, you can use any sign shown in the above list.
Base Usage
$if[value-x(sign)value-y]
Else If
$elseif
can be only used in BDScript 2. If you use different BDScript edition please read the note below.
Note: Normal BDScript and BDScript Unstable don't have a specific function for else if blocks, but you can still do them by using
$else
and$if[]
. The difference between$else
and$elseif[]
is that$else
doesn't need a condition. Where as$elseif[]
is still an$if[]
so it needs a condition. The main purpose for$elseif[]
is to make it so only one if statement runs. Unlike regular if statements, the else if blocks should end with$else
then start with another$if[]
. Once you are done with your else if statements, close all of them with x number of$endif
s (x
= number of else if statements) at the bottom of the last else if statement.
Example Else If for Normal BDScript and BDScript Unstable
$if[$checkContains[$message;hi]==true]
Hello
$else
$if[$checkContains[$message;yes]==true]
Sure!
$endif
$endif
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]
$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]
$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.
$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].
$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]]
$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's2
or4
.
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]]
$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]]
$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].
$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[{}] $jsonSet[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.
$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
,
.
$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;, ]
$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;, ]
$jsonArrayUnshift
$jsonArrayUnfhist
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;, ]
Threads
Threads are subset-channels within a channel. Threads are great for separating different conversations in one channel. This wiki will explain how you can integrate threads in your bot.
⚠️ In order to send a message in thread, make sure your bot has
SEND_MESSAGES_IN_THREADS
permission.
Creating a Thread
$startThread[name;channelID;messageID (canBeLeftEmpty);archiveDuration (60/1440/4320/10080);returnThreadID (yes/no)]
Starts a thread (learn more)
Editing a Thread
$editThread[threadID;name;archived (yes/no);archiveDuration (60/1440/4320/10080);locked (yes/no);slowmode (in seconds)]
Edits an existing thread. (learn more)
Member Thread Management
Adding a User to a Thread
$threadAddMember[threadID;userID]
Adds a user to the thread. (learn more)
Removing a User from a Thread
$threadRemoveMember[threadID;userID]
Removes a user from the thread. (learn more)
Example
$var[threadID;$startThread[Cool Thread;$channelID;;1440;yes]]
I created a new thread! <#$var[threadID]>
$c[❗️This example requires BDScript 2 enabled❗️]
Further Reading
If you want to learn more about threads, read Discord's support article.
Text Splitting
Text splitting functions are useful for advanced codes that deal with multiple user arguments, or even adjusting function outputs (for advanced users). This wiki includes information on how to use these functions.
Functions
There are 7 functions in this guide. One of them, $textSplit
, is the main function that you start off.
$textSplit
This function separates the text with a separator and saves the text for later use.
Syntax
$textSplit[separatedText;separator]
Parameters
separatedText
- The text separated by a separator.separator
- The separator that separates the text.
Example
$textSplit[hello-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
- The index of the element to be returned.
Examples
Example #1
$textSplit[hello-world-!;-]
The 1st element: $splitText[1]
The 2nd element: $splitText[2]
The 3rd element: $splitText[3]
Example #2
$textSplit[hello-world-!;-]
The very first element: $splitText[<]
The very last element: $splitText[>]
$getTextSplitLength
This function has a simple purpose: $getTextSplitLength
returns the length of the separated text, that is, the number of words separated by a separator. The returned value is the maximum index for the given separated text.
Syntax
$getTextSplitLength
Example
$textSplit[hello-world-!;-]
The maximum index: $getTextSplitLength
$getTextSplitIndex
This function searches for the specified element in the separated text and returns its index. If the specified element wasn't found or doesn't exist, the function will return -1
.
Syntax
$getTextSplitIndex[value]
Parameters
value
- The text, that is, the element whose index is should be returned.
Example
$textSplit[hello-world-!;-]
$onlyIf[$getTextSplitIndex[$message]!=-1;The specified element wasn't found or doesn't exist!]
The index of the specified element: $getTextSplitIndex[$message]
$joinSplitText
This function returns the current elements of the separated text with the specified (sometimes new) separator.
Syntax
$joinSplitText[separator]
Parameters
separator
- (The new) separator with which the elements should be returned.
Example
See example below, using $removeSplitTextElement or $editSplitText.
$removeSplitTextElement
This function removes an element from the separated text by the specified index.
Syntax
$removeSplitTextElement[index]
Parameters
index
- The index of the element to be removed.
Example
$textSplit[hello-world-!;-]
$onlyIf[$getTextSplitIndex[$message]!=-1;The specified element wasn't found or doesn't exist!]
$removeSplitTextElement[$getTextSplitIndex[$message]]
Successfully removed element with index $getTextSplitIndex[$message]!
Current elements: $joinSplitText[-]
$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
- The index of the element to be replaced.value
- The text, that is, what will replace the specified element.
Example
$textSplit[hello-world-!;-]
$onlyIf[$getTextSplitIndex[$message[1]]!=-1;The specified element wasn't found or doesn't exist!]
$editSplitText[$getTextSplitIndex[$message[1]];$message[2]]
The element with index $getTextSplitIndex[$message[1]] has been replaced by $message[2]!
Current elements: $joinSplitText[-]
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:
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://
orhttps://
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 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
Character | Escaped |
---|---|
; | %{-SEMICOL-}% or \; |
$ | %{DOL}% |
] | %ESCAPED% or \] |
\ | \\ |
Example
$sendMessage[[ 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.
General Hyperlinks
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)]
Title Hyperlinks
Use the $embeddedURL function to add a hyperlink in $title.
Author Hyperlinks
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
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 name | Type | Description | Can be empty | Can be omitted |
---|---|---|---|---|
tag | String | Function name | False | False |
shortDescription | String | Description for a function without arguments | True | False |
longDescription | String | Description for a function with arguments | True | False |
arguments | Array of Arguments | Arguments needed by a function | True | False |
intents | Integer | Discord intents needed by bot to execute this function | False | False |
premium | Bool | function needs premium | False | False |
deprecated | Bool | function is deprecated | False | True |
deprecatedFor | String | Name of the function that should be used instead | False | True |
Argument
Field name | Type | Description | Can be omitted |
---|---|---|---|
name | String | Argument name | False |
description | String | Description for a function's argument | True |
type | String Argument Types | Argument type. \| is used for a compound type | False |
required | bool | Argument is required | False |
tupleTypes | Array of Arguments | Array of arguments which can be repeated, i.e channelID;messageID;channelID;messageID;... | True |
empty | Bool | Argument can be empty | True |
ellipsis | Bool | Argument accepts more data, i.e username1;username2;username3;... | True |
enumData | Array of Strings | Possible options accepted as argument, i.e primary/secondary/or/etc | True |
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?
Name | Discord Tag | Position |
---|---|---|
Jakub Tomana | wiadr000#1947 (kubastick) | Owner/Developer |
Mikołaj Radkowski | noituri#1111 | Developer |
Bartłomiej Skoczeń | MineBartekSA#4899 | Developer |
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
-
Mobile
Go to User Settings > Appearance > Advanced and turn on Developer Mode.
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>
- Static -
- Mentioning a Slash
- Normal -
</name:commandID>
- Subcommand -
</name subcommandName:commandID>
- Subcommand group -
</name subcommandGroup subcommandName:commandID>
- Normal -
- 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.
Style | Input | Output | Description |
---|---|---|---|
t | <t:1667219160:t> | 12:26 AM | Short Time |
T | <t:1667219160:T> | 12:26:00 AM | Long Time |
d | <t:1667219160:d> | 10/31/2022 | Short Date |
D | <t:1667219160:D> | October 31, 2022 | Long Date |
f | <t:1667219160:f> | October 31, 2022 12:26 AM | Short Date/Time |
F | <t:1667219160:F> | Monday, October 31, 2022 12:26 AM | Long Date/Time |
R | <t:1667219160:R> | 27 minutes ago | Relative Time |
📌 The default style is
f
, if no style provided.
Usability
Functions which return UNIX timestamp:
Example
$nomention
<t:$getTimestamp:D>
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]
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.
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 -
Permission | Description |
---|---|
addreactions | Allows to react emojis in messages (Doesn't affect existing emojis in messages). |
admin | Grants all permissions and bypasses all channel permissions overwrites. |
attachfiles | Allows to upload attachments in channels. |
ban | Allows banning/unbanning members. |
changenicknames | Allows editing own server nickname. |
connect | Allows to join voice/stage channels. |
createinstantinvite | Allows to create invites. |
createprivatethreads | Allows to create private threads. |
createpublicthreads | Allows to create public threads. |
embedlinks | Allows to send embedded content and links in channels. |
externalemojis | Allows to use custom emojis from a different server. |
externalstickers | Allows to use custom stickers from a different server. |
kick | Allows kicking members. |
managechannels | Allows to create/delete/modify channels of the server. |
manageemojis | Allows to create/delete/modify custom emojis and stickers of the server. |
manageevents | Allows to create/delete/modify events in the server. |
managemessages | Allows deleting messages of other members and pinning/unpinning messages in channels. |
managenicknames | Allows to modify server members nicknames. |
manageroles | Allows to create/delete/modify server roles. It also allows modifying individual channel's permissions. |
manageserver | Allows to create/modify AutoMod rules, add bots, view invites and change server settings. |
managethreads | Allows to create/delete/modify channel threads. |
managewebhooks | Allows to create/delete/modify channel webhooks. |
mentioneveryone | Allows to mention ping @everyone , @here and all server roles. |
moderatemembers | Allows to timeout/untimeout members. This permission is also known as "Timeout members". |
movemembers | Allows to move members between voice/stage channels. |
priorityspeaker | Allows to be easily heard in voice/stage channels. |
readmessagehistory | Allows to view channel message history. |
readmessages | Allows to view a channel. This permission is also known as "View channel". |
requesttospeak | Allows to request to speak in stage. |
sendmessages | Allows to send messages in channels. |
sendmessagesinthreads | Allows to send messages in threads. |
slashcommands | Allows to use application commands (i.e slash commands, context-menus) in channels. This permission is also known as "Use Application Commands". |
speak | Allows to speak in voice/stage channel. |
stream | Allows to stream live in voice/stage channels. |
tts | Allows to send text-to-speech (tts) messages. |
usevad | Allows 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". |
viewauditlog | Allows to view server audit logs. |
viewguildinsights | Allows to view insights of a server. |
voicedeafen | Allows to deafen a member in voice/stage channel. |
voicemute | Allows to mute a member from speaking in voice/stage channel. |
📝 All permissions are case insensitive (i.e both
BAN
andBan
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.
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.
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.
Link Diagnosis
- 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.
-
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 likedlscird.com
is not. -
Is it out of context?
If a user sends you a link that is out of context of your previous discussions (or if you've never talked to them) then you can bet on it being untrustworthy.
-
Was the link sent by a friend?
At first glimpse, you'd assume this makes the link more trustworthy. But, it could be that their account has been compromised, so you should still be careful when clicking links from friends.
-
Too good to be true?
Free Nitro scams are extremely common. If you get a DM from a random user/bot telling you that you won something or can earn Nitro, just disregard it.
-
Asking for your password/user token?
If a site is asking for your Discord account information—don't input it. You should only share your Discord password via Discord's official login page. Discord will never ask for your user token.
System Messages
If a message is officially by Discord, there will be a 'system' badge next to the system user's name, like:
Discord Offical Links
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
This scam is using a phishing "steam community" URL, to potentially steal your account details.
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.
"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:
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 :
Value | Return Information |
---|---|
2006 | Year |
06 | Year (Short) |
__2 | Day count of the year (Space-Padded) |
002 | Day count of the year (Zero-Padded) |
Jan | Month (Short) |
January | Month |
01 | Numerical Month (Full) |
1 | Numerical Month |
Mon | Week Day (Short) |
Monday | Week Day |
02 | Day (Full) |
2 | Day |
_2 | Day count of the month (Space-Padded) |
PM | AM/PM (Uppercase) |
pm | AM/PM (Lowercase) |
05 | Second |
5 | Second (Short) |
15 | 24-Hour |
3 | 12-Hour (Short) |
03 | 12-Hour |
4 | Minute (Short) |
04 | Minute |
MST | Timezone name |
-07001 | Timezone offset (±hhmm) |
-07:001 | Timezone offset (±hh:mm) |
-071 | Timezone offset (±hh) |
-0700001 | Timezone offset (±hhmmss) |
-07:00:001 | Timezone offset (±hh:mm:ss) |
📌 All time format values are case-sensitive.
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...
- $onJoined[]
- Moderation And Server Management Related Commands
- $addReactions and $addCmdReactions
- $time
- Economy Related Commands
- Leaderboards
- Bot Issues
- 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.
For Mobile
Before starting, make sure you have Developer Mode enabled on Discord.
Using a Function
Using the $channelID
, $mentionedChannels
or $findChannel
functions, you can get the Channel ID of the desired channel.
Check out these functions:
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:
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.
Moderation And Server Management Related Commands
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.
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.
- If you're trying to kick a user.
- If you're trying to timeout a user.
- If you're trying to change user's nickname.
⚠ 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.
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 and $addCmdReactions
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[😂]
- Custom emojis.
You must use the Emoji ID form of the desired emoji.- $addCmdReactions[:pikachu:] - $addCmdReactions[\:pikachu:] + $addCmdReactions[<:pikachu:951437967711420456>]
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]
Economy Related Commands
- 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 Name | Default Variable Value | Our Variable Value | Target's Variable Value |
---|---|---|---|
Money | 0 | 100 | 120 |
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".
Argument | Content |
---|---|
1st - Target | Afternoon |
2nd - Amount | 50 |
3rd - Comment | Happy 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
-
Checks the number of arguments in the code.$if[$argCount[$message]<2] $color[FF544C] $title[Payment System] $description[Missing Argumets! Example Command: `!pay <user> <amount> (comment)`] $stop $endif
If there are less than 2 arguments, an embed error will be returned and code execution will be stopped. -
Argument formatting.$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]]]
-
Calculates the our future balance after making a payment.$var[ourNewBalance;$sub[$getUserVar[Money];$var[amount]]]
-
-
Checks if the target is present on the current server.$if[$var[target]==] $color[FF544C] $title[Payment System] $description[User (1st argument) not found on the server!] $stop $endif
If not, an embed error will be returned and code execution will be stopped. -
Checks if the command author is the target.$if[$var[target]==$authorID] $color[FF544C] $title[Payment System] $description[You cannot pay yourself!] $stop $endif
If yes, an embed error will be returned and code execution will be stopped. -
Checks if the specified amount is a valid number.$if[$isNumber[$var[amount]]==false] $color[FF544C] $title[Payment System] $description[Amount (2nd argument) must be a number!] $stop $endif
If not, an embed error will be returned and code execution will be stopped. -
Checks if the specified amount is an integer.$if[$checkContains[$var[amount];.]==true] $color[FF544C] $title[Payment System] $description[Amount (2nd argument) must be an integer!] $stop $endif
If not, an embed error will be returned and code execution will be stopped.
Exists in order to avoid payments with floating (decimal) numbers. -
Checks if the specified amount is less than 0.$if[$var[amount]<0] $color[FF544C] $title[Payment System] $description[Amount (2nd argument) cannot be less than 0!] $stop $endif
If yes, an embed error will be returned and code execution will be stopped. -
Checks for a comment. If there is no comment (the argument is empty), "Not provided." will be written as comment.$if[$var[comment]==] $var[comment;Not provided.] $endif
-
The main part of the command, where:$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
- Checking whether our balance will be negative. If yes, an embed error will be returned.
- 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]]
- 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
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.
Argument | Content |
---|---|
1st - Bet | 60 |
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
-
Argument formatting.$var[bet;$message[1]]
-
Checks if the bet is a valid number.$if[$isNumber[$var[bet]]==false] $color[FF544C] $title[Roulette] $description[Bet must be a number!] $stop $endif
If not, an embed error will be returned and code execution will be stopped. -
Checks if the bet is an integer.$if[$checkContains[$var[bet];.]==true] $color[FF544C] $title[Roulette] $description[Bet must be an integer!] $stop $endif
If not, an embed error will be returned and code execution will be stopped.
Exists in order to avoid bets with floating (decimal) numbers. -
Checks if the bet is higher than our balance.$if[$var[bet]>$getUserVar[Money]] $color[FF544C] $title[Roulette] $description[The bet cannot be higher than your balance!] $stop $endif
If yes, an embed error will be returned and code execution will be stopped. -
Checks if the bet is less than 0.$if[$var[bet]<0] $color[FF544C] $title[Roulette] $description[The bet cannot be less than 0!] $stop $endif
If yes, an embed error will be returned and code execution will be stopped. -
Manages roulette results. If$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]]
$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
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.
- If you're using the
$setUserVar
/$getUserVar
functions, you should use the$userLeaderboard
function. - If in your're using the
$setVar
/$getVar
functions, you should use the$globalUserLeaderboard
function. - If you're using the
$setServerVar
/$getServerVar
functions, you should use the$serverLeaderboard
function.
The 2nd Reason
(In case you are using the $getLeaderboardValue
function)
You specified the wrong variable type.
- If you're using the
$setUserVar
/$getUserVar
functions, you should specify theuser
as type. - If in your're using the
$setVar
/$getVar
functions, you should specify theglobalUser
as type. - If you're using the
$setServerVar
/$getServerVar
functions, you should specify theserver
as 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 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 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 limits). 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 Doesn't Appear
The 1st Reason
Old version of the application. Make sure that you have a 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 the 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, 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.
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. But BDFD doesn't have such support, so you should not enable this option or choose any other scopes other than bot
and application.commands
.
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 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
- Clearing the application cache and restarting it.
- Using VPN services. This may be the best solution for the 2nd and 3rd reasons, and in some cases for the 1st reason.
- 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:
Random Guy
: 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:
Shiro
: 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.Shiro
: Usually, all nodes are updated by the end of the month.Random Guy
: Allright, thank you! I will wait patiently!Shiro
: 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 button to the response.
Syntax
$addButton[new row?;interaction ID/url;label;style;(disable?;emoji;message ID)]
Parameters
-
new row?
(Type: Bool || Flag: Required)
: If set toyes
the button will appear in a new row. If it's set tono
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 tointeraction ID
which is then used in$onInteraction[ID]
callback orURL
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 tolink
. Check this section for more details. -
disable?
(Type: Bool || Flag: Vacantable)
: If set toyes
the button can't be pressed. Defaults asno
. -
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 totest
.
If
url
is used ininteraction ID/url
argument, it has to start withhttp://
orhttps://
Button Style
Buttons can have different styles (background colors).
Here, are all possible values for style
function argument.
primary
: Blue buttonsecondary
: Gray buttonsuccess
: Green buttondanger
: Red buttonlink
: Redirect button
If
link
style is used, the button won't send any interactions!
Example
$nomention
Hi
$addButton[no;test;Say hello!;primary;no;]
For more info, see the Button 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. Separate emojis using;
.
You can use Unicode emojis and emoji IDs, but not emoji names. For emoji IDs, the bot must be present in the server that the emoji originates from.
List of unicode emojis: 😋 Get Emoji
Example
$nomention
$addCmdReactions[$message]
How to get emoji ID?
This method requires Developer Mode to be enabled!
- Type
\:TheEmojiName:
- Send the message.
- 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>
) - Input the emoji ID into
$addCmdReactions[]
. (e.g$addCmdReactions[<:hollyDab:828628880629825546>]
)
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]
$addField
Adds a field to an embed.
Syntax
$addField[name;value;(inline?;index)]
You can create 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)
: Ifyes
, 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 tono
by default.index
(Type: Integer || Flag: Optional)
: Adds field to specified embed index number. (learn more)
Inline fields may not appear inline on some mobile devices.
Examples
Without inline fields
$nomention
$addField[This is the field name! #1;This is the field value! #1]
$addField[This is the field name! #2;This is the field value! #2]
$addField[This is the field name! #3;This is the field value! #3]
With inline fields
$nomention
$addField[This is the field name! #1;This is the field value! #1;yes]
$addField[This is the field name! #2;This is the field value! #2;yes]
$addField[This is the field name! #3;This is the field value! #3;yes]
$addReactions
Adds reactions to the bot's response.
Syntax
$addReactions[emojis;...]
Parameters
emojis
(Type: Emoji || Flag: Required)
: The emoji(s) the bot reacts with. Separate emojis using;
.
You can use Unicode emojis and emoji IDs, but not emoji names. For emoji IDs, the bot must be present in the server that the emoji originates from.
List of unicode emojis: 😋 Get Emoji
Example
$nomention
Yes or no?
$addReactions[✅;❌]
How to get emoji ID?
This method requires Developer Mode to be enabled!
- Type
\:TheEmojiName:
- Send the message.
- 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>
) - Input the emoji ID into
$addReactions[]
. (e.g$addReactions[<:hollyDab:828628880629825546>]
)
If you're still having issues, check the Troubleshooting page.
$addSelectMenuOption
Adds select menu option to a 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$onInteraction[]
callback. The value has to be unique in the select menu!description
(Type: String || Flag: Emptiable)
: A text which shows up under thelabel
.default?
(Type: Bool || Flag: Vacantable)
: Should the option be selected by default. (yes/no) There can be only one default option!emoji
(Type: Emoji || Flag: Vacantable)
: It shows up next to thelabel
.message ID
(Type: String || Flag: Vacantable)
: ID of a message that should have select menu added to it. 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]
For more info, see the Select Menu Guide.
$addTextInput
Adds a new text input to a modal.
Syntax
$addTextInput[text input ID;style;label;(minimum length;maximum length;required?;value;placeholder)]
You can't add more than 5 text input fields.
Parameters
text input ID
(Type: String || Flag: Required)
: 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, eithershort
orparagraph
.label
(Type: String || Flag: Required)
: 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 themaximum 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 theminimum length
.required?
(Type: Bool || Flag: Optional)
: Whether a user must fill in the text input field, defaults to true. (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 thanminimum length
and no more thanmaximum 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
andparagraph
.
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]
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
$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]
$allMembersCount
Returns the total number of users from every server the bot is in.
Syntax
$allMembersCount
Example
$nomention
I'm serving $allMembersCount users!
$allowMention
Disables replacing mentions in $message
with text.
Syntax
$allowMention
Example
$nomention
$allowMention
$message
With $allowMention
Without $allowMention
$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 roles that can be pinged, leave empty to disable pings for every role. Separate role IDs using;
.
Example
$nomention
$allowRoleMentions[]
I'm pinging <@&858376972303204362>, but no one got notified; wow!
$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 users that can be pinged, leave empty to disable pings for every user. Separate user IDs using;
.
Example
$nomention
$allowUserMentions[]
Hi <@696368083517964288>! I mentioned you, but you didn't get pinged.
$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
- Create two commands and set the trigger
hello
for one command andhelloworld
for the other. - Add the
$alternativeParsing
function to the command code with thehello
trigger.
Code with trigger hello
:
$nomention
$alternativeParsing
$description["hello"]
Code with trigger helloworld
:
$nomention
$description["helloworld"]
- Execute commands
With $alternativeParsing
Without $alternativeParsing
$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 returntrue
. Separate conditions using;
.
Signs
==
- Equal
!=
- Not Equal
<
- Less Than
>
- Greater Than
>=
- Greater Than Or Equal To
<=
- Less Than Or Equal To
Example
$nomention
$if[$and[$username==noituri;$message==Update]==true]
Noit said "Update"!
$endif
$c[The code in the if statement only executes if the user's username is 'noituri', and the message content is 'Update'.]
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 word count for.
Example
$nomention
Word count: $argCount[$message]
$argsCheck
When this function is used, the command can only be executed if the user’s message contains a certain amount of arguments (words).
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 put3
.error message
(Type: String || Flag: Emptiable)
: The message that the bot will send if the user has too many/little arguments.
Example
$nomention
$argsCheck[>1;❌ Please provide something for me to say!]
$noMentionMessage
-
With arguments
-
Without arguments
$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!]
$authorAvatar
Returns the author's avatar URL.
Syntax
$authorAvatar
Example
$nomention
$image[$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.]
$authorID
Returns message's author ID.
Syntax
$authorID
Example
$nomention
This command was written by <@$authorID>!
$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 was sent in.message ID
(Type: Snowflake || Flag: Required)
: The message for which the author ID will be returned.
Example
$nomention
Author of message: $username[$authorOfMessage[$message[1];$message[2]]]
$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]
$awaitFunc
Used to initiate an awaited command.
Syntax
$awaitFunc[name;(user ID;channel ID)]
Parameters
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, ifuser ID
is not given.channel ID
(Type: Snowflake || Flag: Optional)
: The channel where the command will be awaited. Uses current channel, ifchannel ID
is not given.
Example
$nomention
What do you want me to say?
$awaitFunc[say]
For more info, see the Awaited Commands Guide.
$ban
Bans the mentioned user.
Syntax
$ban
Example
$nomention
$ban
<@$mentioned[1]> was banned!
$ban[]
Bans the mentioned user with a reason.
Syntax
$ban[reason]
Parameters
reason
(Type: String || Flag: Emptiable)
: The reason for this action, which will be saved in the audit-log.
Example
$nomention
$ban[$noMentionMessage]
<@$mentioned[1]> was banned!
$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
$banID[]
Bans a user using their ID.
Syntax
$banID[reason;(user ID)]
Parameters
reason
(Type: String || Flag: Emptiable)
: The reason for this action, 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]]
$blackListIDs
Blocks certain users from using the command.
Syntax
$blackListIDs[user IDs;...;error message]
Parameters
user IDs
(Type: Snowflake || Flag: Emptiable)
: The users to blacklist from using the command. Separate user IDs with;
.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
$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. Separate role names using;
.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
$blackListRolesIDs
Block users with certain roles from using the command. If the user has any role in the blacklist, they will not be able to run the command.
Syntax
$blackListRolesIDs[role IDs;...;error message]
Parameters
role IDs
(Type: Snowflake || Flag: Emptiable)
: The roles that will be blacklisted. Separate role IDs using;
.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
$blackListServers
Disables this command for the provided servers.
Syntax
$blackListServers[guild IDs;..;error message]
Parameters
guild IDs
(Type: Snowflake || Flag: Emptiable)
: The servers to blacklist. Separate server IDs using;
.error message
(Type: String || Flag: Emptiable)
: The error to display when the server is blacklisted.
Example
$nomention
$blackListServers[1009018669982031912;❌ You can't use this command!]
**Hello $username!**
*Guild ID: $guildID*
$blackListUsers
Disables the command for users with usernames matching the ones provided.
Syntax
$blackListUsers[usernames;...;error message]
Parameters
usernames
(Type: String || Flag: Emptiable)
: The usernames to blacklist. Separate names using;
.error message
(Type: String || Flag: Emptiable)
: Message when user's name is in the blacklist.
Example
$nomention
$blackListUsers[RainbowKey;❌ You can't use this command!]
Hello $username!
$boostCount
Returns the guild's number of nitro boosts.
Syntax
$boostCount
Example
$nomention
This server currently has $boostCount boost(s).
$boostCount[]
Returns the 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).
$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[🔹]
$botID
Returns the bot's ID.
Syntax
$botID
Example
$nomention
My ID is: $botID
$botLeave
Forces the bot to leave the current server.
Syntax
$botLeave
Example
$nomention
$sendMessage[I left this server!]
$botLeave
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[]
Makes the bot leave the server matching the provided server ID.
Syntax
$botLeave[guild ID]
Parameters
guild ID
(Type: Snowflake || Flag: Required)
: The ID of a guild to leave.
Example
$nomention
$sendMessage[I left out `$serverName[$message]` server]
$botLeave[$message]
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!]
$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
-
Create two commands and set the trigger
!ping
for one command and!secret
for the other. -
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!]
-
Execute commands
-
With $botListHide
-
Without $botListHide
-
$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
$botOwnerID
Returns the bot owner's ID.
Syntax
$botOwnerID
Example
$nomention
My owner's ID: $botOwnerID
$botTyping
This function tells Discord that the bot is typing.
Syntax
$botTyping
Example
$nomention
$botTyping
Hello $username!
-
Command started:
-
Command completed:
$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!]
$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.()
- Parentheses you can put equations in.
Example
$nomention
$enableDecimals[yes]
$calculate[$message] 🧠
$categoryChannels
List channel property under given category.
Syntax
$categoryChannels[category ID;separator;(option)]
Parameters
category ID
(Type: Snowflake || Flag: Required)
: The category from which to take 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 isname
)
Options
name
: The name of the channels.id
: The id of the channels.mention
: The channel mentions.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]>
$categoryCount
Returns the category count of the current guild.
Syntax
$categoryCount
Example
$nomention
There are $categoryCount 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!
$categoryID
Returns category ID for 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]
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
Name | Type |
---|---|
%time-d% | Day |
%time-h% | Hour |
%time-m% | Minute |
%time-s% | Second |
Example
$nomention
Hello $username!
$changeCooldownTime[Days⏰;Hours⏰;Mins🕧;Secs🕧]
$cooldown[10m;Please wait %time-m%!]
$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 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`.
$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[$findUser[$message[1]];$message[2]]
$channelCount
Returns the amount of channels in the current server.
Syntax
$channelCount
Example
$nomention
There are $channelCount 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]
$channelID
Returns the ID of the current channel.
Syntax
$channelID
Example
$nomention
Channel ID: $channelID
It will return
none
if you use it in a DM.
$channelID[]
Returns 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]
It supports category names.
$channelDFromName
Returns a channel's ID from it's name.
This function is deprecated. Use
$channelID[]
instead.
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]
$channelName
Returns the name for the provided channel ID.
Syntax
$channelName[channel ID]
Parameters
channelID
(Type: Snowflake || Flag: Required)
: The channel which name will be returned.
Example
$nomention
Channel Name: `#$channelName[$channelID]`
$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[
#]
It can return names of the
category
,channel
,forum
.
$channelPosition
Returns the position of the current channel.
Syntax
$channelPosition
Example
$nomention
Channel Position: $channelPosition
$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.
Example
$nomention
Channel Position: $channelPosition[$mentionedChannels[1;yes]]
$channelSendMessage
Sends a message in the provided channel.
Usage
$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
$channelSendMessage[835108724846493726;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
$channelTopic[]
Returns the topic of a channel by it's ID.
Syntax
$channelTopic[channel ID]
Parameters
channel ID
(Type: Snowflake || Flag: Required)
: The channel to return its topic.
Example
$nomention
<#$noMentionMessage> topic: $channelTopic[$noMentionMessage]
$channelType
Returns channel type.
Syntax
$channelType[channel ID]
The different channel types that the bot will return are:
text
,voice
,category
,thread
,dm
,stage
,announcement
andforum
.
Parameters
channel ID
(Type: Snowflake || Flag: Required)
: The channel which type will be returned.
Example
$nomention
$channelType[$channelID]
$charCount
Gets 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
$charCount[$message]
🧙♂️ This example would return how many characters were in the author's message.
$checkCondition
Checks if a condition is true
or false
.
Usage
$checkCondition[condition]
Parameters
condition
(Type: String || Flag: Required)
: The condition to check.
Explanation
Simply put, $checkCondition
serves as a way to make a custom true or false statement. For example: $checkCondition[$username==Spen]
, the bot would return "true" if someone named Spen used the command, otherwise it would return "false". However this: $checkCondition[$username!=Spen]
, would return "false" if someone named Spen used the command, otherwise it would return "true".
Base Usage: $checkCondition[value1(sign)value2]
What's Sign? Replace (sign) with one of these.
==
- Should be equal!=
- Should be not equal<
- Should be less than (only numbers)>
- Should be greater than (only numbers)>=
- Should be greater than or equal to (only numbers)<=
- Should be less than or equal to (only numbers)
What Are Values?
The value is what the bot is checking. Like one of the examples above: $checkCondition[$username==Spen]
.
- value1 is $username
- sign is ==
- value2 is Spen
$checkContains
Checks if the 'text' contains 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]
$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 administrator. F in the chat!]
You aren't a admin!
$clear
Deletes a certain amount of messages.
Usages
There are two usages of the $clear
function.
Usage #1
$clear
When using just
$clear
, the author's message must include a number.
Usage #2
$clear[how many?;(user ID;remove pinned messages?)]
Parameters
how many?
(Type: Integer || Flag: Required)
: How many messages to delete. (max 100)user ID
(Type: Snowflake || Flag: Vacantable)
: If a userID 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 isyes
.
Discord doesn't allow deleting messages in bulk which are over 2 weeks old.
Example
$nomention
$onlyPerms[managemessages;You need the 'MANAGE_MESSAGES' permission to use that!]
$argsCheck[>1;Please provide how many messages to clear. Usage: !purge (number)]
$clear[$message]
$clearReactions
Removes reactions from the provided message.
Syntax
$clearReactions[channel ID;message ID;emoji]
Parameters
channelID
(Type: Snowflake || Flag: Required)
: The channel that the message belongs to.messageID
(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.
$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 is1
. (learn more)
Example
$nomention
$description[⬅️ That is the embed color border!]
$color[#673ab7]
$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
$onlyPerms[manageroles;You need the manage_roles permission to use that!]
$argsCheck[>2;Please provide the needed arguments! The `colorHex` and `role` arguments are needed.]
$colorRole[$noMentionMessage]
✅ Changed role color!
$commandsCount
Returns how many commands the bot has total.
Syntax
$commandsCount
Example
$nomention
I have $commandsCount 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. (e.g30s
,3m
,3h
,3d
, etc)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.
%time%
returns how much time is left on the cooldown.
Example
$nomention
$cooldown[30s;Please wait %time%, then use that command again!]
Hi!
$createChannel
Creates a channel.
Syntax
$createChannel[name;type;(category ID)]
Parameters
name
(Type: String || Flag: Required)
: The name of the new channel.
Channel names can have a maximum of upto 100 characters.
type
(Type: Enum || Flag: Required)
: The channel type. Channel types:category
text
voice
stage
forum
category ID
- The category to put the channel in (if applicable).
Example
$nomention
$createChannel[cool-channel;text]
$createRole
Creates a new role.
Syntax
$createRole[role name;color hex;hoist?;mentionable?]
Parameters
role name
(Type: String || Flag: Required)
: The name to give the new role.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.
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
$nomention
$createRole[Cool Role;#FFFF00;yes;no]
Created new role!
$creationDate
Returns the creation date of any valid Discord Snowflake ID.
Syntax
$creationDate[ID;(format)]
Parameters
ID
(Type: Snowflake || Flag: Required)
: The ID from which to get the creation date. The ID can be aUserID
, aRoleID
, aMessageID
, or aServerID
.format
(Type: String || Flag: Optional)
: Customize the default time format output.
Uses GoLang date format
Click me to check all supported time format values.
Example
-
Default format
$nomention $creationDate[$authorID]
-
Custom format
$nomention $creationDate[$authorID;January 2, 2006 at 3:04 PM (MST -07: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[$noMentionMessage;100;...]
$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]
$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
$day
Returns the current day of the month.
🧙♂️ You can use $time to change the timezone.
Usage
$day
Example
$nomention
Today Is: $day
$defer
Defers response to an interaction from components and slash commands.
Usage
$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
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]
$deleteChannels
Deletes the provided channel(s).
Usage
$deleteChannels[channelIDs]
Parameters
channels
(Type: Snowflake || Flag: Required)
: The channels to delete. Separate channel IDs using;
.
Example
$nomention
$argsCheck[>1;Please mention a channel!]
$onlyPerms[managechannels;You need the manage channels permission to use that!]
Successfully deleted $channelName[$mentionedChannels[1]]!
$deleteChannels[$mentionedChannels[1]]
$deleteChannelsByName
Deletes all channels matching the names provided.
Usage
$deleteChannelsByName[channelName;...]
Parameters
channelName
(Type: String || Flag: Required)
: The name(s) of the channel(s) to delete. Use;
to separate channel names.
$deletecommand
Deletes the author's message.
🧙♂️ The bot must have the
manage_messages
permission.
Usage
$deletecommand
$deleteIn
Deletes the bot's response in after the provided duration.
Usage
$deleteIn[duration]
Parameters
duration
(Type: Duration || Flag: Required)
: The time to wait before deleting the message (e.g3s
,30s
,1m
, etc). Max duration is40m
.
Example
$nomention
Hello World!
$deleteIn[3s]
$deleteMessage
Deletes a message
Usage
$deleteMessage[channel ID;message ID]
Parameters
channel ID
(Type: Snowflake || Flag: Required)
: The channel ID where the message is.message ID
(Type: Snowflake || Flag: Required)
: The ID of the message which will be deleted.
Example
$nomention
$deleteMessage[$channelID;$messageID]
Hello $username!
$deleteRole
Deletes a role.
Usage
$deleteRole[roleID]
Parameters
roleID
(Type: Snowflake || Flag: Required)
: The role to delete.
Example
$nomention
$onlyPerms[manageroles;You are missing permissions!]
$argsCheck[>1;Please provide a role to delete!]
$onlyIf[$findRole[$message]!=;Invalid role!]
$deleteRole[$findRole[$message]]
Deleted role!
$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 is1
. (learn more)
Example
$nomention
$description[This is a description! 😎]
$disableInnerSpaceRemoval
Disables the removal of multiple spaces from within the message
Syntax
$disableInnerSpaceRemoval
Example
$disableInnerSpaceRemoval
Hello $username!
Output Without
Output With
$disableSpecialEscaping
(for advanced users)
Disables escaping for ;
and $
(e.g. %{-SEMICOL-}%
gets interpeted as a regular ;
).
Usage
$disableSpecialEscaping
Example
$nomention
$disableSpecialEscaping
%{DOL}%replaceText[Hello World!%{-SEMICOL-}%World%{-SEMICOL-}%Planet%{-SEMICOL-}%1]
$discriminator
Returns a user's discriminator (the 4 digit number at the end of their username).
Usages
There are two usages of the $discriminator
function.
Usage #1
$discriminator[userID]
Parameters
userID
(Type: Snowflake || Flag: Emptiable)
: The user to get the discriminator from.
Usage #2
$discriminator[]
Returns the author's discriminator.
Example
$nomention
Hello $username#$discriminator[]!
$divide
Divides the provided numbers.
Syntax
$divide[numbers]
Parameters
numbers
(Type: Integer, Float || Flag: Required)
: The numbers to divide. Separate numbers using;
.
Example
$nomention
$argsCheck[>2;❌ Please provide the needed arguments! Usage: `!divide (number1) (number2)`]
Answer: $divide[$message[1];$message[2]]
$dm
Direct messages a user.
Usages
There are three possible usages of the $dm
function.
Usage #1
$dm
This will send the message to the user that runs the command.
Usage #2
$dm[]
This will send the message to the first mentioned user.
Usage #3
$dm[UserID;...]
This will send the message to every user with given User ID.
Parameters
userID
(Type: Snowflake || Flag: Emptiable)
: The user to whom to send the direct message.
Note
If the command fails to send the message, make sure the user allows dm 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
$editButton
Edits already existing button.
Usage
$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)
: new label of displayed on the button -
Style
(Type: Enum || Flag: Required)
: Here, are all possible values for thestyle
argument:primary
secondary
success
danger
link
-
Disabled
(Type: Bool || Flag: Vacantable)
: If set toyes
the button can't be pressed. Defaults asno
-
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.
Example
Interaction command code
$username said hello!
$editButton[test;Say hello!;primary;yes;]
$addButton[no;http://botdesignerdiscord.com;Check our website;link;no;👀]
For more info, see the Button Guide.
$editChannelPerms
Changes permission for mentioned users/roles in this particular channel.
Usage
$editChannelPerms[channel ID;userID/RoleID;permission;...]
Parameters
channel ID
(Type: Snowflake || Flag: Required)
: place the ID of the channel to which the roles are modified.userID/RoleID
(Type: Snowflake || Flag: Emptiable)
: place the ID of the role or user whose permissions will be modified.permission
(Type: Permission || Flag: Required)
: the permission(s) to be modified.+
- set + to add permission.-
- set - to remove the permission.
🧙🏻♂️ You can see the available permissions here in Permissions
Example
$nomention
$onlyPerms[managechannels; ❌ You need the manage_channels permission to use that!]
$editChannelPerms[$channelID;$mentionedRoles[1];-sendmessages]
✅ Now the role cannot send messages
$editEmbedIn
Edits the bot's message after the given time, as an embed.
Usage
$editEmbedIn[time;(title;description;footer;color)]
📝 Optional fields can be left empty. At least one embed field (
title
,description
, orfooter
) needs to be inputted.
Parameters
-
time
(Type: Duration || Flag: Required)
: The time to wait before editing the message (e.g3s
,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. Use0
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
After
$editIn
Edits the bot's response after the given time.
Usage
$editIn[time;newMessage]
Parameters
time
(Type: Duration || Flag: Required)
: The time to wait before editing the message (e.g3s
,30s
,10m
). Max is40m
.newMessage
(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
After
$editMessage
Edits one of the bot's messages.
Usage
$editMessage[channelID;messageID;content;(title;description;color;footer)]
Parameters
channelID
(Type: Snowflake || Flag: Required)
: The channel that this message belongs to.messageID
(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
After
$editSelectMenu
Edits select menu.
Usage
$editSelectMenu[menu ID;min;max;(placeholder;message ID)]
Parameters
-
menu ID
(Type: String || Flag: Required)
: The menu ID 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)
: It's a 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]
For more info, see the Select Menu Guide.
$editSelectMenuOption
Edits select menu.
Usage
$editSelectMenuOption[menu option ID;label;value;description;(default;emoji;message ID)]
Parameters
menu option ID
(Type: String || Flag: Required)
: 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)
: 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)
: it shows up under thelabel
.default
(Type: Bool || Flag: Vacantable)
: should the option be selected by default. There can be only one default option!emoji
(Type: Emoji || Flag: Vacantable)
: it shows up next to thelabel
.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️⃣]
For more info, see the Select Menu Guide.
$editSplitText
Edits a splitted text element using it's 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[$sub[$getTextSplitLength;1]]
$textSplit[$joinSplitText[ ];]
$editSplitText[$var[Index];$var[Value]]
Original Text: $joinSplitText[ ]
New Text: $joinSplitText[]
$editThread
Modifies a existing thread.
Usage
$editThread[threadID;(name;archived;archiveDuration;locked;slowmode)]
Parameters
threadID
(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.archiveDuration
(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.
$embeddedURL
Sets the title to be a hyperlink.
>📝 Only works if $title
is also used.
Usage
$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 is1
. (learn more)
Example
$nomention
$title[Bot Designer For Discord]
$embeddedURL[https://botdesignerdiscord.com]
$description[Hello World!]
$color[#683cb4]
$embedSuppressErrors
Suppresses the error messages, responds with the embed if there is a error.
Usage
$embedSuppressErrors[title;description;(color;author;footerText;footerIcon)]
🧙♂️ All fields are optional, leave the field empty to not include it. Atleast one field needs to be inputted, however.
$embedSuppressErrors[Error!;There was a error!;;;;]
- this is correct.$embedSuppressErrors[Error!;There was a error!]
- this is incorrect.
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.footerText
(Type: String || Flag: Vacantable)
: The embed footer text.footerIcon
(Type: URL || Flag: Vacantable)
: The embed footer icon, must be a valid image URL.
$emoteCount
Returns the number of emojis in the current server.
Usage
$emoteCount
Example
$nomention
There are $emoteCount emojis in $serverName[$guildID]!
$enabled
Allows you to enable/disable commands.
Usage
$enabled[enabled;errorMessage]
Parameters
enabled
(Type: Bool || Flag: Required)
: 'yes' means the command is enabled, 'no' means it's disabled.errorMessage
(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.
-
Create a variable named
enabled
and set the value toyes
orno
(whatever you want the default option to be.no
- disabled,yes
- enabled.) -
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!
-
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!
-
In the command(s) you want the enable/disable to affect, put:
$enabled[$getServerVar[enabled];❌ This command is disabled!]
-
Now your bot has a system where servers can disable/enable command(s).
📝 In order to make this changeable for multiple commands, you'll need to do it multiple times (using different variable names). As this only affects the commands you put the "affect" code in.
$enableDecimals
Enables/disables decimals in math functions.
Usage
$enableDecimals[enable]
Parameters
enable
(Type: Bool || Flag: Required)
: Whether to enable decimals in math functions or not,yes
means it's enabled andno
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.
Enabling decimals:
$enableDecimals[yes]
🧙♂️
$calculate
ignores$enableDecimals
.
$ephemeral
Makes the bot's response ephemeral.
Usage
$ephemeral
⚠️ You can get an ephemeral response only through an interaction (Slash commands, button, select menus etc.)
Example
$eval
Evaluates the provided BDScript code.
⚠️ Can only be used in BDScript 2, this function should be used with caution.
Usage
$eval[BDScript source code]
Parameters
BDScript source code
(Type: String || Flag: Emptiable)
: The code to be evaluated.
Example
$nomention
$eval[$message]
It is recommended to restrict the command to be only used by the bot developers, this can be done with $onlyForIDs.
$executionTime
Returns how long the command took to execute, in milliseconds.
Usage
$executionTime
$findChannel
Finds a channel's ID from the given channel name, ID, or mention.
Usage
$findChannel[channel]
Parameters
channel
(Type: String || Flag: Emptiable)
: The channel name/ID/mention to find.
Example
$nomention
$findChannel[$message]
$findRole
Finds a role's ID using the given role name, ID, or mention.
Usage
$findRole[role]
Parameters
role
(Type: String || Flag: Emptiable)
: The role name, ID, or mention to find.
Example
$nomention
$findRole[$message]
$findUser
Finds a user's ID using username, ID, or mention.
Usage
$findUser[user;(returnAuthorID)]
Parameters
user
(Type: String || Flag: Emptiable)
: The user's username, ID, or mention to find.returnAuthorID
(Type: Bool || Flag: Optional)
: Whether to return the author ID if no user was found. The default isyes
.
Example
$nomention
$findUser[$message]
$footer
Sets the embed footer text.
Usage
$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 is1
. (learn more)
Example
$nomention
$footer[Hi! I'm a footer.]
$footerIcon
Sets the embed footer icon.
🧙♂️ There must be footer text in order to set the footer icon.
Usage
$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 is1
. (learn more)
Example
$nomention
$footer[⬅️ That is a footer icon!]
$footerIcon[$authorAvatar]
$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 forGuild ID
(Type: Snowflake || Flag: Optional)
: The server id from which to get the ban reason.
Example
$nomention
Ban Reason: $getBanReason[154148273307910144]
$getBotInvite
Returns the bot's invite URL.
Usage
$getBotInvite
Example
$nomention
Invite Me! $getBotInvite
$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.
$getCooldown
Returns how long is left on the cooldown, in seconds; can be used in the 'errorMessage' field of cooldown functions.
Usage
$getCooldown[cooldownType (normal/server/global)]
Parameters
cooldownType
(Type: Enum || Flag: Required)
: The cooldown type (normal - $cooldown | server - $serverCooldown | global - $globalCooldown).
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
Your custom status: $getCustomStatus[$authorID]
$getEmbedData
Fetches embed data from the provided message.
Usage
$getEmbedData[channelID;messageID;embedIndex;embedProperty (title/description/footer/color/image/timestamp)]
Parameters
channelID
(Type: Snowflake || Flag: Required)
: The channel this message belongs to.messageID
(Type: Snowflake || Flag: Required)
: The message to get this embed data from.embedIndex
(Type: HowMany || Flag: Required)
: The embed of this message to get data from. Use1
for the first embed of this message.embedProperty
(Type: Enum || Flag: Required)
: The embed property to return.
Example
$nomention
Title: $getEmbedData[876920205526319144;878299081380876339;1;title]
Description: $getEmbedData[876920205526319144;878299081380876339;1;description]
Footer: $getEmbedData[876920205526319144;878299081380876339;1;footer]
$getInviteInfo
Returns information about a invite code.
Usage
$getInviteInfo[inviteCode;inviteProperty]
Parameters
-
inviteCode
(Type: String || Flag: Required)
: The invite code to get info about. -
inviteProperty
(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]
$getLeaderboardValue
Gets a leaderboard value.
Usage
$getLeaderboardValue[variableType (user/globalUser/server);variableName;sortType;position;(returnType (id/value))]
variableType
(Type: Enum || Flag: Required)
: The variable type.variableName
(Type: String || Flag: Required)
: The variable name to generate the leaderboard for.sortType
(Type: Enum || Flag: Required)
: Whether to sort the values in ascending (asc) or descending (desc) order.position
(Type: HowMany || Flag: Required)
: The leaderboard position to get, e.g1
,3
, etc.returnType
(Type: Enum || Flag: Optional)
: The return type. Types:- none - If this field is excluded, it will return
Username - Value
. - id - Returns the ID of the user belonging this position.
- value - Returns the variable value of this position.
- none - If this field is excluded, it will return
Example
$nomention
$title[**Global Leaderboard**]
$description[#1 - $getLeaderboardValue[globalUser;Money;asc;1]
#2 - $getLeaderboardValue[globalUser;Money;asc;2]
#3 - $getLeaderboardValue[globalUser;Money;asc;3]
#4 - $getLeaderboardValue[globalUser;Money;asc;4]
#5 - $getLeaderboardValue[globalUser;Money;asc;5]
#6 - $getLeaderboardValue[globalUser;Money;asc;6]
#7 - $getLeaderboardValue[globalUser;Money;asc;7]
#8 - $getLeaderboardValue[globalUser;Money;asc;8]
#9 - $getLeaderboardValue[globalUser;Money;asc;9]
#10 - $getLeaderboardValue[globalUser;Money;asc;10]]
$color[FFFF00]
$c[This is for global-user variables.]
$getMessage
Gets data from a message, with the provided message and channel IDs.
Usage
$getMessage[channelID;messageID;(property)]
Parameters
channelID
(Type: Snowflake || Flag: Required)
: The channel that this message belongs to.messageID
(Type: Snowflake || Flag: Required)
: The message to get the data from.property
(Type: Enum || Flag: Optional)
: The message data to get. The default iscontent
. 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]]]
$getReactions
Returns a list of users separated by separator
that reacted to a message.
Usage
$getReactions[channelID;messageID;separator;emoji]
Parameters
channelID
(Type: Snowflake || Flag: Required)
: The channel that the message belongs to.messageID
(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>]
$getRoleColor
Returns a role's color hex.
Usage
$getRoleColor[roleID]
Parameters
roleID
(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]]]
$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
$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.
Permissions
Required permissions that the bot must have for this function to work properly :
createinstantinvite
Example
$nomention
$getServerInvite[$message[1]]
$getServerVar
Returns the value of the provided server variable.
Usage
$getServerVar[variableName;(guildID)]
Parameters
variableName
(Type: String || Flag: Required)
: The name of the variable to get.guildID
(Type: Snowflake, String || Flag: Optional)
: The server to get the value for. If no guild ID is inputted, then the current server is used.
$getTextSplitIndex
Retrieves index from the provided value in $textSplit
. Returns -1 if it couldn't find the value.
Usage
$getTextSplitIndex[value]
Parameters
value
(Type: String || Flag: Emptiable)
: The value to search in the text split.
Example
$nomention
$textSplit[Cake-Bread;-]
$getTextSplitIndex[$message[1]]
See more in the Text Splitting guide...
$getTextSplitLength
Returns the number of splits in $textSplit
.
🧙♂️ This function can't be used, if
$textSplit
isn't present in the code.
Usage
$getTextSplitLength
See more in the Text Splitting guide...
$getTimestamp
Returns the current unix timestamp in seconds.
Syntax
$getTimestamp
Example
$nomention
Unix Timestamp: $getTimestamp
📄 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
:pencil: 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]
📄 For more info about UNIX timestamps on Discord click here.
$getUserStatus
Returns the provided user's status.
🧙♂️ The user must share atleast 1 server with the bot, for this function to work.
Usage
$getUserStatus[userID]
Parameters
userID
(Type: Snowflake || Flag: Required)
: The user to get the status for.
Statuses List
- online
- dnd
- idle
- offline
Example
$nomention
$nickname[$mentioned[1;yes]]'s status is: $getUserStatus[$mentioned[1;yes]]
$getUserVar
Returns a local-user variable value.
Usage
$getUserVar[variableName;(userID;guildID)]
Parameters
variableName
(Type: String || Flag: Required)
: The name of the variable to get.userID
(Type: String, Snowflake || Flag: Vacantable)
: The user to get the variable value for. If no user is provided, the author is used.guildID
(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.
$getVar
Gets a global/global-user variable.
Usage
$getVar[variableName;(userID)]
🧙♂️ For a global variable, a
userID
doesn't need to be provided. For a global-user variable,userID
must be provided.
Parameters
variableName
(Type: String || Flag: Required)
: The name of the variable to get the value from.userID
(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!
Additional Reading
Check our Variable Guide!
$giveRole
(deprecated)
🧙♂️ This command is deprecated instead better use $roleGrant.
Adds a role to the provided user.
Usages
There are two usages of the $giveRole
function.
Usage #1
$giveRole[userID;roleID]
Gives a role to the provided user.
Breakdown
userID
- The user to give the role to.roleID
- The role to give the user.
Usage #2
$giveRole[roleID]
Gives the provided role to the mentioned user.
Breakdown
roleID
- The role to give the mentioned user.
Example
$onlyPerms[manageroles;Missing permissions!]
$giveRole[807004801753284618]
Added $roleName[807004801753284618] to $username[$mentioned[1]]!
$globalCooldown
Applies a cooldown to the command, the user can not run the command in any server until the 'duration' is up. (Unlike $cooldown
, which only applies the cooldown to the user in the current server)
Usage
$globalCooldown[duration;errorMessage]
Parameters
duration
(Type: Duration || Flag: Required)
: The duration until the user can use this command again.errorMessage
(Type: String || Flag: Emptiable)
: The message to return when the cooldown duration is still ongoing.
🧙♂️ You can use
%time%
to get how much time is left until the cooldown is over, in the 'errorMessage'.
$globalUserLeaderboard
Returns the top ten user's username and value for the given global-user variable.
Usage
$globalUserLeaderboard[variableName;sortType (asc/desc)]
Parameters
variableName
(Type: String || Flag: Required)
: The variable to create the leaderboard for.sortType
(Type: Enum || Flag: Optional)
: Whether to sort the leaderboard in ascending (asc
) or descending (desc
) order.
🧙♂️
$globalUserLeaderboard
automatically generates a description. So,$description
should not be used in the code.
Example
$nomention
$globalUserLeaderboard[Money;asc]
$guildExists
Returns 'true' if the provided server exists, otherwise 'false' is returned. Returns 'false' if the bot isn't present in the server.
Usage
$guildExists[guildID]
Parameters
guildID
(Type: Snowflake, String || Flag: Emptiable)
: The ID of the hypothetical server.
$guildID
Returns the current server's ID.
Syntax
$guildID
Example
$nomention
Server ID is : $guildID
$guildID[]
Finds a server ID using a server's name.
Syntax
$guildID[serverName]
Parameters
serverName
(Type: String || Flag: Emptiable)
: Finds a server ID using a server's name.
Example
$nomention
$noMentionMessage ID is : $guildID[$noMentionMessage]
🧙♂️ Note: The bot can not find the ID of a server that it isn't in.
$hasRole
Returns whether or not a user has the provided role.
🧙♂️ 'true' means the user has the role, 'false' means they don't.
Usage
$hasRole[userID;roleID]
Parameters
userID
(Type: Snowflake || Flag: Required)
: The user to check for the role.roleID
(Type: Snowflake || Flag: Emptiable)
: The role that the bot is checking the user for.
Example
$nomention
$hasRole[$authorID;858376972303204362]
$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)
$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]])
$highestRoleWithPerms
Returns the highest role in the server that has all the provided permissions.
Usage
$highestRoleWithPerms[permissions]
Parameters
permissions
(Type: Permission || Flag: Required)
: The permissions that the role needs to have. (see permissions list)
Example
$nomention
Highest Role with Administrator: $roleName[$highestRoleWithPerms[admin]] ($highestRoleWithPerms[admin])
$hostingExpireTime
Returns expire time for the hosting
Usage
$hostingExpireTime[unix timestamp?]
Parameters
unix timestamp
(Type: Bool || Flag: Optional)
: Whether to return the expiration time in Unix Timestamp or not.
Example #1
$nomention
$hostingExpireTime
Example #2
$nomention
I will be offline <t:$hostingExpireTime[yes]:R>
$hour
Returns the current hour.
🧙♂️ You can use $time to change the timezone.
Note: The
$hour
function uses the twenty-four-hour clock instead of two groups of twelve hours; this also known as, Military Time.
Usage
$hour
Example
$nomention
Current Hour: $hour
$hypesquad
Returns the hypesquad name of the provided user
Usage
$hypesquad[userID]
Parameters
userID
(Type: Snowflake || Flag: Required)
: ID of the user whose hypesquad name should be returned
Example
$nomention
You are in $hypesquad[$authorID] house.
$ignoreChannels
The command can't be executed in any of the provided channels. If the channel is ignored, then the 'errorMessage' is returned.
Usage
$ignoreChannels[channelIDs;...;errorMessage]
Parameters
channelIDs
(Type: Snowflake || Flag: Emptiable)
: The channels to ignore. Separate IDs using;
.errorMessage
(Type: String || Flag: Emptiable)
: The message that is returned when the channel is ignored.
$ignoreLinks
Ignores image links in the message
Usage
$ignoreLinks
Example
$ignoreLinks
Here's a toaster IRL:
https://media.discordapp.net/attachments/1011682358031826994/1027580044928888832/856506821023629332.png
With $ignoreLinks
Without $ignoreLinks
$image
Adds a image to the embed.
Usage
$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 is1
. (learn more)
Example
$nomention
$image[$userAvatar[$botID]]
$input
Retrieves input from modal.
Usage
$input[Text Input ID]
Parameters
Text Input ID
(Type: String || Flag: Required)
: input ID in $addTextInput
Example
Interaction command code
$nomention
Name : $input[modalInput1]
Pronouns : $input[modalInput2]
About me : $input[modalInput3]
For more info, see the Modals Guide.
$isAdmin
Returns whether or not the provided user has the administrator permission.
🧙♂️ 'true' means the user has the administrator permission, 'false' means they don't.
Usage
$isAdmin[userID]
Parameters
userID
(Type: Snowflake || Flag: Required)
: The user to check.
Example
$nomention
Are You A Admin?: `$isAdmin[$authorID]`
$isBanned
Returns 'true' if user is banned, otherwise it returns 'false'. Requires 'BAN_MEMBERS' permission
Usage
$isBanned[user ID]
Parameters
user ID
(Type: Snowflake || Flag: Required)
: The user to check its ban status.
Example
$nomention
$isBanned[$mentioned[1]]
$isBoolean
Returns whether or not the provided 'text' is a boolean.
🧙♂️ 'true' means the text is a boolean, 'false' means it isn't.
Supported Booleans
Positive | Negative |
---|---|
true | false |
yes | no |
on | off |
enable | disable |
Usage
$isBoolean[text]
Parameters
text
(Type: String || Flag: Emptiable)
: The text to check.
Example
$nomention
$isBoolean[$message]
$isBot
Returns whether or not the provided user is a bot.
🧙♂️ 'true' means the user is a bot, 'false' means the user is not a bot.
Usage
$isBot[userID]
Parameters
userID
(Type: Snowflake || Flag: Emptiable)
: The user to check.
Example
$nomention
Bot? $isBot[$findUser[$message]]
$isHoisted
Returns if a role is displayed separately.
🧙♂️ 'true' means the role is hoisted, 'false' means the role isn't hoisted.
Usage
$isHoisted[roleID]
Parameters
roleID
(Type: Snowflake || Flag: Required)
: The role to check its hoisted status.
Example
$nomention
$isHoisted[$findRole[$message]]
$isMentionable
Returns whether or not a role is mentionable by everyone.
🧙♂️ 'true' means the role is mentionable, 'false' means it isn't.
Usage
$isMentionable[roleID]
Parameters
roleID
(Type: Snowflake || Flag: Required)
: The role to check for its mentionable status.
Example
$nomention
$isMentionable[$findRole[$message]]
$isNSFW
Returns whether the provided channel is NSFW (not-safe-for-work) or not.
🧙♂️ 'true' means the channel is NSFW, 'false' means it isn't.
Usage
$isNSFW[channelID]
Parameters
channelID
(Type: Snowflake || Flag: Required)
: The channel to check.
Example
$nomention
Is <#$channelID> NSFW?: `$isNSFW[$channelID]`
$isNumber
Returns whether or not the provided value is a number.
🧙♂️ 'true' means the value is a number, 'false' means it isn't.
Usage
$isNumber[value]
Parameters
value
(Type: String || Flag: Emptiable)
: The text to check.
Example
$nomention
$isNumber[$message]
$isSlash
Returns whether the command was ran as a slash command or not.
🧙♂️ 'true' means the command was ran as a slash command, 'false' means it wasn't.
Usage
$isSlash
Example
$nomention
$if[$isSlash==true]
$message[text]
$else
$message
$endif
$isTicket
Check if the current or given channel is a ticket.
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!
To create a ticket use the
$newTicket[]
function.
$isTimedOut
Returns "true" if the user is timed out, otherwise "false".
Syntax
$isTimedOut[User ID]
Parameters
User ID
(Type: Snowflake || Flag: Required)
: The user to check.
Example
$nomention
User is timed out: $isTimedOut[$mentioned[1]]
$isUserDMEnabled
Checks whether or not the bot can DM the user.
🧙♂️ 'true' means the bot can DM the user, 'false' means it can't.
Usage
$isUserDMEnabled[userID]
Parameters
userID
(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
$isValidHex
Checks if given color hex is valid.
🧙♂️ 'true' means the color hex is valid, 'false' means it isn't.
Usage
$isValidHex[colorHex]
Parameters
colorHex
(Type: String || Flag: Emptiable)
: The color hex to check.
$joinSplitText
Joins $textSplit
values with provided separator.
Usage
$joinSplitText[separator]
Parameters
separator
(Type: String || Flag: Emptiable)
: The separator to be put between the text split values.
See more in the Text Splitting guide...
$kick
Kicks a user.
Syntax
$kick
Kicks the user who ran the command.
$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]]`!
$kickMention
A simplified version of $kick
. Kicks the mentioned user, the user running the command must have the 'kick' permission.
Usage
$kickMention[reason]
Parameters
reason
(Type: String || Flag: Emptiable)
: The audit-log reason for the kick.
Example
$nomention
$kickMention[$noMentionMessage]
✅ Kicked `$username[$mentioned[1]]#$discriminator[$mentioned[1]]`!
$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)
$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]])
$lowestRoleWithPerms
Returns the lowest role in the server that has all the provided permissions.
Usage
$lowestRoleWithPerms[permissions;...]
Parameters
permissions
(Type: Permission || Flag: Required)
: The permissions that the role needs to have. (see permissions list). Use;
as a separator for multiple permissions
Example
$nomention
Lowest Role with Administrator: $roleName[$lowestRoleWithPerms[admin]] ($lowestRoleWithPerms[admin])
$max
Returns the largest number from the provided numbers.
Usage
$max[A;B;...]
Parameters
A,B,...
(Type: Integer || Flag: Required)
: The numbers to get the maximum from. Separate numbers using;
.
Example
$nomention
$max[100;20;50]
$membersCount
Returns amount of members in the current guild
Example
$nomention
This server has $membersCount members
Note
You can use $membersCount
in bot status to display how many users in all servers of the bot
$membersCount[]
Returns amount of members in the current guild with provided presence.
Syntax
$membersCount[presence]
- returns amount of members that have their presences set
to provided presence. For example if you will use $membersCount[online]
it will show
you amount of online members.
Available presences:
online
offline
idle
dnd
invisible
Example
$nomention
there are $membersCount[online] users in this server
Note
This function requires the Presence Intent
$mentioned
Returns the ID of the mentioned user.
Usage
$mentioned[mentionNumber;(returnAuthor)]
Parameters
mentionNumber
(Type: HowMany || Flag: Required)
: The user-mention to get from the author's message (1
= first user-mention,2
= second, etc).returnAuthor
(Type: Bool || Flag: Optional)
: Whether to return the author's ID if no user is mentioned or not.
Example
$nomention
$mentioned[1]
$mentionedChannels
Returns the ID of the mentioned channel.
Usage
$mentionedChannels[mentionNumber;(returnCurrent)]
Parameters
mentionNumber
(Type: HowMany || Flag: Required)
: The channel-mention to get from the author's message (1
= first channel-mention,2
= second, etc).returnCurrent
(Type: Bool || Flag: Optional)
: Whether to return the current channel ID if no channel is mentioned or not.
Example
$nomention
$mentionedChannels[1]
$mentionedRoles
Returns the ID of the mentioned role.
Usage
$mentionedRoles[mentionNumber]
Parameters
mentionNumber
(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]
$message
Returns the user's message (without the command trigger).
Syntax
$message
Example
$nomention
$message
$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]
Slash command
We retrieve the input of the slash command option named "message".
$nomention
$message[message]
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
Slash
$messageID
Returns the ID of the author's message.
📝 If
$messageID
is written in$onInteraction
commands, it will return bot's message ID.
Usage
$messageID
Example
$nomention
$messageID
$min
Returns the smallest number from the provided numbers.
Usage
$min[A;B;...]
Parameters
A,B,...
(Type: Integer || Flag: Required)
: The numbers to get the minimum from. Separate numbers using;
.
Example
$nomention
$min[3;5;1]
$minute
Returns the current minute of this hour.
🧙♂️ You can use $time to change the timezone.
Usage
$minute
Example
$nomention
Current Minute: $minute
$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.
Usage
$modifyChannelPerms[channelID;permissions;userID/roleID]
Parameters
channelID
(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.userID/roleID
(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]
Unlock:
$nomention
$onlyPerms[managechannels;❌ You need the manage_channels permission to use that!]
✅ Successfully unlocked <#$mentionedChannels[1;yes]>!
$modifyChannelPerms[$mentionedChannels[1;yes];+sendmessages;$guildID]
$modifyRole
Modifies a role.
Usage
$modifyRole[roleID;(roleName;colorHex;hoisted;mentionable)]
🧙♂️ You can use
!unchanged
as a argument to leave the setting as-is.
Parameters
roleID
(Type: Snowflake || Flag: Required)
: The ID of the role to modify.roleName
(Type: String || Flag: Optional)
: New role name.colorHex
(Type: Color || Flag: Optional)
: 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.
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]]>]
$modifyRolePerms
Modifies a role's permissions.
Usage
$modifyRolePerms[roleID;permissions;...]
Parameters
roleID
(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, separate permissions using;
.
$modulo
Returns remainder between numbers.
Usage
$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]]
$month
Returns the current month of this year.
🧙♂️ You can use $time to change the timezone.
Usage
$month
Example
$nomention
Current Month: $month
$multi
Muliplies the provided numbers.
Usage
$multi[number;..]
Parameters
number
(Type: Float, Integer || Flag: Required)
: The numbers to multiply. Separate numbers using;
.
Example
$nomention
$argsCheck[>2;❌ Invalid usage. Usage: `!multiply (number1) (number2)`]
$multi[$message[1];$message[2]]
$mute
(deprecated)
🧙♂️ This command is deprecated instead better use $timeout.
Mutes the mentioned user.
Usage
$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]]!
$newModal
Creates a new modal.
Usage
$newModal[modal ID;title]
Parameters
modal ID
(Type: String || Flag: Required)
: ID of the$newModal[]
which is used in$onInteraction[]
callback.title
(Type: String || Flag: Required)
: 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]
For more info, see the Modals Guide.
$newSelectMenu
Add select menu to a message.
Usage
$newSelectMenu[menu ID;min;max;(placeholder;message ID)]
Parameters
menu ID
(Type: String || Flag: Required)
: 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)
: It's a text that appears if no option is selected.message ID
(Type: Snowflake || Flag: Vacantable)
: ID of a message that should have a select menu added to it. By default, it's the bot's response.
Example
$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]
For more info, see the Select Menu Guide.
$newTicket
Creates a new ticket.
Usage
$newTicket[categoryID/name;No question message;In ticket message;Message to user;Error message;(Ticket number;return id of the ticket message)]
Parameters
categoryID/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:
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!]
$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 username is returned instead.
Syntax
$nickname
Example
$nomention
Your nickname is `$nickname`
$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 username 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]]`
$nomention
Disables the default author mention.
Usage
$nomention
Example
With $nomention
:
Without $nomention
:
$noMentionMessage
Returns the user's full message without any mentions (without the command trigger).
Syntax
$noMentionMessage
Example
$nomention
$noMentionMessage
$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[>]
$numberSeparator
Separates the thousands in a number.
Usage
$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]
$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 be only used in BDScript 2. Executes functions with turned off optimizations.
Usage
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.
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]
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]
]
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]
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[Condition;...]
Parameters
Condition
(Type: String || Flag: Required)
: Condition to check. Separate conditions using;
.
Example
$nomention
$if[$or[$message==hi;$message==hey;$message==hello]==true]
Hello $username!
$endif
$parentID
Returns the current channel's parent category ID.
Syntax
$parentID
Example
$nomention
Current category: $parentID
$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]]
$ping
Shows the delay between sent message and bot's response.
The value of $ping
is expressed in miliseconds.
Example command:
Ping: $ping ms
Expected output:
Ping: 50 ms
⠀
$pinMessage
Pins the bot's 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! 😎
$pinMessage[]
Pins a specific message using it's message ID & channel ID.
⚠️ A channel can have a maximum of 50 pinned messages.
Syntax
$pinMessage[channelID;messageID]
Parameters
channelID
(Type: Snowflake || Flag: Required)
: The channel where the message is located.messageID
(Type: Snowflake || Flag: Required)
: The message to pin.
Example
$nomention
$pinMessage[$channelID;$messageID]
I have pinned your message!
$premiumExpireTime
Returns how long until premium expires.
🧙♂️ Returns 'expired' if the bot is not premium.
Usage
$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
When premium
$nomention
My premium expires in: $premiumExpireTime (UNIX Timestamp : $premiumExpireTime[yes])
$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!
$random
Returns a random number between 0 and 9.
Syntax
$random
Example
$nomention
The random number is **$random**!
$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]`!
$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[]]
$randomChannelID
Returns a random channel ID from the current server.
Usage
$randomChannelID
Example
$nomention
Here's A Random Channel: <#$randomChannelID>
$randomGuildID
Returns a random guild ID from servers the bot is in.
Syntax
$randomGuildID
Example
$nomention
Random Guild: $serverName[$randomGuildID]
$randomMention
Mentions a random user from the server.
Usage
$randomMention
Example
$nomention
Random User: $randomMention
$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[]]
It can return the
@everyone
role ID!
$randomString
Generates a random combination of letters/numbers.
Usage
$randomString[length]
Parameters
length
(Type: Integer || Flag: Required)
: How long the string should be (max10
).
Example
$nomention
String: `$randomString[$message]`
$randomText
Picks one value from the provided values randomly.
Usage
$randomText[text;...]
Parameters
text
(Type: String || Flag: Emptiable)
: The text to choose from. Separate different texts with ';'.
Example
$nomention
$randomText[Hello;Hi;Hey]!
$randomUser
Returns a random user's username.
Usage
$randomUser
$randomUserID
Returns a random user ID from the current server.
Usage
$randomUserID
$registerGuildCommands
Registers all guild slash commands in the current guild.
Syntax
$registerGuildCommands
Example
$nomention
$registerGuildCommands
Successfully registered all guild slash commands!
$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`!
Example #2:
$nomention
$argsCheck[>1;Provide guild slash command names!]
$unregisterGuildCommands[$unescape[$toLowercase[$replaceText[$trimSpace[$message]; ;]]]]
Successfully registered the provided guild slash commands!
$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
$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.
$removeComponent
Removes certain component from a message.
Usage
$removeComponent[customID;(messageID)]
Parameters
customID
(Type: String || Flag: Required)
: The select-menu/button custom ID to remove from the message.messageID
(Type: Snowflake || Flag: Vacantable)
: The message to remove the component from, uses the bot's current message if no 'messageID' is provided.
$removeContains
Removes messages that contains provided words. Removes up to the given amount
of latest messages (max 100)
Usage
$removeContains[word;...;amount]
Parameters
word
(Type: String || Flag: Emptiable)
: The phrases/words to delete, separate phrases using;
.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!
$removeLinks
Removes all links from the bot's reply.
Syntax
$removeLinks
Example
With $removeLinks
$nomention
$removeLinks
A cool link: https://botdesignerdiscord.com/
Without $removeLinks
$nomention
A cool link: https://botdesignerdiscord.com/
$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]
$removeSplitTextElement
Removes a certain element from the $textSplit
values.
🧙♂️ This function is unneeded, if
$textSplit
isn't present in the code.
Usage
$removeSplitTextElement[index]
Parameters
index
(Type: Integer || Flag: Required)
: The index of the$textSplit
value to remove.
See more in the Text Splitting guide...
$repeatMessage
Repeats the provided text a certain amount of times.
Usage
$repeatMessage[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]
Example #2:
🧙♂️ You can use a space at the end of 'text', so there are spaces in-between repeats.
$nomention
$repeatMessage[5;Hello World! ]
$replaceText
Replaces 'sample' with 'new' from 'text', you can choose how many 'sample' is replaced by inputting 'howMany'.
Usage
$replaceText[text;sample;new;(howMany)]
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.howMany
(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
Returns the ID of the replied message from the author's message.
Example
$nomention
The message ID you replied to is: $repliedMessageID
$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]
$reply
Replies to the author's message.
Syntax
$reply
Example
$nomention
$reply
$allowUserMentions[]
Hello $username 👋🏻
$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!
$replyIn
The bot waits x (amount of time) before executing the code.
Usage
$replyIn[delay]
🧙♂️ Maximum 'delay' can be 40 minutes (For premium users, it's 120 minutes) while minimum delay is 1 second.
Parameters
delay
(Type: Duration || Flag: Required)
: How long the command is delayed for (e.g: 10s, 10m, 40m).
Example
$replyIn[5s]
Hi $username!
$resetChannelVar
Resets a channel variable back to its default value (the one provided in the app) for every channel in every server.
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 it's default value (the one inputted in the app) for every server.
🧙♂️ Use this function wisely!
Usage
$resetServerVar[variableName]
Parameters
variableName
(Type: String || Flag: Required)
: The name of the variable to reset.
$resetUserVar
Resets a user variable back to it's default value (the one inputted in the app) for every user, or just the provided user.
🧙♂️ Use this function wisely!
Usage
$resetUserVar[variableName;(userID)]
Parameters
variableName
(Type: String || Flag: Required)
: The name of the variable to reset.userID
(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.
Usage
$roleCount
Example
$nomention
There are $roleCount roles in $serverName[$guildID]
$roleExists
Returns whether or not the provided ID is a actual role.
🧙♂️ 'true' means the role exists, 'false' means it doesn't.
Usage
$roleExists[roleID]
Parameters
roleID
(Type: Snowflake, String || Flag: Emptiable)
: The role to check for.
Examples
Example #1:
$roleExists[1239039039030939]
$c[This role doesn't exist!]
Example #2:
$roleExists[858334189899087943]
$c[This role exists!]
$roleGrant
Gives or removes roles from the provided user.
Usage
$roleGrant[user ID;+/-Role ID;...]
Parameters
user ID
(Type: Snowflake || Flag: Required)
: The user to grant roles to.RoleID
(Type: Snowflake || Flag: Required)
: The role to give or remove. Prepend+
or-
to the role ID to give or remove it.
Example 1
$nomention
$roleGrant[3869969062509936;+9368562753613496]
Example 2
$nomention
$roleGrant[$mentioned[1];+$mentionedRoles[1]]
<@$mentioned[1]> user was given <@&$mentionedRoles[1]> role
$roleID
Returns a role's ID using its name.
Usage
$roleID[roleName]
Parameters
roleName
(Type: String || Flag: Required)
: The name of the role for which to get its ID.
Example
$nomention
Role ID For "$message": $roleID[$message]
$roleInfo
$roleInfo
allows you to make a 'role info' command without using a bunch of different functions at once. This function returns info about the mentioned role.
Usage
$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 name.{ID}
- Returns the role's ID.{mentionable}
- Returns if the role is mentionable by everyone.{hoist}
- Returns if a role is hoisted (displayed separately).{color}
- Returns the role's color.{position}
- Returns the roles position on 'roles list'.
⚠️ You can not include $roleInfo[]
in a command with a $description[]
(because it makes one automatically).
Example
$nomention
$roleInfo[Name: {name}
ID: {ID}
Mentionable?: {mentionable}
Hoisted?: {hoist}
Color: {color}
Position: {position}]
$title[Role Info]
$roleName
Returns a role's name.
Usage
$roleName[roleID]
Parameters
roleID
(Type: Snowflake || Flag: Required)
: The role for which to get its name.
Example
$nomention
$roleName[$highestRole[$authorID]]
$roleNames
Returns the name of every role in the current server.
Usage
$roleNames
Example
$nomention
$description[Server Roles: $roleNames]
$rolePosition
Returns a roles position (1 being highest role).
Syntax
$rolePosition[roleID]
Parameters
roleID
(Type: Snowflake || Flag: Required)
: The role for which to get its position.
Example
$nomention
$description[<@&$findRole[$message]>'s Position: $rolePosition[$findRole[$message]]]
$round
Rounds up the provided number.
Syntax
$round[number;(decimalPlace)]
Parameters
number
(Type: Float || Flag: Required)
: The number to round.decimalPlace
(Type: Integer || Flag: Vacantable)
: The number of decimal places to round the number to. Defaults to0
.
Example
$nomention
$round[100.123;1]
$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
$sendEmbedMessage
Sends embed message to 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)
: ID of the channel where the message will be sent.content
(Type: String || Flag: Emptiable)
: Text that is shown above the embed.title
(Type: String || Flag: Vacantable)
: Text that will be used as the title in the embed.title URL
(Type: URL || Flag: Vacantable)
: URL that will be applied to the title.description
(Type: String || Flag: Vacantable)
: 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 appear at author.author icon
(Type: URL || Flag: Vacantable)
: The image that appears next to author. This 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 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 footer. Must be a valid image URL.add timestamp
(Type: Bool || Flag: Vacantable)
: Adds time in 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]
$sendMessage
Sends a new message.
Usage
$sendMessage[text;(returnMessageID)]
Parameters
text
(Type: String || Flag: Required)
: The text to send in the new message.returnMessageID
(Type: Bool || Flag: Optional)
: Whether to return the ID of the newly created message, in another message. Defaults tono
.
Examples
Example #1:
$nomention
$sendMessage[This is message #1!]
$sendMessage[This is message #2!]
$sendMessage[This is message #3!]
Example #2:
$nomention
$sendMessage[This is message #1!;yes]
$sendMessage[This is message #2!;yes]
$serverChannelExists
Checks if the channel exists in the guild.
Syntax
$serverChannelExists[channel ID]
Parameters
channel ID
(Type: Snowflake, String || Flag: Emptiable)
: Returnstrue
if the channel exists, otherwisefalse
.
Example
$nomention
$serverChannelExists[566370477967147018]
$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;errorMessage]
Parameters
duration
(Type: Duration || Flag: Required)
: The duration of this cooldown.errorMessage
(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 'errorMessage'.
$serverCount
Returns how many servers the bot is in.
Syntax
$serverCount
Example
$nomention
I'm currently in $serverCount servers!
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
$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]]
$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; ]
$serverIcon
Returns the current server's icon.
Syntax
$serverIcon
Example
$nomention
$image[$serverIcon]
$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]]
$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.
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 isyes
.
⚠️ You can not include $serverInfo[]
in a command with a $description[]
(because it makes one automatically).
Subset-Functions
You can use the 'subset-functions' below within $serverInfo
:
{name}
- Returns the server name{region}
- Returns the server region{emoji}
- Returns the server's emojis in a list.{owner}
- Returns the owner's username.{ID}
- Gets the guild ID.{verificationLvl}
- Returns the server verification level.{large}
- Finds out if a server is considered 'large'.
Example
$nomention
$title[Server Info]
$serverInfo[Server Name: {name}
Region: {region}
Owner: {owner}
Server ID: {ID}
Verify Level: {verificationLvl}
Emojis: {emoji}
Large Server?: {large};no]
$serverLeaderboard
Makes a server leaderboard (top-10).
Syntax
$serverLeaderboard[variableName;(sortType)]
Parameters
variableName
(Type: String || Flag: Required)
: The variable to create the leaderboard for.sortType
(Type: Enum || Flag: Optional)
: Whether to sort the leaderboard in ascending (asc) or descending (desc) order.
🧙♂️
$serverLeadboard
automatically generates a description. So,$description
should not be used in the code.
$serverName
Returns the server's name.
Syntax
$serverName[guildID]
Parameters
guildID
(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 it's name.
Example
$nomention
Server Name: $serverName[$guildID]
$serverNames
Returns 10 server names in which the bot is in.
Syntax
$serverNames
Example
$nomention
$onlyForIDs[$botOwnerID;Only my owner can use that!]
$serverNames
$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;
]
$serverOwner
Returns the ID of the current server's owner.
Syntax
$serverOwner
Example
$nomention
This server is owned by <@$serverOwner>!
$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]>!
$serverRegion
(deprecated)
Returns the server's region.
🧙♂️ This function is deprecated, because Discord removed the server region setting. For more information, click here.
Usage
$serverRegion
$serverVerificationLvl
The server's verification level. Returns None
, Low
, Medium
, High
, or Very High
.
Syntax
$serverVerificationLvl
Example
$nomention
This server's verification level is $serverVerificationLvl
$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 variables value has a max character limit of 499 (4999, if premium).
See more in the Variables guide...
$setServerVar
Updates a variable value for a server.
Syntax
$setServerVar[variableName;newValue;(serverID)]
Parameters
variableName
(Type: String || Flag: Required)
: The variable to update.newValue
(Type: String || Flag: Emptiable)
: The newly assigned variable value.serverID
(Type: Snowflake || Flag: Optional)
: The server to assign the new value to, uses current server if no 'serverID' is provided.
📝 Server variables values has a max character limit of 499 (for premium users, it's 4999).
See more in the Variables guide...
$setUserVar
Updates a variable's value for a user.
Syntax
$setUserVar[variableName;newValue;(userID;guildID)]
Parameters
variableName
(Type: String || Flag: Required)
: The variable to update.newValue
(Type: String || Flag: Emptiable)
: The newly assigned variable value.userID
(Type: Snowflake || Flag: Optional)
: The user to assign the new value to, uses the author if no 'userID' is provided.guildID
(Type: Snowflake || Flag: Optional)
: The guild to assign the new value to, uses current guild if no 'guildID' is provided.
📝 User variables value has a max character limit of 4999.
See more in the Variables guide...
$setVar
Sets a variable's value globally, or for a user globally.
Syntax
$setVar[variableName;newValue;(userID)]
Parameters
variableName
(Type: String || Flag: Required)
: The variable to update.newValue
(Type: String || Flag: Emptiable)
: The newly assigned variable value.userID
(Type: Snowflake || Flag: Optional)
: The user to globally assign the new value to. Sets the variable type as global-user, if 'userID' is present.
📝 Global variables has a max character limit of 499 (for premium users, it's 4999).
See more in the Variables guide...
$shardID
Returns the shard id of the current guild.
Syntax
$shardID
Example
$nomention
$shardID
$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!
$slashID
Returns ID of the executed slash command.
Syntax
$slashID
Example
$nomention
ID of this slash command: $slashID
$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]
$slowmode
With slowmode enabled in a channel, it'll limit the number of messages a user is able to send in a channel based on a timed cooldown. $slowmode[]
is used to change a channel's slowmode using a bot.
🧙♂️ Slowmode time can't be set over 6 hours/21600 seconds. Also, in order for the bot to run
$slowmode[]
successfully, it needs the 'Manage Channels' permission.
Usage
$slowmode[channelID;slowmodeTime]
Parameters
channelID
(Type: Snowflake || Flag: Required)
: The channel in which the slowmode is being modified in. Use0
/0s
to disable the slowmode.slowmodeTime
(Type: Duration || Flag: Required)
: The new slowmode delay (in seconds, e.g. 1s, 180s, 5s, 3s, etc).
Example
$nomention
$argsCheck[>1;:x: Incorrect Usage! Example: `!slowmode 5s`]
$slowmode[$mentionedChannels[1;yes];$message[1]]
Slowmode changed to $message[1]!
$sort
Sorts provided numbers. Amount of numbers can be set to -1 if you'd like to return every number
Syntax
$sort[numbers;...;direction;return amount;separator]
Parameters
numbers
(Type: Float, Integer || Flag: Required)
: Sorts numbers separated by ; (ex: 1;2;3)direction
(Type: Enum || Flag : Required)
: The direction in which to sort:asc
- ascendingdesc
- descending
return amount
(Type: Integer || Flag: Required)
: How many numbers will be returned. Use-1
to generate all numbersseparator
(Type: String || Flag: Required)
: The separator between each number.
Example
$nomention
$sort[8;5;9;1;3;asc;4; - ]
$splitText
Retrieves a value from $textSplit
.
⚠️ This function is used with
$textSplit
.
Usage
$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
.
See more in 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. Accepts60
(1 hour),1440
(1 day),4320
(3 days), or10080
(7 days) as input. Defaults to60
.Return thread/channel ID
(Type: Bool || Flag: Optional)
: Whether to return the thread channel ID or not. Defaults tono
.
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]>
$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]
$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]
$suppressErrors
Blocks sending any error messages whenever an error occurs.
Syntax
$suppressErrors
Example
$nomention
$suppressErrors
$argsCheck[>1;Usage : ` !command <math expression> `]
$calculate[$message]
Related Resources
$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]
Related Resources
$takeRole
Removes a role from the provided/mentioned user.
📌 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.
Syntax
$takeRole[User/Role ID;(Role ID)]
Parameters
User/Role ID
(Type: Snowflake || Flag: Required)
: The user to remove the role from or the role to remove from the mentioned users. If this parameter is only provided, it reads 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".
Example
$nomention
$allowRoleMentions[]
$takeRole[$mentionedRoles[1]]
Removed <@&$mentionedRoles[1]> from the mentioned users!
Related Resources
$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]
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.
Related Resources
- Text Splitting Guide
- $getTextSplitIndex
- $getTextSplitLength
- $joinSplitText
- $removeSplitTextElement
- $splitText
$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]
Related Resources
$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]
Related Resources
$thumbnail
Adds an embedded thumbnail to 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 to1
.
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]
$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]
$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]]
Related Resources
$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 to1
.
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.]
$toLowercase
Converts the provided text to lowercase format.
Syntax
$toLowercase[Text]
Parameters
Text
(Type: String || Flag: Emptiable)
: The text to convert.
Example
$nomention
$toLowercase[THIS TEXT IS NOW lowercase]
$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]
$toUppercase
Converts the provided text to uppercase format.
Syntax
$toUppercase[Text]
Parameters
Text
(Type: String || Flag: Emptiable)
: The text to convert.
Example
$nomention
$toUppercase[this text is now UPPERCASE]
$trimContent
Removes duplicate spaces from incoming message content.
Syntax
$trimContent
Example
$nomention
$trimContent
1. $message[1]
2. $message[2]
3. $message[3]
📌 Removing
$trimContent
from the above code would result in the following output :
$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
]<
$tts
Enables Text-to-Speech (TTS) functionality on the bot's response message.
📌 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!
$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!
$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!
$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]]
$unmute
Unmutes the mentioned user.
📌 As of December 2021, this function has been deprecated in favor of $untimeout.
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]]!
$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!
$unregisterGuildCommands
Unregisters all guild slash commands from the current guild.
Syntax
$unregisterGuildCommands
Example
$nomention
$unregisterGuildCommands
Successfully unregistered all guild slash commands!
$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!
$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`!
$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 eitherencode
ordecode
as input.Text
(Type: String || Flag: Emptiable)
: The text to change.
Example
-
Encoding
$nomention https://example.url/encode?convert=$url[encode;Hello world!!]
-
Decoding
$nomention $url[decode;https://example.url/decode?convert=Hello+world%21%21]
$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]
$userAvatar
Returns 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]]]
📌 You can optionally append a query string
?size=VALUE
at the end of the URL to increase the size of the avatar. Thesize
's value supports any power of two between 16 and 4096.
$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]
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]
)
$userExists
Checks if a user exists in Discord using it's ID. Returns "true", if it exists otherwise "false".
Syntax
$userExists[User ID]
Parameters
User ID
(Type: String, Snowflake || Flag: Required)
: The ID of the user to check.
Example
$nomention
$userExists[$mentioned[1]]
$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]
$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 index1
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}]
📌
$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]
-
Custom format
$nomention $userJoined[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)]
$userJoinedDiscord
Returns the account creation date of a given user.
📌 As of November 2022, this function has been deprecated in favor of
$creationDate
.📌 Besides user IDs,
$userJoinedDiscord
can also return creation date of any valid Discord Snowflake ID.
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.📌 Click me to check all supported time format values.
Example
-
Default format
$nomention $userJoinedDiscord[$authorID]
-
Custom format
$nomention $userJoinedDiscord[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)]
$userLeaderboard
Returns the top 10 users' usernames and values for a given user variable.
📌
$userLeaderboard
automatically generates a description. So,$description
of index1
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 todesc
.
Example
$nomention
$userLeaderboard[Money;asc]
📌 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!
$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]]!
$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[$mentioned[1;yes];-1;-]
$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;🍀]
$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]]]
$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]
$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]]
$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.]
$setUserVar[Cool;true]
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]
$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 eitheruser
,server
,channel
, orglobaluser
as input.
Example
$nomention
$variablesCount[server]
$year
Returns the current year.
📌 You can use $time to change the timezone.
Syntax
$year
Example
$nomention
Current Year: $year
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
: The name used in$awaitFunc[]
function.filter
: It is used to limit user input. (Optional)
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
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
With numeric filter
Trigger: $awaitedCommand[odd;<numeric>]
$nomention
You have provided a number: $message
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
: The name used in$awaitFunc[]
function.
Example
Trigger: $awaitedCommandError[number]
$nomention
Invalid number!
For more info, see the Awaited Commands Guide.
$onJoined
When a user joins the server, the command is triggered.
$onJoined[channelID]
is a callback, which means it's used in the command trigger (not the code). The command is ran when a user joins the server. You must replace 'channelID' with a valid channel ID.
Example
-
Make the command trigger
$onJoined[channelID]
.
-
Input your code/reply text.
🧙♂️ You can use functions like
$username
,$authorAvatar
,$authorID
,$membersCount
,$serverName[$guildID]
here. -
Now, you have a welcome message! ✨
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.
-
Open BDFD app and select your bot. Go to bot settings and enable Member Intents.
📝 Enabled intents in the app should reflect the intents enabled in the Discord Developer Portal.
For example: If you haveMembers 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.
-
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:
-
Make a variable named "
welcome
" and the value set to nothing.
-
Make a command for setting the welcome channel, then put the following in your code:
$nomention $onlyAdmin[You need the admin permission to use that!] $argsCheck[>1;Please mention a channel!] Welcome channel updated! $setServerVar[welcome;$mentionedChannels[1]]
📝 Servers will need to setup the channel they want the welcome message to send to (by running a command with the code above).
-
Now replace
$onJoined[channelID]
in your welcome command trigger, with$onJoined[$getServerVar[welcome]]
and you're all set!
$onLeave
When a user leaves the server, the command is triggered.
$onLeave[channelID]
is a callback, which means it's used in the command trigger (not the code). The command is ran when a user leaves the server. You must replace 'channelID' with a valid channel ID.
Example
-
Make the command trigger
$onLeave[channelID]
. -
Input your code/reply text.
🧙♂️ You can use functions like
$username
,$authorAvatar
,$authorID
,$membersCount
,$serverName[$guildID]
here. -
Now, you have a leave message! ✨
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.
-
Open BDFD app and select your bot. Go to bot settings and enable Member Intents.
📝 Enabled intents in the app should reflect the intents enabled in the Discord Developer Portal.
For example: If you havemembers 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.
-
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:
-
Make a variable named "
leave
" and the value set to nothing.
-
Make a command for setting the leave channel, then put the following in your code:
$nomention $onlyAdmin[You need the admin permission to use that!] $argsCheck[>1;Please mention a channel!] Leave channel updated! $setServerVar[leave;$mentionedChannels[1]]
📝 Servers will need to setup the channel they want the leave message to send to (by running a command with the code above).
-
Now replace
$onLeave[channelID]
in your leave command trigger, with$onLeave[$getServerVar[leave]]
and you're all set!
$onBanAdd
Triggered when a user gets banned from the server.
$onBanAdd[channelID]
is a callback, which means it's used in the command trigger (not the code). The command is ran when a user is banned from the server. You must replace 'channelID' with a valid channel ID or a server variable that holds the channelID ($getServerVar[]
).
Example
#1: Make a command with $onBanAdd[channelID]
as the trigger.
🧙♂️ You must replace 'channelID' with a valid channel ID!
#2: Input your code/reply text.
#3: Now you have a ban message! ✨
You can use
$authorID
to get the ID of the user who got banned.You can use
$getBanReason
to get the ban reason.
$onBanRemove
Triggered when a user gets unbanned from the server.
$onBanRemove[channelID]
is a callback, which means it's used in the command trigger (not the code). The command is ran when a user is unbanned from the server. You must replace 'channelID' with a valid channel ID or a server variable that holds the channelID ($getServerVar[]
).
Example
#1: Make a command with $onBanRemove[channelID]
as the trigger.
🧙♂️ You must replace 'channelID' with a valid channel ID!
#2: Input your code/reply text.
#3: Now you have a unban message! ✨
You can use
$authorID
to get the ID of the user who got unbanned.
$onMessageDelete
Triggered when a user deletes a message.
Syntax
$onMessageDelete[channel ID]
Parameters
channel ID
: The channel to which the resulting message will be sent.
Example
With $getServerVar[]
Make a new command, with the trigger $onMessageDelete[$getServerVar[channel]]
$nomention
A massage was deleted!
Without $getServerVar[]
Make a new command, with the trigger $onMessageDelete[channel ID]
(You must replace channel ID
with a valid channel ID)
$nomention
A massage was deleted!
You can use
$channelID
to get the ID of the logs (channel ID
).You can use
$messageID
to get the ID of the deleted message.
$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 $username!]
$endif
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
: The custom/menu/button/interaction ID used during the creation of buttons, menus, text fields, and other components.
Supports
Example
- 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 $username!]
- Execute commands
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
-
Open BDFD app and click on profile icon.
-
Then, click "Buy premium points".
-
Choose your preferable package and confirm your purchase.
Redeeming Premium
After a successful purchase of premium points, here's how to redeem them :
-
Select your bot in app homepage and click "Add premium time" button in dashboard tab.
-
Select the amount of points you want to spend, then confirm.
📝 One premium point equals one week of premium hosting.
Premium Perks
Main
$getServerVar[]
in triggers (custom prefixes).- Awaited reactions.
- Access to
$messageContains[]
and$alwaysReply
callbacks. - Custom images.
- Access to
$ignoreTriggerCase
and$sendNotification
functions. - Unlimited commands/variables.
- Ad-free hosting time.
- Priority bot hosting/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
- Awaited Reactions
- Custom Prefixes
- Custom Images
- Embed Builder
- $alwaysReply
- $ignoreTriggerCase
- $messageContains
- $sendNotification
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
-
Create a new command with command trigger set as
$messageContains[]
. -
Put text in the reply message/code.
Now, let's say in chat someone typed : Hello Bot!
, Hello
, Hey Everyone!
, Hi Noituri
etc. The bot would respond with "Hello there! How are you?".
$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 reaction]
For more info, see the Awaited Reactions Guide.
$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[✅;❌]
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]
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]
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
$nomention
$ignoreTriggerCase
Hello World!
$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
$sendNotification[Hello, I miss you!;$userAvatar[$botID]]
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.
📝 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
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
-
Select your bot and click "Image functions" in dashboard tab.
-
Click the "Add image" button.
-
Provide an image name and tag. The tag is used in
$customImage[]
to get the image. The name can be anything. -
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]
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
-
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.
-
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`
-
Change all the command triggers to
$getServerVar[prefix]trigger-here
. For example,!ping
would become$getServerVar[prefix]ping
. -
You're all set, enjoy!
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".
-
Fill out the necessary fields as per your choice.
-
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 :
Enabling JavaScript
To enable JavaScript in BDFD, follow the steps described below :
-
In bot list, click the gear icon
⚙️
and toggle on "Enable features for advanced users". -
Then, create a new command and switch "Scripting Language" to "Javascript".
📌 You cannot use BDScript functions anymore once you enable "Javascript" in a command.
-
That's it! Now, you can start writing your JavaScript code.
Objects
Here is the list of all Discord API supported objects :
Name | Type | Description |
---|---|---|
authorId | String | Returns ID of the user who triggered the command. |
channelId | String | Returns ID of the current channel. |
commandPrefix | String | Returns the value which was set in Command Trigger. |
message | String | Returns message content of the user who triggered the command. |
rolementions | Array of Strings | Returns an array of strings containing all mentioned role IDs. |
usermentions | Array of Strings | Returns an array of strings containing all mentioned user IDs. |
ban
Bans an 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 + ' `');
};
banWithReason
Bans an 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 + ' `');
};
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.');
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 + ' `');
};
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 + ' `');
};
kick
Kicks an 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 + ' `');
};
kickWithReason
Kicks an 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 + ' `');
};
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 + ' `');
};
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 + ' `');
};
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 + ' `');
};
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();
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);
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}>`);
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 + ' `');
};
unban
Unbans an 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 + ' `');
};
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 + ' `');
};