diff --git a/external/entityTransferPolicy.txt b/external/entityTransferPolicy.txt new file mode 100644 index 00000000000..b2be4af11fb --- /dev/null +++ b/external/entityTransferPolicy.txt @@ -0,0 +1,41 @@ +CONTEXT + +-  Bot Designer for Discord is a service provided by NilPointer Software. +-  "Our service" refers to "Bot Designer for Discord". +-  "Bot" refers to data held by BDFD describing the behaviour of a Discord Bot¹ on our service. +-  "Hosting time" refers to the time duration left of a singular bot during which it will be hosted by our service. +-  "Premium point" refers to BDFD premium in-app currency, granting users the ability for bots to have extended functionality for a limited time. +-  "Premium time" refers to the time duration left for a singular bot during which it can access the extended functionality. + Premium time is related, but not strictly linked, with hosting time. Premium time might end before hosting time, but not vice-versa. +-  "Promocode" or "promo code" refers to a randomly generated string of characters used to gain hosting or premium time. +-  "BDFD entity" or "entity" refers to any piece of data that is being held by BDFD, that ownership of it or itself can be transferred. + In this policy, "entity" mainly refers to bots, hosting and premium time, and premium points. +-  "Transfer request" refers to a request made by a user to BDFD developers for an entity transfer. + These requests can be made through a ticket on our official Discord server². + + +POLICY + +-  Entities that can be transferred can only be transferred through a transfer request by the user that holds ownership of that entity. +-  Requesting users must provide proof of ownership of the entities in question for the request to be granted. +-  BDFD Accounts can not be transferred in any way. + +-  Bots can only be transferred between BDFD accounts owned by a single user. +-  Bot after its transfer retains any hosting or premium time the bot in question had left. +-  A bot previously not assigned to any BDFD account can be transferred to an account of the user that holds ownership over the bot in question. + +-  Premium points can be transferred between BDFD accounts owned by a single user. +-  Premium points can be donated for a giveaway promotion on our official Discord server². + +-  Hosting and Premium time can only be transferred between bots owned by a single user. +-  Hosting and Premium time can not be transferred to a promocode. +-  Only premium time can be donated for a giveaway promotion on our official Discord server². + + +LINKS + +¹ https://discord.com/developers/docs +² https://discord.gg/botdesigner + + +Effective Date: 28 January, 2026. diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 2a3adca2fd0..6725f8c4e0b 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -16,7 +16,6 @@ Added Components V2 functions: - Added `$addSection[]` - Added `$addThumbnail[]` - Added `$addMediaGallery[]` -- Added `$addMediaGallery[]` - Added `$addMediaGalleryItem[]` - Added `$addActionRow[]` - Added `$addButtonCV2[]` diff --git a/src/FLOWCHART_CHANGELOG.md b/src/FLOWCHART_CHANGELOG.md index 4b974dce4cc..5ccd56b9b81 100644 --- a/src/FLOWCHART_CHANGELOG.md +++ b/src/FLOWCHART_CHANGELOG.md @@ -1,7 +1,5 @@ # Flowchart Changelog - -

2024

diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 65001c4b2f3..cacfcbe2170 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -4,7 +4,7 @@ [Settings](./settings.md) [Changelog](./CHANGELOG.md) [Flowchart Changelog](./FLOWCHART_CHANGELOG.md) -[Entity Transfer Policy](./entityTransferPolicy.md) +[Terms & Privacy](./termsAndPrivacy.md) --- @@ -58,15 +58,17 @@ - [Functions]() - [Introduction](./bdscript/introduction.md) - - [Components]() + - [Component]() - [$addButton](./bdscript/addButton.md) - [$addSelectMenuOption](./bdscript/addSelectMenuOption.md) - [$addSeparator](./bdscript/addSeparator.md) - [$addTextDisplay](./bdscript/addTextDisplay.md) - [$addTextInput](./bdscript/addTextInput.md) + - [$defer](./bdscript/defer.md) - [$editButton](./bdscript/editButton.md) - [$editSelectMenu](./bdscript/editSelectMenu.md) - [$editSelectMenuOption](./bdscript/editSelectMenuOption.md) + - [$input](./bdscript/input.md) - [$newModal](./bdscript/newModal.md) - [$newSelectMenu](./bdscript/newSelectMenu.md) - [$removeAllComponents](./bdscript/removeAllComponents.md) @@ -74,11 +76,11 @@ - [$removeButtons](./bdscript/removeButtons.md) - [$removeButtons[]](./bdscript/removeButtonsComplex.md) - [$removeComponent](./bdscript/removeComponent.md) - - [$defer](./bdscript/defer.md) - - [$input](./bdscript/input.md) - - [Embeds]() + - [Embed]() - [$addContainer](./bdscript/addContainer.md) - [$addField](./bdscript/addField.md) + - [$addMediaGallery](./bdscript/addMediaGallery.md) + - [$addMediaGalleryItem](./bdscript/addMediaGalleryItem.md) - [$addSection](./bdscript/addSection.md) - [$addThumbnail](./bdscript/addThumbnail.md) - [$addTimestamp](./bdscript/addTimestamp.md) @@ -102,8 +104,9 @@ - [$discriminator](./bdscript/discriminator.md) - [$displayName](./bdscript/displayName.md) - [$displayName[]](./bdscript/displayNameComplex.md) - - [$getUserStatus](./bdscript/getUserStatus.md) - [$getCustomStatus](./bdscript/getCustomStatus.md) + - [$getUserStatus](./bdscript/getUserStatus.md) + - [$hypesquad](./bdscript/hypesquad.md) - [$isAdmin](./bdscript/isAdmin.md) - [$isBooster](./bdscript/isBooster.md) - [$isBot](./bdscript/isBot.md) @@ -123,14 +126,14 @@ - [$username[]](./bdscript/usernameComplex.md) - [$userPerms](./bdscript/userPerms.md) - [$userServerAvatar](./bdscript/userServerAvatar.md) - - [$changeUsername](./bdscript/changeUsername.md) - - [$changeUsernameWithID](./bdscript/changeUsernameWithID.md) - [$findUser](./bdscript/findUser.md) - [Moderation]() - [$ban](./bdscript/ban.md) - [$ban[]](./bdscript/banComplex.md) - [$banID](./bdscript/banID.md) - [$banID[]](./bdscript/banIDComplex.md) + - [$changeUsername](./bdscript/changeUsername.md) + - [$changeUsernameWithID](./bdscript/changeUsernameWithID.md) - [$clear](./bdscript/clear.md) - [$clear[]](./bdscript/clearComplex.md) - [$getBanReason](./bdscript/getBanReason.md) @@ -146,7 +149,7 @@ - [$unbanID[]](./bdscript/unbanIDComplex.md) - [$unmute](./bdscript/unmute.md) - [$untimeout](./bdscript/untimeout.md) - - [Channels]() + - [Channel]() - [$afkChannelID](./bdscript/afkChannelID.md) - [$categoryChannels](./bdscript/categoryChannels.md) - [$categoryCount](./bdscript/categoryCount.md) @@ -164,6 +167,7 @@ - [$channelTopic](./bdscript/channelTopic.md) - [$channelTopic[]](./bdscript/channelTopicComplex.md) - [$channelType](./bdscript/channelType.md) + - [$closeTicket](./bdscript/closeTicket.md) - [$createChannel](./bdscript/createChannel.md) - [$deleteChannels](./bdscript/deleteChannels.md) - [$deleteChannelsByName](./bdscript/deleteChannelsByName.md) @@ -172,13 +176,12 @@ - [$findChannel](./bdscript/findChannel.md) - [$getSlowmode](./bdscript/getSlowmode.md) - [$isNSFW](./bdscript/isNSFW.md) - - [$closeTicket](./bdscript/closeTicket.md) - [$isTicket](./bdscript/isTicket.md) - - [$newTicket](./bdscript/newTicket.md) - [$lastMessageID](./bdscript/lastMessageID.md) - [$lastPinTimestamp](./bdscript/lastPinTimestamp.md) - [$modifyChannel](./bdscript/modifyChannel.md) - [$modifyChannelPerms](./bdscript/modifyChannelPerms.md) + - [$newTicket](./bdscript/newTicket.md) - [$parentID](./bdscript/parentID.md) - [$parentID[]](./bdscript/parentIDComplex.md) - [$rulesChannelID](./bdscript/rulesChannelID.md) @@ -186,7 +189,7 @@ - [$slowmode](./bdscript/slowmode.md) - [$systemChannelID](./bdscript/systemChannelID.md) - [$voiceUserLimit](./bdscript/voiceUserLimit.md) - - [Roles]() + - [Role]() - [$allowRoleMentions](./bdscript/allowRoleMentions.md) - [$colorRole](./bdscript/colorRole.md) - [$createRole](./bdscript/createRole.md) @@ -220,7 +223,6 @@ - [$userRoles](./bdscript/userRoles.md) - [Bot]() - [$allMembersCount](./bdscript/allMembersCount.md) - - [$awaitFunc](./bdscript/awaitFunc.md) - [$botCommands](./bdscript/botCommands.md) - [$botID](./bdscript/botID.md) - [$botLeave](./bdscript/botLeave.md) @@ -230,46 +232,52 @@ - [$botNode](./bdscript/botNode.md) - [$botOwnerID](./bdscript/botOwnerID.md) - [$botTyping](./bdscript/botTyping.md) + - [$getBotInvite](./bdscript/getBotInvite.md) + - [$hostingExpireTime](./bdscript/hostingExpireTime.md) + - [$hostingExpireTime[]](./bdscript/hostingExpireTimeComplex.md) + - [$nodeVersion](./bdscript/nodeVersion.md) + - [$nodeVersion[]](./bdscript/nodeVersionComplex.md) + - [$ping](./bdscript/ping.md) + - [$premiumExpireTime](./bdscript/premiumExpireTime.md) + - [$serverCount](./bdscript/serverCount.md) + - [$serverNames](./bdscript/serverNames.md) + - [$serverNames[]](./bdscript/serverNamesComplex.md) + - [$shardID](./bdscript/shardID.md) + - [$shardID[]](./bdscript/shardIDComplex.md) + - [$slashCommandsCount](./bdscript/slashCommandsCount.md) + - [$uptime](./bdscript/uptime.md) + - [Command]() + - [$alternativeParsing](./bdscript/alternativeParsing.md) + - [$awaitFunc](./bdscript/awaitFunc.md) + - [$c](./bdscript/c.md) - [$commandFolder](./bdscript/commandFolder.md) - [$commandName](./bdscript/commandName.md) - [$commandTrigger](./bdscript/commandTrigger.md) - [$commandsCount](./bdscript/commandsCount.md) - [$customID](./bdscript/customID.md) - - [$deletecommand](./bdscript/deletecommand.md) - - [$enabled](./bdscript/enabled.md) - - [$getBotInvite](./bdscript/getBotInvite.md) - - [$nodeVersion](./bdscript/nodeVersion.md) - - [$nodeVersion[]](./bdscript/nodeVersionComplex.md) - - [$ping](./bdscript/ping.md) + - [$eval](./bdscript/eval.md) + - [$executionTime](./bdscript/executionTime.md) + - [$isSlash](./bdscript/isSlash.md) + - [$nomention](./bdscript/nomention.md) - [$registerGuildCommands](./bdscript/registerGuildCommands.md) - [$registerGuildCommands[]](./bdscript/registerGuildCommandsComplex.md) - [$scriptLanguage](./bdscript/scriptLanguage.md) - - [$shardID](./bdscript/shardID.md) - - [$shardID[]](./bdscript/shardIDComplex.md) - - [$slashCommandsCount](./bdscript/slashCommandsCount.md) - [$slashID](./bdscript/slashID.md) - [$slashID[]](./bdscript/slashIDComplex.md) - - [$serverCount](./bdscript/serverCount.md) - - [$serverNames](./bdscript/serverNames.md) - - [$serverNames[]](./bdscript/serverNamesComplex.md) - - [$executionTime](./bdscript/executionTime.md) - [$unregisterGuildCommands](./bdscript/unregisterGuildCommands.md) - [$unregisterGuildCommands[]](./bdscript/unregisterGuildCommandsComplex.md) - - [$uptime](./bdscript/uptime.md) - - [$eval](./bdscript/eval.md) - [Server]() - [$afkTimeout](./bdscript/afkTimeout.md) - [$boostCount](./bdscript/boostCount.md) - [$boostCount[]](./bdscript/boostCountComplex.md) - [$boostLevel](./bdscript/boostLevel.md) + - [$getInviteInfo](./bdscript/getInviteInfo.md) - [$getServerInvite](./bdscript/getServerInvite.md) - [$getServerInvite[]](./bdscript/getServerInviteComplex.md) - - [$getInviteInfo](./bdscript/getInviteInfo.md) - [$guildBanner](./bdscript/guildBanner.md) - [$guildExists](./bdscript/guildExists.md) - [$guildID](./bdscript/guildID.md) - [$guildID[]](./bdscript/guildIDComplex.md) - - [$hypesquad](./bdscript/hypesquad.md) - [$membersCount](./bdscript/membersCount.md) - [$membersCount[]](./bdscript/membersCountComplex.md) - [$serverDescription](./bdscript/serverDescription.md) @@ -290,11 +298,9 @@ - [$blackListServers](./bdscript/blackListServers.md) - [$blackListUsers](./bdscript/blackListUsers.md) - [Arguments & Conditions]() - - [$argCount](./bdscript/argCount.md) - - [$argsCheck](./bdscript/argsCheck.md) - [$and](./bdscript/and.md) + - [$argsCheck](./bdscript/argsCheck.md) - [$checkCondition](./bdscript/checkCondition.md) - - [$checkContains](./bdscript/checkContains.md) - [$else](./bdscript/else.md) - [$elseif](./bdscript/elseif.md) - [$endif](./bdscript/endif.md) @@ -302,13 +308,11 @@ - [$isBoolean](./bdscript/isBoolean.md) - [$isInteger](./bdscript/isInteger.md) - [$isNumber](./bdscript/isNumber.md) - - [$isSlash](./bdscript/isSlash.md) - [$isValidHex](./bdscript/isValidHex.md) - [$or](./bdscript/or.md) - [Text]() - - [$alternativeParsing](./bdscript/alternativeParsing.md) + - [$argCount](./bdscript/argCount.md) - [$byteCount](./bdscript/byteCount.md) - - [$c](./bdscript/c.md) - [$charCount](./bdscript/charCount.md) - [$cropText](./bdscript/cropText.md) - [$disableInnerSpaceRemoval](./bdscript/disableInnerSpaceRemoval.md) @@ -317,10 +321,8 @@ - [$getTextSplitIndex](./bdscript/getTextSplitIndex.md) - [$getTextSplitLength](./bdscript/getTextSplitLength.md) - [$joinSplitText](./bdscript/joinSplitText.md) - - [$mentionedChannels](./bdscript/mentionedChannels.md) - [$linesCount](./bdscript/linesCount.md) - [$numberSeparator](./bdscript/numberSeparator.md) - - [$removeContains](./bdscript/removeContains.md) - [$removeSplitTextElement](./bdscript/removeSplitTextElement.md) - [$repeatMessage](./bdscript/repeatMessage.md) - [$replaceText](./bdscript/replaceText.md) @@ -336,6 +338,7 @@ - [$calculate](./bdscript/calculate.md) - [$ceil](./bdscript/ceil.md) - [$divide](./bdscript/divide.md) + - [$enableDecimals](./bdscript/enableDecimals.md) - [$floor](./bdscript/floor.md) - [$max](./bdscript/max.md) - [$min](./bdscript/min.md) @@ -346,7 +349,6 @@ - [$sqrt](./bdscript/sqrt.md) - [$sub](./bdscript/sub.md) - [$sum](./bdscript/sum.md) - - [$enableDecimals](./bdscript/enableDecimals.md) - [Random]() - [$optOff](./bdscript/optOff.md) - [$random](./bdscript/random.md) @@ -366,16 +368,12 @@ - [$getTimestamp](./bdscript/getTimestamp.md) - [$getTimestamp[]](./bdscript/getTimestampComplex.md) - [$hour](./bdscript/hour.md) - - [$hostingExpireTime](./bdscript/hostingExpireTime.md) - - [$hostingExpireTime[]](./bdscript/hostingExpireTimeComplex.md) - - [$messageEditedTimestamp](./bdscript/messageEditedTimestamp.md) - [$minute](./bdscript/minute.md) - [$month](./bdscript/month.md) - - [$premiumExpireTime](./bdscript/premiumExpireTime.md) - [$second](./bdscript/second.md) - [$time](./bdscript/time.md) - [$year](./bdscript/year.md) - - [Cooldowns]() + - [Cooldown]() - [$changeCooldownTime](./bdscript/changeCooldownTime.md) - [$cooldown](./bdscript/cooldown.md) - [$getCooldown](./bdscript/getCooldown.md) @@ -387,42 +385,46 @@ - [$channelSendMessage](./bdscript/channelSendMessage.md) - [$deleteIn](./bdscript/deleteIn.md) - [$deleteMessage](./bdscript/deleteMessage.md) + - [$deletecommand](./bdscript/deletecommand.md) - [$dm](./bdscript/dm.md) - [$dm[]](./bdscript/dmComplex.md) - [$editEmbedIn](./bdscript/editEmbedIn.md) - [$editIn](./bdscript/editIn.md) - [$editMessage](./bdscript/editMessage.md) - [$ephemeral](./bdscript/ephemeral.md) - - [$isMentioned](./bdscript/isMentioned.md) - - [$mentioned](./bdscript/mentioned.md) - - [$nomention](./bdscript/nomention.md) - [$getAttachments](./bdscript/getAttachments.md) - [$getEmbedData](./bdscript/getEmbedData.md) - [$getMessage](./bdscript/getMessage.md) - - [$isMessageEdited](./bdscript/isMessageEdited.md) - [$ignoreLinks](./bdscript/ignoreLinks.md) + - [$isMentioned](./bdscript/isMentioned.md) + - [$isMessageEdited](./bdscript/isMessageEdited.md) + - [$mentioned](./bdscript/mentioned.md) + - [$mentionedChannels](./bdscript/mentionedChannels.md) - [$message](./bdscript/message.md) - [$message[]](./bdscript/messageComplex.md) + - [$messageEditedTimestamp](./bdscript/messageEditedTimestamp.md) - [$messageID](./bdscript/messageID.md) + - [$noMentionMessage](./bdscript/noMentionMessage.md) + - [$noMentionMessage[]](./bdscript/noMentionMessageComplex.md) - [$pinMessage](./bdscript/pinMessage.md) - [$pinMessage[]](./bdscript/pinMessageComplex.md) - [$publishMessage](./bdscript/publishMessage.md) + - [$removeContains](./bdscript/removeContains.md) + - [$removeLinks](./bdscript/removeLinks.md) + - [$removeLinks[]](./bdscript/removeLinksComplex.md) + - [$repliedMessageID](./bdscript/repliedMessageID.md) + - [$repliedMessageID[]](./bdscript/repliedMessageIDComplex.md) - [$reply](./bdscript/reply.md) - [$reply[]](./bdscript/replyComplex.md) - [$replyIn](./bdscript/replyIn.md) - - [$repliedMessageID](./bdscript/repliedMessageID.md) - - [$repliedMessageID[]](./bdscript/repliedMessageIDComplex.md) - - [$removeLinks](./bdscript/removeLinks.md) - - [$removeLinks[]](./bdscript/removeLinksComplex.md) - - [$noMentionMessage](./bdscript/noMentionMessage.md) - - [$noMentionMessage[]](./bdscript/noMentionMessageComplex.md) - [$sendEmbedMessage](./bdscript/sendEmbedMessage.md) - [$sendMessage](./bdscript/sendMessage.md) - - [$unpinMessage](./bdscript/unpinMessage.md) - - [$useChannel](./bdscript/useChannel.md) - [$tts](./bdscript/tts.md) + - [$unpinMessage](./bdscript/unpinMessage.md) - [$url](./bdscript/url.md) - - [Variables]() + - [$useChannel](./bdscript/useChannel.md) + - [Variable]() + - [$enabled](./bdscript/enabled.md) - [$getChannelVar](./bdscript/getChannelVar.md) - [$getLeaderboardPosition](./bdscript/getLeaderboardPosition.md) - [$getLeaderboardValue](./bdscript/getLeaderboardValue.md) @@ -452,21 +454,22 @@ - [$threadUserCount](./bdscript/threadUserCount.md) - [Emojis & Reactions]() - [$addCmdReactions](./bdscript/addCmdReactions.md) + - [$addEmoji](./bdscript/addEmoji.md) - [$addMessageReactions](./bdscript/addMessageReactions.md) - [$addReactions](./bdscript/addReactions.md) - [$clearReactions](./bdscript/clearReactions.md) - - [$getReactions](./bdscript/getReactions.md) - - [$userReacted](./bdscript/userReacted.md) - - [$addEmoji](./bdscript/addEmoji.md) - [$customEmoji](./bdscript/customEmoji.md) - [$emoteCount](./bdscript/emoteCount.md) - [$emojiExists](./bdscript/emojiExists.md) - [$emojiName](./bdscript/emojiName.md) + - [$getReactions](./bdscript/getReactions.md) - [$isEmojiAnimated](./bdscript/isEmojiAnimated.md) - [$removeEmoji](./bdscript/removeEmoji.md) + - [$userReacted](./bdscript/userReacted.md) - [Webhooks]() - [$webhookAvatarURL](./bdscript/webhookAvatarURL.md) - [$webhookColor](./bdscript/webhookColor.md) + - [$webhookContent](./bdscript/webhookContent.md) - [$webhookCreate](./bdscript/webhookCreate.md) - [$webhookDelete](./bdscript/webhookDelete.md) - [$webhookDescription](./bdscript/webhookDescription.md) @@ -474,16 +477,15 @@ - [$webhookSend](./bdscript/webhookSend.md) - [$webhookTitle](./bdscript/webhookTitle.md) - [$webhookUsername](./bdscript/webhookUsername.md) - - [$webhookContent](./bdscript/webhookContent.md) - [Error Handling]() - [$catch](./bdscript/catch.md) + - [$embedSuppressErrors](./bdscript/embedSuppressErrors.md) - [$endtry](./bdscript/endtry.md) - [$error](./bdscript/error.md) + - [$stop](./bdscript/stop.md) - [$suppressErrors](./bdscript/suppressErrors.md) - [$suppressErrors[]](./bdscript/suppressErrorsComplex.md) - [$try](./bdscript/try.md) - - [$stop](./bdscript/stop.md) - - [$embedSuppressErrors](./bdscript/embedSuppressErrors.md) - [Permissions]() - [$checkUserPerms](./bdscript/checkUserPerms.md) - [$ignoreChannels](./bdscript/ignoreChannels.md) diff --git a/src/bdscript/addContainer.md b/src/bdscript/addContainer.md index a822dcf1313..0733de922f0 100644 --- a/src/bdscript/addContainer.md +++ b/src/bdscript/addContainer.md @@ -31,6 +31,7 @@ You can't have multiple containers and [sections](./addSection.md) **with the sa ## Container Components - [`$addTextDisplay[]`](./addTextDisplay.md) - [`$addSeparator[]`](./addSeparator.md) +- [`$addMediaGallery[]`](./addMediaGallery.md) ## Example ``` diff --git a/src/bdscript/addMediaGallery.md b/src/bdscript/addMediaGallery.md new file mode 100644 index 00000000000..12765657ca7 --- /dev/null +++ b/src/bdscript/addMediaGallery.md @@ -0,0 +1,26 @@ +# $addMediaGallery +
+ Components v2 +
+ +Adds a media gallery to the message. + +## Syntax +``` +$addMediaGallery[Gallery name;(Container name)] +``` + +### Parameters +- `Gallery name` `(Type: String || Flag: Required)`: Name for attaching pictures to the gallery. +- `Container name` `(Type: String || Flag: Optional)`: To which [container body](./addContainer.md) should the gallery be attached. + +## Example +``` +$nomention +$addMediaGallery[pictures] +$addMediaGalleryItem[$authorAvatar;;;pictures] +``` + +```admonish question title="What is this?" +How [`$addMediaGalleryItem[]`](./addMediaGalleryItem.md) and [`$authorAvatar`](./authorAvatar.md) works? +``` \ No newline at end of file diff --git a/src/bdscript/addMediaGalleryItem.md b/src/bdscript/addMediaGalleryItem.md new file mode 100644 index 00000000000..9860ba02677 --- /dev/null +++ b/src/bdscript/addMediaGalleryItem.md @@ -0,0 +1,32 @@ +# $addMediaGalleryItem +
+ Components v2 +
+ +Adds a media to the gallery. + +## Syntax +``` +$addMediaGalleryItem[Media URL;Description;Spoiler?;(Gallery name)] +``` + +```admonish warning title="Limit" +You can add up to 10 media items to a gallery. +``` + +### Parameters +- `Media URL` `(Type: URL || Flag: Required)`: URL of the media (image or video). +- `Description` `(Type: String || Flag: Emptiable)`: Alt text for the media item. +- `Spoiler?` `(Type: Bool || Flag: Emptiable)`: Will the media have a spoiler effect? +- `Gallery name` `(Type: String || Flag: Required)`: Name of the media gallery to add item to. + +## Example +``` +$nomention +$addMediaGallery[pictures] +$addMediaGalleryItem[$authorAvatar;;;pictures] +``` + +```admonish question title="What is this?" +How [`$addMediaGallery[]`](./addMediaGallery.md) and [`$authorAvatar`](./authorAvatar.md) works? +``` \ No newline at end of file diff --git a/src/bdscript/alternativeParsing.md b/src/bdscript/alternativeParsing.md index eb9dd2bd664..a4581a313d8 100644 --- a/src/bdscript/alternativeParsing.md +++ b/src/bdscript/alternativeParsing.md @@ -39,29 +39,29 @@ This function was added at the end of 2019 as an experiment, and it can be unsta ``` 3. Execute commands. ``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" content: | hello -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: embed: description: "\"hello\"" -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" content: | helloworld -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: embed: @@ -73,28 +73,28 @@ This function was added at the end of 2019 as an experiment, and it can be unsta - Without `$alternativeParsing`: ``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" content: | hello -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: embed: description: "\"hello\"" -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" content: | helloworld -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: embeds: diff --git a/src/bdscript/awaitFunc.md b/src/bdscript/awaitFunc.md index 9ee3ca26592..1a9e9166faa 100644 --- a/src/bdscript/awaitFunc.md +++ b/src/bdscript/awaitFunc.md @@ -19,15 +19,15 @@ $awaitFunc[say] ``` ``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 566363823137882154 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | What do you want me to say? diff --git a/src/bdscript/boostCount.md b/src/bdscript/boostCount.md index 69ac345847a..8d93eca4ad4 100644 --- a/src/bdscript/boostCount.md +++ b/src/bdscript/boostCount.md @@ -12,7 +12,19 @@ $nomention This server currently has $boostCount boost(s). ``` -```discord yaml +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + This server currently has 11 boost(s). - type: boost content: | RainbowKey just boosted the server! diff --git a/src/bdscript/boostCountComplex.md b/src/bdscript/boostCountComplex.md index 1c2fb5fa848..6cddc0384bc 100644 --- a/src/bdscript/boostCountComplex.md +++ b/src/bdscript/boostCountComplex.md @@ -12,13 +12,10 @@ $boostCount[Guild ID] ## Example ``` $nomention -This server currently has $boostCount[$message] boost(s). +Boosts: $boostCount[$message] ``` ```discord yaml -- type: boost - content: | - RainbowKey just boosted the server! - user_id: 803569638084313098 username: RainbowKey color: "#E67E22" @@ -30,5 +27,9 @@ This server currently has $boostCount[$message] boost(s). bot: true verified: true content: | - This server currently has 38 boost(s). + Boosts: 38 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? ``` diff --git a/src/bdscript/botID.md b/src/bdscript/botID.md index 5a8055edde3..886a744e962 100644 --- a/src/bdscript/botID.md +++ b/src/bdscript/botID.md @@ -9,7 +9,7 @@ $botID ## Example ``` $nomention -My ID is: $botID +My ID: $botID ``` ```discord yaml diff --git a/src/bdscript/botOwnerID.md b/src/bdscript/botOwnerID.md index 7e4b0f3ea66..a3601285a43 100644 --- a/src/bdscript/botOwnerID.md +++ b/src/bdscript/botOwnerID.md @@ -17,16 +17,16 @@ My owner's ID: $botOwnerID ``` ``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 566363823137882154 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | - My owner's ID: 729343563401265193 + My owner's ID: 803569638084313098 ``` diff --git a/src/bdscript/c.md b/src/bdscript/c.md index faa4600763b..f1fe7e9b78f 100644 --- a/src/bdscript/c.md +++ b/src/bdscript/c.md @@ -17,15 +17,15 @@ $c[This is a say command. You are reading a comment!] ``` ``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" content: | !example As you can see, the comment doesn't appear! Pretty cool; right? -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | As you can see, the comment doesn't appear! Pretty cool; right? diff --git a/src/bdscript/channelIDFromName.md b/src/bdscript/channelIDFromName.md index c2c75a1fbb4..d32f3072dd8 100644 --- a/src/bdscript/channelIDFromName.md +++ b/src/bdscript/channelIDFromName.md @@ -2,11 +2,11 @@
Deprecated
+ +Returns a channel's ID from its name. > This function is deprecated, instead better use [`$channelID[]`](./channelIDComplex.md). -Returns a channel's ID from its name. - ## Syntax ``` $channelIDFromName[Channel name] diff --git a/src/bdscript/clearReactions.md b/src/bdscript/clearReactions.md index c144367b89a..ce5f5a4073d 100644 --- a/src/bdscript/clearReactions.md +++ b/src/bdscript/clearReactions.md @@ -47,3 +47,7 @@ $clearReactions[$channelID;$message;✅] content: | !example 1216863258708021248 ``` + +```admonish question title="What is this?" +How [`$channelID`](./channelID.md) and [`$message`](./message.md) works? +``` \ No newline at end of file diff --git a/src/bdscript/commandFolder.md b/src/bdscript/commandFolder.md index bbf14f36a8e..9c3138d47f3 100644 --- a/src/bdscript/commandFolder.md +++ b/src/bdscript/commandFolder.md @@ -17,7 +17,7 @@ Commmand folder: $commandFolder username: RainbowKey color: "#E67E22" content: | - !example Hello world! + !example - username: BDFD Support user_id: 1009018156494368798 color: "#378afa" diff --git a/src/bdscript/commandName.md b/src/bdscript/commandName.md index 0ea23ca099d..2ad247f1942 100644 --- a/src/bdscript/commandName.md +++ b/src/bdscript/commandName.md @@ -17,12 +17,12 @@ Commmand name: $commandName username: RainbowKey color: "#E67E22" content: | - !example Hello world! + !example - username: BDFD Support user_id: 1009018156494368798 color: "#378afa" bot: true verified: true content: | - Commmand name: !example + Commmand name: Examples ``` diff --git a/src/bdscript/commandTrigger.md b/src/bdscript/commandTrigger.md index 8e9628c1e8a..bc004eca886 100644 --- a/src/bdscript/commandTrigger.md +++ b/src/bdscript/commandTrigger.md @@ -21,7 +21,7 @@ Commmand trigger: $commandTrigger username: RainbowKey color: "#E67E22" content: | - !example Hello world! + !example - username: BDFD Support user_id: 1009018156494368798 color: "#378afa" diff --git a/src/bdscript/commandsCount.md b/src/bdscript/commandsCount.md index 79a7d1a8d4f..3cd105de7d4 100644 --- a/src/bdscript/commandsCount.md +++ b/src/bdscript/commandsCount.md @@ -13,15 +13,15 @@ I have $commandsCount commands! ``` ```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 566363823137882154 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | I have 85 commands! diff --git a/src/bdscript/customEmoji.md b/src/bdscript/customEmoji.md index 49c31c241dc..219a542932d 100644 --- a/src/bdscript/customEmoji.md +++ b/src/bdscript/customEmoji.md @@ -1,8 +1,8 @@ # $customEmoji -Returns a custom emoji. +Returns a custom emoji on the current server. -```admonish danger title="Important" -We recommend emoji IDs instead of `$customEmoji[]` **for public** bots. +```admonish warning title="Important" +We recommend emoji IDs instead of `$customEmoji[]` **for public** bots. ``` ## Syntax @@ -16,7 +16,20 @@ $customEmoji[Emoji name] ## Example ``` $nomention -Hello there! $customEmoji[Wave] +Hello bdfd! $customEmoji[BDFD] ``` -![Example](https://user-images.githubusercontent.com/69215413/122825469-fa934f80-d2af-11eb-9563-67552204beb5.png) +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello bdfd! +``` \ No newline at end of file diff --git a/src/bdscript/deletecommand.md b/src/bdscript/deletecommand.md index 8eb1f6cae02..ef12c42349c 100644 --- a/src/bdscript/deletecommand.md +++ b/src/bdscript/deletecommand.md @@ -1,14 +1,18 @@ # $deletecommand Deletes the author's command message. - -> The bot must have the `manage_messages` permission. + +```admonish warning +The bot must have the `manage_messages` permission. +``` ## Syntax ``` $deletecommand ``` - -> Sometimes a message may be deleted, but you will still see it. This is a discord bug. + +```admonish note +Sometimes a message may be deleted, but you will still see it. This is a discord bug. +``` ## Example ``` diff --git a/src/bdscript/editSplitText.md b/src/bdscript/editSplitText.md index c9d0a9fd39c..508cb3a3676 100644 --- a/src/bdscript/editSplitText.md +++ b/src/bdscript/editSplitText.md @@ -1,35 +1,42 @@ -# $editSplitText -Edits a splitted text element using its index. - -## Syntax -``` -$editSplitText[Index;Value] -``` - -### Parameters -- `Index` `(Type: Integer || Flag: Required)`: The index of the element to edit. -- `Value` `(Type: String || Flag: Required)`: The new value to assign to the provided index. - -## Example -``` -$nomention - -$textSplit[$message; ] - -$var[Index;$splitText[$sub[$getTextSplitLength;1]]] -$var[Value;$splitText[$getTextSplitLength]] - -$removeSplitTextElement[$getTextSplitLength] -$removeSplitTextElement[$getTextSplitLength] - -$var[Text;$joinSplitText[ ]] - -$textSplit[$var[Text];] -$editSplitText[$var[Index];$var[Value]] - -Original Text: $var[Text] -New Text: $joinSplitText[] -``` -![example](https://user-images.githubusercontent.com/95774950/202880969-9ce5041a-cc6c-4bd2-a275-76e9d80be5b5.png) - -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +# $editSplitText +This function replaces the element at the specified index with a new element instead of the previous one. + +## Syntax +``` +$editSplitText[Index;Value] +``` + +### Parameters +- `Index` `(Type: Integer || Flag: Required)`: The index of the element to edit. +- `Value` `(Type: String || Flag: Required)`: The new value to assign to the provided index. + +## Example +``` +$nomention +$textSplit[Hello-world-!;-] +$editSplitText[2;bdfd] +> $joinSplitText[-] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello-bdfd-! +``` + +```admonish question title="What is this?" +How [`$textSplit[]`](./textSplit.md) and [`$joinSplitText[]`](./joinSplitText.md) works? +``` + +```admonish info title="Read more" +For more information, read the [Text Splitting Guide](../guides/general/textSplitting.md). +``` diff --git a/src/bdscript/editThread.md b/src/bdscript/editThread.md index bf55d40dcfa..05aa063d25b 100644 --- a/src/bdscript/editThread.md +++ b/src/bdscript/editThread.md @@ -3,21 +3,44 @@ Modifies an existing thread. ## Syntax ``` -$editThread[Thread ID;(Name;Archived;Archive duration;Locked;Slowmode)] +$editThread[Thread ID;(Thread name;Archived?;Archive duration;Locked?;Slowmode)] ``` ### Parameters - `Thread ID` `(Type: Snowflake || Flag: Required)`: The thread channel to edit. -- `Name` `(Type: String || Flag: Optional)`: The new name of the thread. -- `Archived` `(Type: Bool || Flag: Optional)`: Whether to archive this thread or not. -- `Archive duration` `(Type: Integer || Flag: Optional)`: The archive duration of this thread in minutes. Only 60, 1440,4320, 10080 can be used. Note that for the 4320 archive duration option, the server needs to be level 1 boosted, and for 10080 the server needs level 2. -- `Locked` `(Type: Bool || Flag: Optional)`: Whether to lock this thread or not. Note that archived threads can't be locked. +- `Thread name` `(Type: String || Flag: Optional)`: The new name of the thread. +- `Archived?` `(Type: Bool || Flag: Optional)`: Whether to archive this thread or not. +- `Archive duration` `(Type: Integer || Flag: Optional)`: The [archive duration](#archive-duration) after which the thread will be auto-archived due to inactivity. Defaults to `60`. +- `Locked?` `(Type: Bool || Flag: Optional)`: Whether to lock this thread or not. Note that archived threads can't be locked. - `Slowmode` `(Type: Integer || Flag: Optional)`: The slowmode of this channel, expressed in seconds. -> You can use `!unchanged` as an parameter for the option to remain in its current state. +```admonish tip +Use `!unchanged` as an argument for the option to remain in its current state. +``` + +### Archive Duration +`60` - 1 Hour\ +`1440` - 1 Day\ +`4320` - 3 Days (Only for servers with level 1 boosted)\ +`10080` - 7 Days (Only for servers with level 2 boosted) ## Example ``` $nomention $editThread[1098166444111433819;Cool Thread 😎;no;!unchanged;!unchanged;5] ``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- type: edit + content: | + BDFD Support changed the channel name: Cool Thread 😎 +``` + +```admonish info title="Read more" +For more information, read the [Threads Guide](../guides/general/threads.md). +``` diff --git a/src/bdscript/else.md b/src/bdscript/else.md index c3a9b1899ac..c0e872d7508 100644 --- a/src/bdscript/else.md +++ b/src/bdscript/else.md @@ -22,9 +22,10 @@ $endif color: "#E67E22" content: | !example -- username: BDFD Support - color: "#378afa" - bot: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | You are the developer of this bot! @@ -33,9 +34,10 @@ $endif color: "#FF0000" content: | !example -- username: BDFD Support - color: "#378afa" - bot: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | You are not the developer of this bot! diff --git a/src/bdscript/emoteCount.md b/src/bdscript/emoteCount.md index d67f32074da..b483d60add3 100644 --- a/src/bdscript/emoteCount.md +++ b/src/bdscript/emoteCount.md @@ -9,7 +9,7 @@ $emoteCount ## Example ``` $nomention -There are $emoteCount emojis in $serverName[$guildID]! +There are $emoteCount emojis in this server! ``` ```discord yaml @@ -24,9 +24,5 @@ There are $emoteCount emojis in $serverName[$guildID]! bot: true verified: true content: | - There are 149 emojis in Bot Designer for Discord Official Server! -``` - -```admonish question title="What is this?" -How [`$serverName[]`](./serverName.md) and [`$guildID`](./guildID.md) works? + There are 149 emojis in this server! ``` diff --git a/src/bdscript/endif.md b/src/bdscript/endif.md index 2d7290399be..6c6a004d898 100644 --- a/src/bdscript/endif.md +++ b/src/bdscript/endif.md @@ -20,13 +20,16 @@ $endif color: "#E67E22" content: | !example BDFD -- username: BDFD Support - color: "#378afa" - bot: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | I love BDFD! ``` + +~~~admonish example - Without `$endif`: @@ -36,14 +39,16 @@ $endif color: "#E67E22" content: | !example BDFD -- username: BDFD Support - color: "#378afa" - bot: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | $if not closed with $endif ``` - + +~~~ ```admonish info title="Read more" For more information, read the the [If Statements Guide](../guides/ifStatements.md). diff --git a/src/bdscript/endtry.md b/src/bdscript/endtry.md index e6ae4c85ed4..1960d2f17cd 100644 --- a/src/bdscript/endtry.md +++ b/src/bdscript/endtry.md @@ -18,7 +18,6 @@ $try $endtry ``` -- With `$endtry`: ```discord yaml - user_id: 803569638084313098 username: RainbowKey @@ -33,6 +32,8 @@ $endtry content: | 7 ``` + +~~~admonish example - Without `$endtry`: ```discord yaml @@ -48,7 +49,9 @@ $endtry verified: true content: | $try not closed with $endtry or invalid use of $sum -``` +``` + +~~~ ```admonish question title="What is this?" How [`$calculate[]`](./calculate.md), [`$message`](./message.md) and [`$try`](./try.md) works? diff --git a/src/bdscript/getServerInviteComplex.md b/src/bdscript/getServerInviteComplex.md index 4d16f35a357..d6b83da758d 100644 --- a/src/bdscript/getServerInviteComplex.md +++ b/src/bdscript/getServerInviteComplex.md @@ -26,4 +26,8 @@ Required permissions that the bot must have for this function to work properly : $nomention $getServerInvite[$message] ``` -![example](https://user-images.githubusercontent.com/111157596/232099171-ab1a4cea-836a-45e7-9a93-2012ac4012e5.png) +![example](https://user-images.githubusercontent.com/111157596/232099171-ab1a4cea-836a-45e7-9a93-2012ac4012e5.png) + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/getTextSplitIndex.md b/src/bdscript/getTextSplitIndex.md index 5ab34bbde3f..84ff02e9192 100644 --- a/src/bdscript/getTextSplitIndex.md +++ b/src/bdscript/getTextSplitIndex.md @@ -42,5 +42,11 @@ $textSplit[hello_world_!;_] content: | -1 ``` + +```admonish question title="What is this?" +How [`$textSplit[]`](./textSplit.md) works? +``` -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +```admonish info title="Read more" +For more information, read the [Text Splitting Guide](../guides/general/textSplitting.md). +``` \ No newline at end of file diff --git a/src/bdscript/getTextSplitLength.md b/src/bdscript/getTextSplitLength.md index 2c3fd6513cd..7604d360ac5 100644 --- a/src/bdscript/getTextSplitLength.md +++ b/src/bdscript/getTextSplitLength.md @@ -27,5 +27,11 @@ $textSplit[hello%world%!;%] content: | 3 ``` + +```admonish question title="What is this?" +How [`$textSplit[]`](./textSplit.md) works? +``` -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +```admonish info title="Read more" +For more information, read the [Text Splitting Guide](../guides/general/textSplitting.md). +``` \ No newline at end of file diff --git a/src/bdscript/giveRole.md b/src/bdscript/giveRole.md index 8bf55e08ce0..f152c3ffcfb 100644 --- a/src/bdscript/giveRole.md +++ b/src/bdscript/giveRole.md @@ -2,11 +2,11 @@
Deprecated
+ +Adds a role to the provided user. > This function is deprecated, instead better to use [`$roleGrant[]`](./roleGrant.md). -Adds a role to the provided user. - ## Syntax ``` $giveRole[User/Role ID;(Role ID)] diff --git a/src/bdscript/guildBanner.md b/src/bdscript/guildBanner.md index 96387db0047..c823b50a0a6 100644 --- a/src/bdscript/guildBanner.md +++ b/src/bdscript/guildBanner.md @@ -16,17 +16,21 @@ $guildBanner[$guildID] ``` ``` discord yaml -- username: Ivaylo - user_id: 1251981607468798089 +- user_id: 803569638084313098 + username: RainbowKey color: "#E67E22" content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 + !example 566363823137882154 +- user_id: 1009018156494368798 + username: BDFD Support color: "#378afa" bot: true verified: true - content: " " + content: attachments: - url: https://cdn.discordapp.com/banners/566363823137882154/a8cd6ed3d5c665e1443e5fe8fa2ab8c8.jpg ``` + +```admonish question title="What is this?" +How [`$guildID`](./guildID.md) works? +``` \ No newline at end of file diff --git a/src/bdscript/guildExists.md b/src/bdscript/guildExists.md index 5a91677a4c1..0200d80e20a 100644 --- a/src/bdscript/guildExists.md +++ b/src/bdscript/guildExists.md @@ -20,17 +20,30 @@ $guildExists[$message] ``` ``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 566363823137882154 -- username: BDFD Support - color: "#378afa" - bot: true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 566363823137882154 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | - true + true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example hdiroxkxjjwos6729394 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + false ``` ```admonish question title="What is this?" diff --git a/src/bdscript/guildID.md b/src/bdscript/guildID.md index d738a2258eb..51646e25289 100644 --- a/src/bdscript/guildID.md +++ b/src/bdscript/guildID.md @@ -9,7 +9,7 @@ $guildID ## Example ``` $nomention -Server's ID: $guildID +ID: $guildID ``` ```discord yaml @@ -24,5 +24,5 @@ Server's ID: $guildID bot: true verified: true content: | - Server's ID: 566363823137882154 + ID: 566363823137882154 ``` diff --git a/src/bdscript/guildIDComplex.md b/src/bdscript/guildIDComplex.md index 03e28569a39..51c010edae1 100644 --- a/src/bdscript/guildIDComplex.md +++ b/src/bdscript/guildIDComplex.md @@ -12,6 +12,36 @@ $guildID[Server name] ## Example ``` $nomention -$noMentionMessage ID is : $guildID[$noMentionMessage] +ID: $guildID[$message] ``` -![example](https://user-images.githubusercontent.com/70468667/219971506-204ba3e1-0909-448c-bf3f-63361ffdc62e.jpg) + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Bot Designer For Discord Official Server +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ID: 566363823137882154 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example B. Support +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ID: 1009018669982031912 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/isEmojiAnimated.md b/src/bdscript/isEmojiAnimated.md index 41bd20c0cd4..94157c068e4 100644 --- a/src/bdscript/isEmojiAnimated.md +++ b/src/bdscript/isEmojiAnimated.md @@ -16,8 +16,8 @@ Is emoji animated?: $isEmojiAnimated[$message] ``` ``` discord yaml -- user_id: 1262009115689881702 - username: GettingBeatenByKito +- user_id: 803569638084313098 + username: RainbowKey color: "#E67E22" content: | !example 760463263879135242 diff --git a/src/bdscript/joinSplitText.md b/src/bdscript/joinSplitText.md index 23908d9663d..fc0cb4d8e2b 100644 --- a/src/bdscript/joinSplitText.md +++ b/src/bdscript/joinSplitText.md @@ -36,4 +36,6 @@ $joinSplitText[+] How [`$textSplit[]`](./textSplit.md) and [`$message`](./message.md) works? ``` -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +```admonish info title="Read more" +For more information, read the [Text Splitting Guide](../guides/general/textSplitting.md). +``` diff --git a/src/bdscript/linesCount.md b/src/bdscript/linesCount.md index efa5956ee6d..3553cfb8bc4 100644 --- a/src/bdscript/linesCount.md +++ b/src/bdscript/linesCount.md @@ -16,8 +16,8 @@ $linesCount[$message] ``` ``` discord yaml -- username: Ivaylo - user_id: 1251981607468798089 +- user_id: 803569638084313098 + username: RainbowKey color: "#E67E22" content: | !example Hello World! diff --git a/src/bdscript/membersCount.md b/src/bdscript/membersCount.md index 011d233b00c..e9e27b0e0c1 100644 --- a/src/bdscript/membersCount.md +++ b/src/bdscript/membersCount.md @@ -9,13 +9,28 @@ $membersCount ## Example ``` $nomention -This server has $membersCount members +This server has $membersCount members! ``` -![example1](https://user-images.githubusercontent.com/70468667/219971581-9eca0e8e-0b85-4ee3-b5e1-42b4fae2178a.jpg) +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + This server has 5281 members! +``` +```admonish example -## Note You can use `$membersCount` in the bot status to display how many users are in all servers of the bot. -![example2](https://user-images.githubusercontent.com/70468667/219971617-d3cd270f-792a-415b-b9de-2651fc9d7f08.jpg) +![example](https://user-images.githubusercontent.com/70468667/219971617-d3cd270f-792a-415b-b9de-2651fc9d7f08.jpg) + +``` \ No newline at end of file diff --git a/src/bdscript/membersCountComplex.md b/src/bdscript/membersCountComplex.md index e50689874e5..b8449bc14b1 100644 --- a/src/bdscript/membersCountComplex.md +++ b/src/bdscript/membersCountComplex.md @@ -21,6 +21,20 @@ This function requires the following privileged intents: ## Example ``` $nomention -there are $membersCount[online] online users in this server +There are $membersCount[online] online users in this server! ``` -![example](https://user-images.githubusercontent.com/70468667/219971665-9185a0b7-52e8-44eb-8d43-e5e2455bcbe3.jpg) + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + There are 67 online users in this server! +``` \ No newline at end of file diff --git a/src/bdscript/mentionedChannels.md b/src/bdscript/mentionedChannels.md index 9b3688d1d23..71863c8c54b 100644 --- a/src/bdscript/mentionedChannels.md +++ b/src/bdscript/mentionedChannels.md @@ -17,7 +17,20 @@ $mentionedChannels[Mention number;(Return current?)] ## Example ``` $nomention -$mentionedChannels[1] +Channel: $mentionedChannels[1] ``` -![example](https://user-images.githubusercontent.com/69215413/126917253-33db5d96-fdb3-43a3-b614-1ac061701fb1.png) +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <#main-chat> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Channel: 566370477967147018 +``` diff --git a/src/bdscript/modifyChannelPerms.md b/src/bdscript/modifyChannelPerms.md index 6330fbeae43..cf2e48bb40d 100644 --- a/src/bdscript/modifyChannelPerms.md +++ b/src/bdscript/modifyChannelPerms.md @@ -2,11 +2,12 @@
Deprecated
+ +Modifies a channel's permissions. ```admonish warning This function has been deprecated in favor of [`$editChannelPerms[]`](./editChannelPerms.md). ``` -Modifies a channel's permissions. ## Syntax ``` diff --git a/src/bdscript/mute.md b/src/bdscript/mute.md index 5578fa2f580..a35e44ccc63 100644 --- a/src/bdscript/mute.md +++ b/src/bdscript/mute.md @@ -1,14 +1,14 @@ # $mute
Deprecated -
+
+ +Mutes the mentioned user. ```admonish warning As of December 2021, this function has been deprecated in favor of [`$timeout[]`](./timeout.md). ``` -Mutes the mentioned user. - ## Syntax ``` $mute[Muted Role Name] diff --git a/src/bdscript/random.md b/src/bdscript/random.md index cc88f14930e..94e2aa64f66 100644 --- a/src/bdscript/random.md +++ b/src/bdscript/random.md @@ -25,4 +25,30 @@ The random number is **$random** verified: true content: | The random number is 4 -``` +``` + +~~~admonish example +You can use [`$enableDecimals[]`](./enableDecimals.md) to disable or enable decimals: + +``` +$nomention +$enableDecimals[yes] +The random number is **$random** +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + The random number is 2.3 +``` + +~~~ \ No newline at end of file diff --git a/src/bdscript/randomComplex.md b/src/bdscript/randomComplex.md index df0efe59844..2ba62a99a62 100644 --- a/src/bdscript/randomComplex.md +++ b/src/bdscript/randomComplex.md @@ -15,7 +15,7 @@ $random[Min;Max] - `Max` `(Type: Integer, Float || Flag: Required)`: The maximum value. ```admonish failure -The `Max` value cannot be greater than or equal to the `Min` value. +The `Min` value cannot be greater than or equal to the `Max` value. - ❌ `Max` <= `Min` - ✅ `Max` > `Min` ``` @@ -39,4 +39,30 @@ The random number is **$random[1;21]** verified: true content: | The random number is 16 -``` +``` + +~~~admonish example +You can use [`$enableDecimals[]`](./enableDecimals.md) to disable or enable decimals: + +``` +$nomention +$enableDecimals[yes] +The random number is **$random[1;21]** +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + The random number is 13.1 +``` + +~~~ diff --git a/src/bdscript/removeSplitTextElement.md b/src/bdscript/removeSplitTextElement.md index a77410aa9e1..b16a20c1863 100644 --- a/src/bdscript/removeSplitTextElement.md +++ b/src/bdscript/removeSplitTextElement.md @@ -1,14 +1,37 @@ -# $removeSplitTextElement -Removes a certain element from the [`$textSplit[]`](./textSplit.md) values. - -> This function is unneeded, if `$textSplit[]` isn't present in the code. - -## Syntax -``` -$removeSplitTextElement[Index] -``` - -### Parameters -- `Index` `(Type: Integer || Flag: Required)`: The index of the `$textSplit[]` value to remove. - -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +# $removeSplitTextElement +This function removes an element from the separated text by the specified index. + +## Syntax +``` +$removeSplitTextElement[Index] +``` + +### Parameters +- `Index` `(Type: Integer || Flag: Required)`: The index of the `$textSplit[]` value to remove. + +## Example +``` +$nomention +$textSplit[hello-world-!;-] +$removeSplitTextElement[3] +> $joinSplitText[-] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + hello-world +``` + +```admonish info title="Read more" +For more information, read the [Text Splitting Guide](../guides/general/textSplitting.md). +``` diff --git a/src/bdscript/repeatMessage.md b/src/bdscript/repeatMessage.md index 73eef757718..b900d801049 100644 --- a/src/bdscript/repeatMessage.md +++ b/src/bdscript/repeatMessage.md @@ -3,12 +3,12 @@ Repeats the provided text a certain amount of times. ## Syntax ``` -$repeatMessage[Amount;Message] +$repeatMessage[Amount;Text] ``` ### 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. +- `Text` `(Type: String || Flag: Emptiable)`: The text to repeat. ## Example ``` @@ -31,6 +31,28 @@ $repeatMessage[5;Hello World!] Hello World!Hello World!Hello World!Hello World!Hello World! ``` -```admonish info -You can use a space at the end of "text" in the `Message` parameter, so there are spaces in-between repeats. -``` +~~~admonish example + +You can use a space at the end of "text" in the `Text` parameter, so there are spaces in-between repeats: + +``` +$nomention +$repeatMessage[5;Hello World! ] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Hello World! Hello World! Hello World! Hello World! Hello World! +``` + +~~~ diff --git a/src/bdscript/serverCount.md b/src/bdscript/serverCount.md index 460ce2166f1..f3dde4a6c04 100644 --- a/src/bdscript/serverCount.md +++ b/src/bdscript/serverCount.md @@ -26,5 +26,7 @@ I'm currently in $serverCount servers! content: | I'm currently in 203 servers! ``` - -> Can be used in bot status + +```admonish note +Can be used in bot status. +``` diff --git a/src/bdscript/serverDescriptionComplex.md b/src/bdscript/serverDescriptionComplex.md index 70e712eaf62..cfb76125cf0 100644 --- a/src/bdscript/serverDescriptionComplex.md +++ b/src/bdscript/serverDescriptionComplex.md @@ -28,4 +28,8 @@ Server description: $serverDescription[$message] verified: true content: | Server description: Welcome to the BDFD Support server! Enjoy stay with us! +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? ``` diff --git a/src/bdscript/serverName.md b/src/bdscript/serverName.md index 5cf7d8661a7..3ce56beb657 100644 --- a/src/bdscript/serverName.md +++ b/src/bdscript/serverName.md @@ -8,24 +8,27 @@ $serverName[Guild ID] ### Parameters - `Guild ID` `(Type: Snowflake || Flag: Required)`: The server to get the name of. Use [`$guildID`](./guildID.md) for the current server. - -> The bot must be present in the server to return its name. + +```admonish warning +The bot must be present in the server to return its name. +``` ## Example ``` $nomention Server Name: $serverName[$guildID] -``` +``` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - color: "#378afa" - bot: true +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true verified: true content: | Server Name: Bot Designer for Discord Official Server diff --git a/src/bdscript/serverOwner.md b/src/bdscript/serverOwner.md index 56bf4ecbd32..5b9b060a1b0 100644 --- a/src/bdscript/serverOwner.md +++ b/src/bdscript/serverOwner.md @@ -23,7 +23,6 @@ This server is owned by <@$serverOwner>! color: "#378afa" bot: true verified: true - highlight: true content: | - This server is owned by <@RainbowKey>! + This server is owned by <@Kuba>! ``` diff --git a/src/bdscript/serverOwnerComplex.md b/src/bdscript/serverOwnerComplex.md index 6e0b7cb841e..34a1159b0e8 100644 --- a/src/bdscript/serverOwnerComplex.md +++ b/src/bdscript/serverOwnerComplex.md @@ -8,8 +8,10 @@ $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. + +```admonish warning +The bot must be present in the server in order to get the server owner ID. +``` ## Example ``` @@ -29,8 +31,7 @@ This server is owned by <@$serverOwner[$guildID]>! bot: true verified: true content: | - This server is owned by <@RainbowKey>! - highlight: true + This server is owned by <@Kuba>! ``` ```admonish question title="What is this?" diff --git a/src/bdscript/serverRegion.md b/src/bdscript/serverRegion.md index dd83280957c..acd547116a5 100644 --- a/src/bdscript/serverRegion.md +++ b/src/bdscript/serverRegion.md @@ -2,11 +2,11 @@
Deprecated
+ +Returns the server's region. > This function is deprecated, because Discord removed the server region setting. For more information, [click here](https://support.discord.com/hc/en-us/articles/360060570993). -Returns the server's region. - ## Syntax ``` $serverRegion diff --git a/src/bdscript/serverVerificationLvl.md b/src/bdscript/serverVerificationLvl.md index 4dc0dae1432..eebb5456c07 100644 --- a/src/bdscript/serverVerificationLvl.md +++ b/src/bdscript/serverVerificationLvl.md @@ -13,14 +13,15 @@ This server's verification level is $serverVerificationLvl ``` ``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - color: "#378afa" - bot: true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true verified: true content: | This server's verification level is Low diff --git a/src/bdscript/splitText.md b/src/bdscript/splitText.md index be9218aff2e..8e4ed847734 100644 --- a/src/bdscript/splitText.md +++ b/src/bdscript/splitText.md @@ -38,4 +38,8 @@ $textSplit[hello world !; ] ```admonish question title="What is this?" How [`$textSplit[]`](./textSplit.md) works? -``` \ No newline at end of file +``` + +```admonish info title="Read more" +For more information, read the [Text Splitting Guide](../guides/general/textSplitting.md). +``` diff --git a/src/bdscript/startThread.md b/src/bdscript/startThread.md index adbdb3a29c1..09027d6b537 100644 --- a/src/bdscript/startThread.md +++ b/src/bdscript/startThread.md @@ -3,23 +3,51 @@ Creates a new thread in the provided channel. ## Syntax ``` -$startThread[Name;Channel ID;Message ID;(Archive duration;Return thread/channel ID?)] +$startThread[Thread name;Channel ID;Message ID;(Archive duration;Return thread ID?)] +``` + +```admonish info +Required permissions that the bot must have for this function to work properly: +- `createpublicthreads` ``` ### Parameters -- `Name` `(Type: String || Flag: Required)`: The name of the newly created thread. +- `Thread name` `(Type: String || Flag: Required)`: The name of the newly created thread. - `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the thread will be created. - `Message ID` `(Type: Snowflake || Flag: Emptiable)`: The message from which the thread will be created. Can be left empty. -- `Archive duration` `(Type: Integer || Flag: Optional)`: The duration after which the thread will be auto-archived due to inactivity. Accepts `60` (1 hour), `1440` (1 day), `4320` (3 days), or `10080` (7 days) as input. Defaults to `60`. -- `Return thread/channel ID?` `(Type: Bool || Flag: Optional)`: Whether to return the thread channel ID or not. Defaults to `no`. +- `Archive duration` `(Type: Integer || Flag: Optional)`: The [archive duration](#archive-duration) after which the thread will be auto-archived due to inactivity. Defaults to `60`. +- `Return thread ID?` `(Type: Bool || Flag: Optional)`: Whether to return the thread channel ID or not. Defaults to `no`. -### Permissions -Required permissions that the bot must have for this function to work properly: -- `createpublicthreads` +### Archive Duration +`60` - 1 Hour\ +`1440` - 1 Day\ +`4320` - 3 Days (Only for servers with level 1 boosted)\ +`10080` - 7 Days (Only for servers with level 2 boosted) ## Example ``` $nomention I created a new thread! <#$startThread[Cool Thread;$channelID;;1440;yes]> ``` -![example](https://user-images.githubusercontent.com/69215413/128615731-c61c95c1-d1ec-42cf-9964-e8722df30dfe.png) + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- type: thread + content: | + BDFD Support Started a thread: Cool Thread. See all threads. +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + I created a new thread! <#Cool Thread> +``` + +```admonish info title="Read more" +For more information, read the [Threads Guide](../guides/general/threads.md). +``` diff --git a/src/bdscript/takeRole.md b/src/bdscript/takeRole.md index 32296a5ed6c..4548882a8d9 100644 --- a/src/bdscript/takeRole.md +++ b/src/bdscript/takeRole.md @@ -2,13 +2,13 @@
Deprecated
+ +Removes a role from the provided/mentioned user. > As of December 2021, this function has been deprecated in favor of [`$roleGrant[]`](./roleGrant.md). > In order to remove a role from a user, the bot must have the `manageroles` permission. -Removes a role from the provided/mentioned user. - ## Syntax ``` $takeRole[User/Role ID;(Role ID)] diff --git a/src/bdscript/textSplit.md b/src/bdscript/textSplit.md index 5a6201f9293..dc1f16377d9 100644 --- a/src/bdscript/textSplit.md +++ b/src/bdscript/textSplit.md @@ -1,31 +1,41 @@ -# $textSplit -Splits the provided text by a given separator and saves the value temporarily. - -> 📌 To retrieve the split values, use [`$splitText`](./splitText.md). - -## Syntax -``` -$textSplit[Text;Separator] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to split. -- `Separator` `(Type: String || Flag: Emptiable)`: The separator to split the text with. If this parameter is empty, it separates the text by each character. - -### Example -``` -$nomention -$textSplit[Coffee, Tea, Milk;,] -$splitText[1] -``` -![Screenshot_20221029_203537](https://user-images.githubusercontent.com/95774950/198839569-338c0892-80ef-4e7a-bbb7-dd696c6ab15b.png) - -###### _In the above example, [`$textSplit`](#textsplit) splits the provided text using a comma (`,`) as the separator. After that, [`$splitText`](./splitText.md) is used to retrieve the first split value._ - -## Related Resources -- [Text Splitting Guide](../guides/general/textSplitting.md) -- [$getTextSplitIndex](./getTextSplitIndex.md) -- [$getTextSplitLength](./getTextSplitLength.md) -- [$joinSplitText](./joinSplitText.md) -- [$removeSplitTextElement](./removeSplitTextElement.md) -- [$splitText](./splitText.md) +# $textSplit +Splits the provided text by a given separator and saves the value temporarily. + +## Syntax +``` +$textSplit[Text;Separator] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to split. +- `Separator` `(Type: String || Flag: Emptiable)`: The separator to split the text with. If this parameter is empty, it separates the text by each character. + +## Example +``` +$nomention +$textSplit[Hello-world-!;-] +> $splitText[2] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + world +``` + +```admonish question title="What is this?" +How [`$splitText[]`](./splitText.md) works? +``` + +```admonish info title="Read more" +For more information, read the [Text Splitting Guide](../guides/general/textSplitting.md). +``` \ No newline at end of file diff --git a/src/bdscript/threadAddMember.md b/src/bdscript/threadAddMember.md index ceedb6649ef..7fc83bcc60a 100644 --- a/src/bdscript/threadAddMember.md +++ b/src/bdscript/threadAddMember.md @@ -13,14 +13,24 @@ $threadAddMember[Thread ID;User ID] ## Example ``` $nomention -$var[thread;$startThread[Cool Thread;$channelID;;60;yes]] -$threadAddMember[$var[thread];$authorID] +$threadAddMember[1021054508975009793;$authorID] ``` -![example1](https://user-images.githubusercontent.com/69215413/130260166-768cb59f-2377-49e3-9588-6425028484d9.png)\ -![example2](https://user-images.githubusercontent.com/69215413/130260148-0c6b54ec-96ea-4f94-9aee-8a583667d80d.png) -## Related Resources -- [Threads Guide](../guides/threads.md) -- [$editThread](./editThread.md) -- [$startThread](./startThread.md) -- [$threadRemoveMember](./threadRemoveMember.md) +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +``` +- In the thread: + +``` discord yaml +- type: join + content: | + BDFD Support added RainbowKey to the thread. +``` + +```admonish info title="Read more" +For more information, read the [Threads Guide](../guides/general/threads.md). +``` diff --git a/src/bdscript/threadMessageCount.md b/src/bdscript/threadMessageCount.md index 7090f210ee9..3077d007713 100644 --- a/src/bdscript/threadMessageCount.md +++ b/src/bdscript/threadMessageCount.md @@ -1,5 +1,5 @@ # $threadMessageCount -Returns the total number of users in the current thread. (**not including bot's response**) +Returns the total number of messages in the current thread. (**not including bot's response**) ## Syntax ``` @@ -41,3 +41,7 @@ This thread has a total of $threadMessageCount messages sent! content: | Nice! ``` + +```admonish info title="Read more" +For more information, read the [Threads Guide](../guides/general/threads.md). +``` diff --git a/src/bdscript/threadRemoveMember.md b/src/bdscript/threadRemoveMember.md index 4b2f405dd91..75c4d0caa31 100644 --- a/src/bdscript/threadRemoveMember.md +++ b/src/bdscript/threadRemoveMember.md @@ -11,14 +11,21 @@ $threadRemoveMember[Thread ID;User ID] - `User ID` `(Type: Snowflake || Flag: Required)`: The user to remove from the thread. ## Example +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example ``` -$nomention -$threadRemoveMember[878305123707785218;$authorID] +- In the thread: + +``` discord yaml +- type: leave + content: | + BDFD Support removed RainbowKey from the thread. ``` -![example](https://user-images.githubusercontent.com/69215413/130261147-1d44af9b-a951-4286-88a3-1908702d3fe0.png) -## Related Resources -- [Threads Guide](../guides/threads.md) -- [$editThread](./editThread.md) -- [$startThread](./startThread.md) -- [$threadAddMember](./threadAddMember.md) +```admonish info title="Read more" +For more information, read the [Threads Guide](../guides/general/threads.md). +``` diff --git a/src/bdscript/threadUserCount.md b/src/bdscript/threadUserCount.md index b31fd1279da..e1c8305aa9e 100644 --- a/src/bdscript/threadUserCount.md +++ b/src/bdscript/threadUserCount.md @@ -26,3 +26,7 @@ This thread has $threadUserCount users! content: | This thread has 29 users! ``` + +```admonish info title="Read more" +For more information, read the [Threads Guide](../guides/general/threads.md). +``` diff --git a/src/bdscript/unmute.md b/src/bdscript/unmute.md index 40af230eb27..46fa8ced755 100644 --- a/src/bdscript/unmute.md +++ b/src/bdscript/unmute.md @@ -3,11 +3,11 @@ Deprecated
+Unmutes the mentioned user. + ```admonish warning As of December 2021, this function has been deprecated in favor of [`$untimeout[]`](./untimeout.md). -``` - -Unmutes the mentioned user. +``` ## Syntax ``` diff --git a/src/bdscript/userJoinedDiscord.md b/src/bdscript/userJoinedDiscord.md index 91fb39a3c6e..3bae6e6bb45 100644 --- a/src/bdscript/userJoinedDiscord.md +++ b/src/bdscript/userJoinedDiscord.md @@ -3,11 +3,11 @@ Deprecated +Returns the account creation date of a given user. + ```admonish warning As of November 2022, this function has been deprecated in favor of [`$creationDate[]`](./creationDate.md). -``` - -Returns the account creation date of a given user. +``` ## Syntax ``` diff --git a/src/bdscript/var.md b/src/bdscript/var.md index fa4f550f504..4dee1c6bf7a 100644 --- a/src/bdscript/var.md +++ b/src/bdscript/var.md @@ -32,5 +32,5 @@ $addButton[no;interactionID;Example;secondary;;;$var[ID]] ![Example](https://user-images.githubusercontent.com/70456337/189480166-d37cbdb8-05ce-44e8-8f2e-14d030baa9a9.png) ```admonish info title="Read more" -For more information, read the the [Variables Guide](../guides/introduction/variables.md). +For more information, read the [Variables Guide](../guides/introduction/variables.md). ``` \ No newline at end of file diff --git a/src/bdscript/webhookAvatarURL.md b/src/bdscript/webhookAvatarURL.md index 054934d3a62..1c92ed9e899 100644 --- a/src/bdscript/webhookAvatarURL.md +++ b/src/bdscript/webhookAvatarURL.md @@ -38,5 +38,5 @@ How [`$webhookCreate[]`](./webhookCreate.md), [`$channelID`](./channelID.md), [` ``` ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/bdscript/webhookColor.md b/src/bdscript/webhookColor.md index 6a2d9b47739..360033b91f7 100644 --- a/src/bdscript/webhookColor.md +++ b/src/bdscript/webhookColor.md @@ -40,5 +40,5 @@ How [`$webhookCreate[]`](./webhookCreate.md), [`$webhookDescription[]`](./webhoo ``` ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/bdscript/webhookContent.md b/src/bdscript/webhookContent.md index befcaaa319a..c8e5e57ecb1 100644 --- a/src/bdscript/webhookContent.md +++ b/src/bdscript/webhookContent.md @@ -37,5 +37,5 @@ How [`$webhookCreate[]`](./webhookCreate.md), [`$channelID`](./channelID.md) and ``` ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/bdscript/webhookCreate.md b/src/bdscript/webhookCreate.md index c158dfd255b..9937645351f 100644 --- a/src/bdscript/webhookCreate.md +++ b/src/bdscript/webhookCreate.md @@ -72,5 +72,5 @@ Created and saved! ~~~ ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/bdscript/webhookDelete.md b/src/bdscript/webhookDelete.md index b95bcfcc3c7..db4e80077c4 100644 --- a/src/bdscript/webhookDelete.md +++ b/src/bdscript/webhookDelete.md @@ -37,5 +37,5 @@ How [`$webhookCreate[]`](./webhookCreate.md), [`$channelID`](./channelID.md) and ``` ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/bdscript/webhookDescription.md b/src/bdscript/webhookDescription.md index 196c1ee133d..fd3a13f4ae6 100644 --- a/src/bdscript/webhookDescription.md +++ b/src/bdscript/webhookDescription.md @@ -38,5 +38,5 @@ How [`$webhookCreate[]`](./webhookCreate.md), [`$channelID`](./channelID.md) and ``` ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/bdscript/webhookFooter.md b/src/bdscript/webhookFooter.md index a3c8fde84a1..9fa1cae3bde 100644 --- a/src/bdscript/webhookFooter.md +++ b/src/bdscript/webhookFooter.md @@ -38,5 +38,5 @@ How [`$webhookCreate[]`](./webhookCreate.md), [`$channelID`](./channelID.md) and ``` ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/bdscript/webhookSend.md b/src/bdscript/webhookSend.md index 51a15861ed8..70d3ac00197 100644 --- a/src/bdscript/webhookSend.md +++ b/src/bdscript/webhookSend.md @@ -54,5 +54,5 @@ How [`$webhookCreate[]`](./webhookCreate.md), [`$channelID`](./channelID.md) and ``` ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/bdscript/webhookTitle.md b/src/bdscript/webhookTitle.md index a79b02c01fe..d2633fa9987 100644 --- a/src/bdscript/webhookTitle.md +++ b/src/bdscript/webhookTitle.md @@ -38,5 +38,5 @@ How [`$webhookCreate[]`](./webhookCreate.md), [`$channelID`](./channelID.md) and ``` ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/bdscript/webhookUsername.md b/src/bdscript/webhookUsername.md index 26cf502548c..21239007091 100644 --- a/src/bdscript/webhookUsername.md +++ b/src/bdscript/webhookUsername.md @@ -38,5 +38,5 @@ How [`$webhookCreate[]`](./webhookCreate.md), [`$channelID`](./channelID.md) and ``` ```admonish info title="Read more" -For more information, read the the [Webhooks Guide](../guides/general/webhooks.md). +For more information, read the [Webhooks Guide](../guides/general/webhooks.md). ``` diff --git a/src/entityTransferPolicy.md b/src/entityTransferPolicy.md deleted file mode 100644 index 7e9131e4acf..00000000000 --- a/src/entityTransferPolicy.md +++ /dev/null @@ -1,41 +0,0 @@ - - -# Context - -- Bot Designer for Discord is a service provided by NilPointer Software. -- "Our service" refers to "Bot Designer for Discord". -- "Bot" refers to data held by BDFD describing the behaviour of a [Discord Bot](https://discord.com/developers/docs) on our service. -- "Hosting time" refers to the time duration left of a singular bot during which it will be hosted by our service. -- "Premium point" refers to BDFD premium in-app currency, granting users the ability for bots to have extended functionality for a limited time. -- "Premium time" refers to the time duration left for a singular bot during which it can access the extended functionality. - Premium time is related, but not strictly linked, with hosting time. Premium time might end before hosting time, but not vice-versa. -- "Promocode" or "promo code" refers to a randomly generated string of characters used to gain hosting or premium time. -- "BDFD entity" or "entity" refers to any piece of data that is being held by BDFD, that ownership of it or itself can be transferred. - In this policy, "entity" mainly refers to bots, hosting and premium time, and premium points. -- "Transfer request" refers to a request made by a user to BDFD developers for an entity transfer. - These requests can be made through a ticket on our [official Discord server](https://discord.gg/botdesigner). - -# Policy - -- Entities that can be transferred can only be transferred through a transfer request by the user that holds ownership of that entity. -- Requesting users must provide proof of ownership of the entities in question for the request to be granted. -- BDFD Accounts can not be transferred in any way. - -- Bots can only be transferred between BDFD accounts owned by a single user. -- Bot after its transfer retains any hosting or premium time the bot in question had left. -- A bot previously not assigned to any BDFD account can be transferred to an account of the user that holds ownership over the bot in question. - -- Premium points can be transferred between BDFD accounts owned by a single user. -- Premium points can be donated for a giveaway promotion on our [official Discord server](https://discord.gg/botdesigner). - -- Hosting and Premium time can only be transferred between bots owned by a single user. -- Hosting and Premium time can not be transferred to a promocode. -- Only premium time can be donated for a giveaway promotion on our [official Discord server](https://discord.gg/botdesigner). - ---- - -_Effective Date: 10 August, 2023._ diff --git a/src/guides/general/threads.md b/src/guides/general/threads.md index 6b52af8363b..b7e41071830 100644 --- a/src/guides/general/threads.md +++ b/src/guides/general/threads.md @@ -1,19 +1,21 @@ # Threads In this section, you'll learn how to integrate threads in your bot. - + ```admonish warning Make sure your bot has `SEND_MESSAGES_IN_THREADS` permission. -``` +``` ## Content -[**Functions Used**](#functions-used) > [**Archive Duration**](#archive-duration) > [**$startThread[]**](#startthread) > [**$editThread[]**](#editthread) > [**$threadAddMember[]**](#threadaddmember) > [**$threadRemoveMember[]**](#threadremovemember) > [**Simple Code**](#simple-code) +[**Functions Used**](#functions-used) > [**Archive Duration**](#archive-duration) > [**$startThread[]**](#startthread) > [**$editThread[]**](#editthread) > [**$threadAddMember[]**](#threadaddmember) > [**$threadRemoveMember[]**](#threadremovemember) > [**$threadUserCount[]**](#threadusercount) > [**$threadMessageCount[]**](#threadmessagecount) > [**Simple Code**](#simple-code) ## Functions Used - [`$startThread[]`](../../bdscript/startThread.md) - [`$editThread[]`](../../bdscript/editThread.md) - [`$threadAddMember`](../../bdscript/threadAddMember.md) - [`$threadRemoveMember[]`](../../bdscript/threadRemoveMember.md) +- [`$threadUserCount`](../../bdscript/threadUserCount.md) +- [`$threadMessageCount[]`](../../bdscript/threadMessageCount.md) ## Archive Duration `60` - 1 Hour\ @@ -28,11 +30,11 @@ Creates a new thread in the provided channel. ``` $startThread[Thread name;Channel ID;Message ID;(Archive duration;Return thread ID?)] ``` - + ```admonish info Required permissions that the bot must have for this function to work properly: - `createpublicthreads` -``` +``` ### Parameters - `Thread name` `(Type: String || Flag: Required)`: The name of the newly created thread. @@ -81,10 +83,10 @@ $editThread[Thread ID;(Thread name;Archived?;Archive duration;Locked?;Slowmode)] - `Archive duration` `(Type: Integer || Flag: Optional)`: The [archive duration](#archive-duration) after which the thread will be auto-archived due to inactivity. Defaults to `60`. - `Locked?` `(Type: Bool || Flag: Optional)`: Whether to lock this thread or not. Note that archived threads can't be locked. - `Slowmode` `(Type: Integer || Flag: Optional)`: The slowmode of this channel, expressed in seconds. - + ```admonish tip Use `!unchanged` as an argument for the option to remain in its current state. -``` +``` ## Example ``` @@ -165,6 +167,79 @@ $threadRemoveMember[Thread ID;User ID] ``` \ +# $threadUserCount +Returns the total number of users in the current thread. + +## Syntax +``` +$threadUserCount +``` + +## Example +``` +$nomention +This thread has $threadUserCount users! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + This thread has 29 users! +``` + +# $threadMessageCount +Returns the total number of messages in the current thread. (**not including bot's response**) + +## Syntax +``` +$threadMessageCount +``` + +## Example +``` +$nomention +This thread has a total of $threadMessageCount messages sent! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Hello guys! +- user_id: 390515191819010058 + username: kubastick + color: "#FF0000" + content: | + Hello RainbowKey! 👋 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + This thread has a total of 3 messages sent! +- user_id: 390515191819010058 + username: kubastick + color: "#FF0000" + content: | + Nice! +``` + # Simple Code ``` $nomention @@ -197,7 +272,8 @@ $threadAddMember[$var[id];$authorID] content: | BDFD Support added RainbowKey to the thread. ``` - -```admonish note + +```admonish note If you want to learn more about threads, read [Discord's support article](https://support.discord.com/hc/en-us/articles/4403205878423-Threads-FAQ). -``` + +``` diff --git a/src/premium/sendNotification.md b/src/premium/sendNotification.md index 6ac03a04a51..a9fd92e88d3 100644 --- a/src/premium/sendNotification.md +++ b/src/premium/sendNotification.md @@ -8,10 +8,6 @@ Sends a notification to your mobile phone. ```admonish warning title="Limit" Can be used every 20 minutes. ``` - -```admonish warning title="Limit" -Only for Android. Can't be used on iOS. -``` ## Syntax ``` diff --git a/src/resources/api.md b/src/resources/api.md index 2993765867c..9e2f12db871 100644 --- a/src/resources/api.md +++ b/src/resources/api.md @@ -5,7 +5,21 @@ Public Bot Designer for Discord API. summary { background: hsl(0deg 0% 100% / 5%) !important; } - + +.code-container { + background: transparent !important; +} + +.line-numbers { + display: none !important; + visibility: hidden !important; + border: none !important; +} + +.line-number { + display: none !important; +} + .mainAPI, .endpoint { background: var(--card-bg); border-radius: var(--border-radius); @@ -223,36 +237,36 @@ Read more about intents in the our "[Gateway Intents](../guides/introduction/gat ``` ## 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. +- `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](#Argument) | 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 | +| Field name | Type | Description | Can be empty? | Can be omitted? | +|------------------|---------------------------------|--------------------------------------------------------|---------------|----------------| +| tag | String | Function name | False | False | +| shortDescription | String | Description for a function without parameters | True | False | +| longDescription | String | Description for a function with parameters | True | False | +| arguments | Array of [Parameters](#parameters) | Parameters 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 | +### Parameter +| 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-Types) | Argument type. `\|` is used for a compound type | False | -| required | bool | Argument is required | False | -| tupleTypes | Array of [Arguments](#Argument) | 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 | +| name | String | Parameter name | False | +| description | String | Description for a function's parameter | True | +| type | String [Parameter Types](#parameter-types) | Parameter type. `\|` is used for a compound type | False | +| required | bool | Parameter is required | False | +| tupleTypes | Array of [Parameters](#parameters) | Array of parameters which can be repeated, i.e `Channel ID;Message ID;Channel ID;Message ID;...` | True | +| empty | Bool | Parameter can be empty | True | +| ellipsis | Bool | Parameter accepts more data, i.e `Username 1;Username 2;Username 3;...` | True | +| enumData | Array of Strings | Possible options accepted as parameter, i.e `primary/secondary/or/etc` | True | -### Argument Types +### Parameter Types Multiple types can be merged together with `|` *(OR)*. \ -Possible argument types: +Possible parameter types: - `String` - `Integer` - `Float` @@ -267,3 +281,6 @@ Possible argument types: - `Tuple` + + + diff --git a/src/resources/timeFormat.md b/src/resources/timeFormat.md index a5af41e10eb..10307bf7d1b 100644 --- a/src/resources/timeFormat.md +++ b/src/resources/timeFormat.md @@ -2,7 +2,7 @@ Custom time formatting values for [`$creationDate[]`](../bdscript/creationDate.md), [`$userJoinedDiscord[]`](../bdscript/userJoinedDiscord.md) and [`$userJoined[]`](../bdscript/userJoined.md) functions. ### Time Formats -List of supported time format values : +List of supported time format values: Value | Return Information --------------- | ---------------------------------------- @@ -34,6 +34,9 @@ MST | Timezone name -07[^1] | Timezone offset (±hh) -070000[^1] | Timezone offset (±hhmmss) -07:00:00[^1] | Timezone offset (±hh:mm:ss) + +```admonish info +All time format values are case insensitive (i.e both `MOH` and `Mon` will work). +``` -> All time format values are case insensitive (i.e both `MOH` and `Mon` will work). [^1]: Replacing the sign in the format with a Z character triggers the ISO 8601 behavior of printing Z instead of an offset for the UTC (+00:00) zone. diff --git a/src/settings.md b/src/settings.md index 3262721b381..8e557771e5b 100644 --- a/src/settings.md +++ b/src/settings.md @@ -1,13 +1,4 @@ -
- - - Experimental Feature! - If you encountered an error, please contact us on the official BDFD Support Server. - -
- # Settings - Let's customize your experience in our Bot Designer For Discord wiki world! diff --git a/src/termsAndPrivacy.md b/src/termsAndPrivacy.md new file mode 100644 index 00000000000..be76172f413 --- /dev/null +++ b/src/termsAndPrivacy.md @@ -0,0 +1,149 @@ +# Terms & Privacy +Review our Terms of Service and Privacy Policy. These legal documents outline the rules for using our service and how we collect, use, and protect your data. + + + + diff --git a/src/theme/book.js b/src/theme/book.js index 0939a29f689..a9a0edea7cd 100644 --- a/src/theme/book.js +++ b/src/theme/book.js @@ -222,55 +222,73 @@ if (window.playground_copyable) { })(); (function clipboard() { - const clipButtons = document.querySelectorAll(".clip-button"); - - function hideTooltip(elem) { - elem.firstChild.textContent = ""; - elem.className = "fa far fa-clipboard clip-button"; - } - - function showTooltip(elem, msg) { - elem.firstChild.textContent = msg; - elem.className = "fa far fa-clipboard tooltipped"; - } - - const clipboardSnippets = new ClipboardJS(".clip-button", { - text: (trigger) => { - hideTooltip(trigger); - const playground = trigger.closest("pre"); - return playground.querySelector("code").textContent; - }, - }); - - clipButtons.forEach((clipButton) => { - clipButton.addEventListener("mouseout", (e) => { - hideTooltip(e.currentTarget); - }); - }); - - clipboardSnippets.on("success", (e) => { - e.clearSelection(); - showTooltip(e.trigger, "Copied!"); - }); - - clipboardSnippets.on("error", (e) => { - showTooltip(e.trigger, "Clipboard error!"); - }); + const clipButtons = document.querySelectorAll(".clip-button"); + + function hideTooltip(elem) { + elem.firstChild.textContent = ""; + elem.className = "fa far fa-clipboard clip-button"; + } + + function showTooltip(elem, msg) { + elem.firstChild.textContent = msg; + elem.className = "fa far fa-clipboard tooltipped"; + } + + const clipboardSnippets = new ClipboardJS(".clip-button", { + text: (trigger) => { + hideTooltip(trigger); + const playground = trigger.closest("pre"); + + const codeElement = playground.querySelector("code"); + const codeLines = codeElement.querySelectorAll(".code-line"); + + if (codeLines.length > 0) { + const lines = []; + codeLines.forEach(line => { + lines.push(line.textContent); + }); + return lines.join('\n'); + } else { + return codeElement.textContent; + } + }, + }); + + clipButtons.forEach((clipButton) => { + clipButton.addEventListener("mouseout", (e) => { + hideTooltip(e.currentTarget); + }); + }); + + clipboardSnippets.on("success", (e) => { + e.clearSelection(); + showTooltip(e.trigger, "Copied!"); + }); + + clipboardSnippets.on("error", (e) => { + showTooltip(e.trigger, "Clipboard error!"); + }); })(); (function wrap() { - const wrapButtons = document.querySelectorAll(".wrap-button"); - wrapButtons.forEach((button) => { - button.addEventListener("click", (e) => { - const playground = button.closest("pre"); - const codeBlock = playground.querySelector("code"); - if (codeBlock.style.whiteSpace == "pre-wrap") { - codeBlock.style.whiteSpace = "pre"; - } else { - codeBlock.style.whiteSpace = "pre-wrap"; - } - }); - }); + const wrapButtons = document.querySelectorAll(".wrap-button"); + wrapButtons.forEach((button) => { + button.addEventListener("click", (e) => { + const playground = button.closest("pre"); + const codeContainer = playground.querySelector(".code-container"); + const lineNumbers = codeContainer.querySelectorAll(".line-number"); + const codeLines = codeContainer.querySelectorAll(".code-line"); + + codeContainer.classList.toggle("wrap-enabled"); + + codeLines.forEach((line, index) => { + if (lineNumbers[index]) { + const lineHeight = line.scrollHeight; + lineNumbers[index].style.height = lineHeight + 'px'; + } + }); + }); + }); })(); (function syntax() { @@ -381,3 +399,8 @@ if (window.playground_copyable) { { passive: true } ); })(); + + + + + diff --git a/src/theme/css/chrome.css b/src/theme/css/chrome.css index 31d79a7cb0f..9f88685f4d5 100644 --- a/src/theme/css/chrome.css +++ b/src/theme/css/chrome.css @@ -3,7 +3,7 @@ @import "variables.css"; ::-webkit-scrollbar { - background: var(--card-bg); + background: var(--dark-bg); } ::-webkit-scrollbar-thumb { @@ -11,7 +11,7 @@ } html { - scrollbar-color: var(--card-hover) var(--card-bg); + scrollbar-color: var(--card-hover) var(--dark-bg); } /* ===== Page Layout ===== */ @@ -43,6 +43,25 @@ html { margin: 0 auto; } +.objectInfo { + border: 1px solid rgba(255, 255, 255, 0.05); + background-color: var(--card-bg); + border-radius: var(--border-radius); + padding: 1rem; + padding-left: 1.5rem; + margin-top: 2rem; +} + +.objectInfo h1 { + margin-top: -.1rem; + margin-bottom: -1.2rem; +} + +.objectInfo p { + color: var(--text-secondary); + margin-bottom: 1rem; +} + /* ===== Content Card ===== */ .content-card { background: var(--card-bg); @@ -176,6 +195,83 @@ html { text-decoration: none; } +/* ===== Last edited ===== */ + +.last_file_edit { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + font-size: 1rem; + color: var(--text-secondary); + margin: 1rem 0; + padding: 1.3rem; + border: 1px solid rgba(255, 255, 255, 0.05); + background-color: var(--card-bg); + border-radius: var(--border-radius); +} + +.last_file_edit .edit-info { + display: flex; + align-items: center; + gap: 1rem; +} + +.last_file_edit .edit-avatar { + user-select: none; + -webkit-user-select: none; + width: 4rem; + height: 4rem; + border-radius: 50%; + object-fit: cover; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + flex-shrink: 0; +} + +.last_file_edit .edit-details { + display: flex; + flex-direction: column; + line-height: 1; + flex-grow: 1; +} + +.last_file_edit .edit-date-line { + margin-bottom: .45rem; +} + +.last_file_edit .edit-date { + color: var(--text-secondary); + font-weight: 600; + font-size: 1.45rem; +} + +.last_file_edit .edit-author-line { + margin-top: -1.5rem; + color: var(--text-secondary); +} + +.last_file_edit .edit-author { + font-size: 1.3rem; +} + +@media (max-width: 768px) { + .last_file_edit { + margin: 15px 0; + padding: 12px; + font-size: 12px; + } + + .last_file_edit .edit-avatar { + width: 32px; + height: 32px; + } + + .last_file_edit .edit-date { + font-size: 13px; + } + + .last_file_edit .edit-author { + font-size: 12px; + } +} + /* ===== Legacy Card Styles ===== */ .commandCard { display: flex; @@ -249,7 +345,8 @@ html { .functionTags { user-select: none; -webkit-user-select: none; - margin-top: -1rem; + margin-top: 1.5rem; + margin-bottom: -1rem; } .functionTags span { @@ -259,10 +356,9 @@ html { border: solid; border-width: 1px; border-radius: 10px; - font-size: 1.5rem; + font-size: 1rem; font-weight: bold; padding: 0.25rem 0.5rem 0.25rem 0.5rem; - transition: 0.3s; border-color: var(--link-color); color: var(--link-color); } @@ -295,11 +391,6 @@ html { content: "❗ "; } -.functionTags span:hover { - border-radius: 12.5px; - transition: 0.3s; -} - /* Playground */ .function-playground { @@ -630,40 +721,25 @@ a > .hljs { .editPage { user-select: none; -webkit-user-select: none; - border: solid; - border-width: 1px; border-radius: 10px; - border-color: var(--card-hover); - color: var(--link-color); + border: 1px solid rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.5) !important; width: fit-content; - padding: 5px; + padding: 1rem; text-decoration: none; - margin-top: -2.2rem; + margin-top: -2rem; text-align: center; display: block; margin-left: auto; - margin-right: 5px; font-size: 85%; transition: 0.3s; } .editPage:hover { - font-size: 87.5%; - border-radius: 8px; - border-color: var(--link-color); + border-color: rgba(255, 255, 255, 0.2); transition: 0.3s; } -@media (min-width: 750px) { - .editPage:after { - content: "Edit this page"; - } - - #editPageIcon { - padding-right: 0.4rem; - } -} - @media (max-width: 750px) { .editPage { visibility: hidden; @@ -676,19 +752,16 @@ a > .hljs { font-size: 2.5em; text-align: center; text-decoration: none; - position: fixed; top: 0; bottom: 0; margin: 0; max-width: 150px; min-width: 90px; - display: flex; justify-content: center; align-content: center; flex-direction: column; - transition: 0.5s; } @@ -699,51 +772,108 @@ a > .hljs { } .nav-wrapper { - margin-top: 20px; - display: none; + margin-top: 3rem; + display: block; + flex-wrap: wrap; + gap: 1rem; + width: 100%; + box-sizing: border-box; } +.nav-wide-wrapper { + display: none; +} .mobile-nav-chapters { - font-size: 2.5em; - text-align: center; - text-decoration: none; - width: 60px; - border-radius: 10px; - background-color: var(--card-bg) !important; - color: var(--link-color) !important; + height: 4.5rem; + font-size: 1.5rem; + text-align: center; + text-decoration: none; + border: 1px solid rgba(255, 255, 255, 0.05); + border-radius: var(--border-radius); + color: var(--text-secondary) !important; + transition: 0.4s; + display: flex; + align-items: center; + box-sizing: border-box; +} + +.mobile-nav-chapters i { + color: var(--link-color); + background-color: var(--card-bg); + padding: 1.15rem; + width: 4.5rem; + border-radius: var(--border-radius); + font-size: 2rem; + transition: 0.4s; +} + +.mobile-nav-chapters.previous .fa-angle-left { + margin-right: .75rem; +} + +.mobile-nav-chapters.next .fa-angle-right { + margin-left: .75rem; } .mobile-nav-chapters:hover i { - color: #ded; - transform: scale(1.05); - transition: 0.2s; + color: #ded !important; + border-radius: 20px; + transition: 0.4s; +} + +.mobile-nav-chapters:hover { + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 20px; + transition: 0.4s; } .previous { - float: left; + justify-content: flex-start; + float: left; + padding-right: 1.5rem; + margin-left: -.25rem; } .next { - float: right; - right: var(--page-padding); + justify-content: flex-end; + padding-left: 1.5rem; + float: right; + right: var(--page-padding); + margin-right: -.25rem; } -@media only screen and (max-width: 1080px) { - .nav-wide-wrapper { - display: none; - } - .nav-wrapper { - display: block; - } +.prev-page-info, +.next-page-info { + color: var(--text-secondary); } -@media only screen and (max-width: 1380px) { - .sidebar-visible .nav-wide-wrapper { - display: none; - } - .sidebar-visible .nav-wrapper { - display: block; - } +.prev-page-info { + text-align: left; +} + +.next-page-info { + text-align: right; +} + +@media (max-width: 500px) { + .prev-page-info, + .next-page-info { + font-size: 1rem; + } +} + +@media (max-width: 500px) { + .mobile-nav-chapters { + width: auto; + flex: 0 1 auto; + } + .mobile-nav-chapters { + width: 100%; + } + + .mobile-nav-chapters.previous { + margin-bottom: 1rem; + } } /* Inline code */ @@ -770,14 +900,94 @@ pre { } code.hljs:not(.discord-message code) { - background: var(--card-bg); - padding: 0.8em; margin-bottom: -0.5rem; + padding: 0; + overflow-y: hidden; +} + +.code-container { + display: flex; + font-size: 14px; + line-height: 1.5; + background: #1e1e1e; + border-radius: 4px; + overflow: hidden; + margin-top: -35px; + margin-bottom: -35px; + padding-bottom: 2px; +} + +.line-numbers { + background: #2d2d2d; + color: #858585; + padding: 1em 0.5em; + text-align: right; + user-select: none; + -webkit-user-select: none; + min-width: 3em; + margin-bottom: -10px; + border-right: 1px solid #404040; +} + +.line-number { + padding: 0 0.5em; + min-height: 1.5em; + white-space: nowrap; + display: block; + height: 1.5em; + line-height: 1.5em; + text-align: right; +} + +.code-content { + flex: 1; + padding: 1em; + overflow-x: auto; + white-space: pre; + tab-size: 4; + line-height: 1.5; + scrollbar-color: #2d2d2d transparent; +} + +.code-content::-webkit-scrollbar { + background: transparent; +} + +.code-content::-webkit-scrollbar-thumb { + background: #2d2d2d; +} + +.code-line { + white-space: pre; + line-height: 1.5; + min-height: 1.5em; + display: block; +} + +.code-container.wrap-enabled .code-content { + white-space: pre-wrap; + word-wrap: break-word; + word-break: break-word; +} + +.code-container.wrap-enabled .code-line { + white-space: pre-wrap; + word-wrap: break-word; + word-break: break-word; + min-height: auto; + height: auto; +} + +.code-container.wrap-enabled .line-number { + min-height: auto; + height: auto; + line-height: 1.5em; + vertical-align: top; } .nostyle { /* Disabled Code HL style */ - color: inherit !important; + color: var(--text-secondary) !important; font-weight: inherit !important; font-style: normal !important; } @@ -800,6 +1010,10 @@ summary.admonition-title { margin-bottom: -1.75rem !important; } +.admonition-anchor-link { + display: none !important; +} + /* Summary */ summary { @@ -842,7 +1056,7 @@ pre > .buttons { position: absolute; z-index: 100; right: -3px; - margin: 1px; + margin: 5px; padding: 1px; visibility: hidden; opacity: 0; @@ -1118,7 +1332,7 @@ ul#searchresults span.teaser em { .sidebar { position: fixed; left: 0; - top: 70px; /* Account for fixed navbar height */ + top: 65px; /* Account for fixed navbar height */ bottom: 0; width: var(--sidebar-width); font-size: 95%; @@ -1132,7 +1346,7 @@ ul#searchresults span.teaser em { border-right: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3); scrollbar-color: var(--card-hover) rgba(255, 0, 0, 0) !important; - z-index: 999; + z-index: 2500; } .sidebar code { @@ -1146,7 +1360,8 @@ ul#searchresults span.teaser em { bottom: 0; left: 0; right: 0; - padding: 20px 16px; + padding: .1rem 16px; + padding-bottom: 2rem; } .sidebar-hidden .sidebar { @@ -1396,3 +1611,6 @@ ul#searchresults span.teaser em { + + + diff --git a/src/theme/css/general.css b/src/theme/css/general.css index 8e8991b7247..4df99f654d2 100644 --- a/src/theme/css/general.css +++ b/src/theme/css/general.css @@ -44,6 +44,10 @@ code { h1 { margin-top: 2%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: 100%; } h2, @@ -117,23 +121,37 @@ h4 a.header:target { text-decoration: none; } +/* Tables */ + +.table-wrapper { + overflow-x: auto; +} + table { border-collapse: separate; border-spacing: 0; - border-radius: 10px; + border-radius: var(--border-radius); overflow: hidden; + width: 100%; box-shadow: 2px 10px 10px rgba(0, 0, 0, 0.3); + table-layout: auto; +} + +table td, table th { + max-width: 100rem; + word-wrap: break-word; + overflow-wrap: break-word; } table td { - padding: 6px 25px; + padding: 1rem 2rem; border: 0; border-radius: 0px !important; } table thead { background: var(--card-bg); - border-radius: 10px 10px 0 0; + border-radius: var(--border-radius) var(--border-radius) 0 0; } table thead td { @@ -141,12 +159,13 @@ table thead td { } table thead th { - padding: 3px 20px; + padding: 1rem; + border-bottom: 1px solid hsl(0deg 0% 100% / 10%); } table thead tr { border: 1px; - border-radius: 10px 10px 0 0; + border-radius: var(--border-radius) var(--border-radius) 0 0; } table tbody tr:nth-child(2n) { @@ -155,13 +174,15 @@ table tbody tr:nth-child(2n) { } table tbody tr:last-child td:first-child { - border-radius: 0 0 0 10px; + border-radius: 0 0 0 var(--border-radius); } table tbody tr:last-child td:last-child { - border-radius: 0 0 10px 0; + border-radius: 0 0 var(--border-radius) 0; } +/* Blockquote */ + blockquote { margin: 20px 0; padding: 0.1px 20px; @@ -206,3 +227,5 @@ blockquote { .tooltipped .tooltiptext { visibility: visible; } + + diff --git a/src/theme/css/home.css b/src/theme/css/home.css index 572c3a88322..31d5da4f529 100644 --- a/src/theme/css/home.css +++ b/src/theme/css/home.css @@ -9,7 +9,8 @@ } .editPage, -.breadcrumb { +.breadcrumb, +.last_file_edit { visibility: hidden; } @@ -37,6 +38,14 @@ box-shadow: 0 12px 15px rgba(0, 0, 0, 0.3); } +.bdfd-is h1 { + margin-top: 2%; + white-space: normal; + overflow: visible !important; + text-overflow: clip !important; + width: auto; +} + #bdfd-about { padding: 1rem; } @@ -207,3 +216,4 @@ button a { } } + diff --git a/src/theme/css/wiki-themes/discord-messages.css b/src/theme/css/wiki-themes/discord-messages.css index b9b486b455c..4edcc101928 100644 --- a/src/theme/css/wiki-themes/discord-messages.css +++ b/src/theme/css/wiki-themes/discord-messages.css @@ -1,7 +1,13 @@ -.discord-message .discord-message-markup, .discord-system-message { +.discord-message .discord-message-markup { font-size: 16px !important; } +.discord-system-message { + user-select: none !important; + -webkit-user-select: none !important; + font-size: 12px !important; +} + .discord-message a { color: #00aff4 !important; } @@ -45,12 +51,11 @@ color: #fff; font-size: 12px; margin-left: 4px; - border-radius: 3px; line-height: 100%; text-transform: uppercase; display: flex; align-items: center; - height: 2rem; + height: 1.5rem; padding: 0 0.275rem; margin-top: 0.075em; border-radius: 4px; @@ -64,6 +69,12 @@ margin-left: -0.25rem; } +.discord-embed-wrapper { + border-top: 1.5px solid hsl(0deg 0% 50% / 10%) !important; + border-bottom: 1.5px solid hsl(0deg 0% 50% / 10%) !important; + border-right: 1.5px solid hsl(0deg 0% 50% / 10%) !important; +} + .discord-embed .discord-embed-author { -webkit-box-align: center; align-items: center; @@ -208,6 +219,12 @@ transform: scale(1.4); } +.discord-button { + margin-top: -2px; + border-radius: 10px; + border: 1px solid hsl(0deg 0% 100% / 10%); +} + .discord-button.discord-button-secondary { color: #fff !important; } @@ -270,3 +287,8 @@ line-height: 19px; } + + + + + diff --git a/src/theme/index.hbs b/src/theme/index.hbs index 6b12f4e26fe..262fd8929a8 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -203,10 +203,6 @@ - - - - {{{ content }}} diff --git a/src/theme/settings/apply-settings.js b/src/theme/settings/apply-settings.js index d3de70d2486..9f1d72c0971 100644 --- a/src/theme/settings/apply-settings.js +++ b/src/theme/settings/apply-settings.js @@ -1,151 +1,528 @@ +// Function Container +function createObjectInfo() { + if (/introduction/i.test(location.pathname)) return; + + if (/bdscript|callbacks/.test(location.pathname)) { + const h1 = document.querySelector('main h1'); + const p = document.querySelector('main p:not(.breadcrumb p)'); + const tags = document.querySelector('main .functionTags'); + + if (h1 && p) { + const container = document.createElement('div'); + container.className = 'objectInfo'; + h1.after(container); + + container.append(h1); + if (tags) container.append(tags); + container.append(p); + } + } +} + +// Example "Today at" +function removeTimestamp() { + const timestamps = document.querySelectorAll('discord-system-message[type] .discord-message-timestamp'); + timestamps.forEach(timestamp => { + timestamp.remove(); + }); +} + +// Next & Prev function +function enhanceNavigationSimple() { + const navWrapper = document.querySelector('.nav-wrapper'); + if (!navWrapper) return; + + const prevLink = navWrapper.querySelector('a.previous'); + const nextLink = navWrapper.querySelector('a.next'); + + const supportedCategories = ['bdscript', 'callbacks', 'guides', 'resources', 'flowchart', 'tools', 'premium', 'javascript']; + + function isSupportedCategory(href) { + const hasCategory = supportedCategories.some(category => href.includes(`/${category}/`)); + const isRootPage = !supportedCategories.some(category => href.includes(`/${category}/`)) && + (href.includes('.html') && !href.includes('/category/')); + + return hasCategory || isRootPage; + } + + function getCategoryFromUrl(href) { + for (const category of supportedCategories) { + if (href.includes(`/${category}/`)) { + return category; + } + } + return null; + } + + if (prevLink) { + const href = prevLink.href; + if (isSupportedCategory(href)) { + const prevFileName = href.split('/').pop().replace('.html', ''); + const category = getCategoryFromUrl(href); + prevLink.textContent = formatFunctionName(prevFileName, href, category); + prevLink.insertAdjacentHTML('afterbegin', ' '); + } + } + + if (nextLink) { + const href = nextLink.href; + if (isSupportedCategory(href)) { + const nextFileName = href.split('/').pop().replace('.html', ''); + const category = getCategoryFromUrl(href); + nextLink.textContent = formatFunctionName(nextFileName, href, category); + nextLink.insertAdjacentHTML('beforeend', ' '); + } + } +} + +function formatFunctionName(fileName, href, category = null) { + const lowerFileName = fileName.toLowerCase(); + + if (lowerFileName === 'foreword') { + return 'Home'; + } + + if (category === 'tools') { + return 'Tools'; + } + + if (lowerFileName === 'introduction') { + if (category) { + const categoryMap = { + 'bdscript': 'BDScript', + 'callbacks': 'Callbacks', + 'guides': 'Guides', + 'resources': 'Resources', + 'flowchart': 'Flowchart', + 'tools': 'Tools', + 'premium': 'Premium', + 'javascript': 'JavaScript' + }; + + return categoryMap[category] || category.charAt(0).toUpperCase() + category.slice(1); + } + return 'Introduction'; + } + + const customTitles = { + 'api': 'BDFD API', + '2fa': '2FA', + 'aboutSelectMenu': 'Select Menus', + 'aboutModals': 'Modals', + 'aboutButtons': 'Buttons', + 'aboutSlashCommands': 'Slash Commands', + 'discordIDSystem': 'Discord ID System', + 'settings': 'Settings', + 'foreword': 'Home', + 'httprequests': 'HTTP Requests', + 'awaitedReactions': 'Awaited Reactions', + 'customimages': 'Custom Images', + 'customprefixes': 'Custom Prefixes', + 'embedbuilder': 'Embed Builder', + 'enablingjavascript': 'Enabling JavaScript', + 'objects': 'Objects' + }; + + if (customTitles[lowerFileName]) { + return customTitles[lowerFileName]; + } + + if (category === 'javascript') { + return fileName; + } + + if (category === 'flowchart') { + let result = fileName; + result = result.replace(/([a-z])([A-Z])/g, '$1 $2'); + result = result.charAt(0).toUpperCase() + result.slice(1).toLowerCase(); + return result; + } + + const titleCategories = ['guides', 'resources', 'tools']; + const functionCategories = ['bdscript', 'callbacks', 'premium']; + + if (category && functionCategories.includes(category)) { + let result = '$' + fileName; + result = result.replace(/Complex$/i, '[]'); + return result; + } + + const isTitleCategory = category ? titleCategories.includes(category) : true; + + if (isTitleCategory) { + let result = fileName; + + result = result + .replace(/_/g, ' ') + .replace(/([a-z])([A-Z])/g, '$1 $2') + .replace(/([A-Z])([A-Z][a-z])/g, '$1 $2') + .replace(/^./, str => str.toUpperCase()); + + const words = result.split(' '); + const formattedWords = words.map(word => { + if (word === word.toUpperCase() && word.length > 1) { + return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); + } + return word; + }); + + result = formattedWords.join(' '); + + result = result.replace(/\bBdfd\b/gi, 'BDFD'); + result = result.replace(/\b2fa\b/gi, '2FA'); + result = result.replace(/\bId\b/g, 'ID'); + result = result.replace(/\bAi\b/g, 'AI'); + result = result.replace(/\bI D\b/g, 'ID'); + result = result.replace(/\bA I\b/g, 'AI'); + result = result.replace(/\bU I\b/g, 'UI'); + result = result.replace(/\bF A Q\b/g, 'FAQ'); + result = result.replace(/\bChangelog\b/g, 'Changelog'); + result = result.replace(/\bHttp\b/gi, 'HTTP'); + + return result.trim(); + } + + return fileName; +} + +// Last edited +async function createAndUpdateLastEdit() { + try { + const currentPath = window.location.pathname; + const allowedPaths = ['premium', 'bdscript', 'guides', 'resources', 'flowchart', 'callbacks']; + let shouldAddBlock = false; + for (const path of allowedPaths) { + if (currentPath.includes(`/${path}/`) || + currentPath.endsWith(`/${path}`) || + currentPath.endsWith(`/${path}.html`)) { + shouldAddBlock = true; + break; + } + } + + if (!shouldAddBlock) return; + let pagePath = ''; + + if (currentPath.includes('/nightly/')) { + const nightlyIndex = currentPath.indexOf('/nightly/') + 8; + pagePath = currentPath.substring(nightlyIndex); + } else { + pagePath = currentPath.startsWith('/') ? currentPath.substring(1) : currentPath; + } + + if (!pagePath || pagePath === '' || pagePath === 'index.html') { + pagePath = 'index.md'; + } else { + pagePath = pagePath.replace('.html', '.md'); + if (!pagePath.startsWith('src/')) { + pagePath = 'src/' + pagePath; + } + } + + const apiUrl = `https://api.github.com/repos/NilPointer-Software/bdfd-wiki/commits?path=${encodeURIComponent(pagePath)}&per_page=1`; + const response = await fetch(apiUrl); + + if (!response.ok) { + throw new Error(`API Error: ${response.status}`); + } + + const commits = await response.json(); + + if (commits && commits.length > 0) { + const lastCommit = commits[0]; + const lastModified = new Date(lastCommit.commit.committer.date); + + const formattedDate = lastModified.toLocaleDateString('en-US', { + year: 'numeric', + month: 'short', + day: 'numeric' + }); + + const authorName = lastCommit.author ? + (lastCommit.author.login || lastCommit.commit.author.name) : + lastCommit.commit.author.name; + + const avatarUrl = lastCommit.author ? + lastCommit.author.avatar_url : + 'https://github.com/identicons/identicon.png'; + + createEditBlock(formattedDate, authorName, avatarUrl, pagePath); + } else { + createFallbackBlock(pagePath); + } + } catch (error) { + console.error('Error loading last edit data:', error); + createFallbackBlock(); + } +} + +function createEditBlock(formattedDate, authorName, avatarUrl, pagePath) { + const container = document.createElement('div'); + container.className = 'last_file_edit'; + + const editUrl = `https://github.com/NilPointer-Software/bdfd-wiki/edit/dev/${encodeURI(pagePath)}`; + + // Create elements using DOM methods instead of innerHTML + const editInfo = document.createElement('div'); + editInfo.className = 'edit-info'; + + const avatarImg = document.createElement('img'); + avatarImg.className = 'edit-avatar'; + avatarImg.src = encodeURI(avatarUrl); + avatarImg.alt = ''; + + const editDetails = document.createElement('div'); + editDetails.className = 'edit-details'; + + const dateLine = document.createElement('div'); + dateLine.className = 'edit-date-line'; + + const dateSpan = document.createElement('span'); + dateSpan.className = 'edit-date'; + dateSpan.textContent = `Last edited at ${formattedDate}`; + + const editLink = document.createElement('a'); + editLink.href = editUrl; + editLink.className = 'editPage'; + + const editIcon = document.createElement('i'); + editIcon.className = 'fa fa-edit'; + editIcon.id = 'editPageIcon'; + + editLink.appendChild(editIcon); + dateLine.appendChild(dateSpan); + dateLine.appendChild(editLink); + + const authorLine = document.createElement('div'); + authorLine.className = 'edit-author-line'; + + const authorSpan = document.createElement('span'); + authorSpan.className = 'edit-author'; + authorSpan.textContent = authorName; + + authorLine.appendChild(authorSpan); + + editDetails.appendChild(dateLine); + editDetails.appendChild(authorLine); + editInfo.appendChild(avatarImg); + editInfo.appendChild(editDetails); + container.appendChild(editInfo); + + // Insert into DOM + const mainElement = document.querySelector('main'); + if (mainElement) { + mainElement.appendChild(container); + } else { + document.body.appendChild(container); + } +} + +function createFallbackBlock(pagePath = '') { + const container = document.createElement('div'); + container.className = 'last_file_edit'; + + const editUrl = pagePath ? `https://github.com/NilPointer-Software/bdfd-wiki/edit/dev/${encodeURI(pagePath)}` : '#'; + + // Create elements using DOM methods + const editInfo = document.createElement('div'); + editInfo.className = 'edit-info'; + + const avatarImg = document.createElement('img'); + avatarImg.className = 'edit-avatar'; + avatarImg.src = 'https://github.com/identicons/identicon.png'; + avatarImg.alt = ''; + + const editDetails = document.createElement('div'); + editDetails.className = 'edit-details'; + + const dateLine = document.createElement('div'); + dateLine.className = 'edit-date-line'; + + const dateSpan = document.createElement('span'); + dateSpan.className = 'edit-date'; + dateSpan.textContent = 'Last edited at Failed to load'; + + const editLink = document.createElement('a'); + editLink.href = editUrl; + editLink.className = 'editPage'; + + const editIcon = document.createElement('i'); + editIcon.className = 'fa fa-edit'; + editIcon.id = 'editPageIcon'; + + editLink.appendChild(editIcon); + dateLine.appendChild(dateSpan); + dateLine.appendChild(editLink); + + const authorLine = document.createElement('div'); + authorLine.className = 'edit-author-line'; + + const authorSpan = document.createElement('span'); + authorSpan.className = 'edit-author'; + authorSpan.textContent = 'GitHub API may be experiencing issues loading data.'; + + authorLine.appendChild(authorSpan); + + editDetails.appendChild(dateLine); + editDetails.appendChild(authorLine); + editInfo.appendChild(avatarImg); + editInfo.appendChild(editDetails); + container.appendChild(editInfo); + + const mainElement = document.querySelector('main'); + if (mainElement) { + mainElement.appendChild(container); + } else { + document.body.appendChild(container); + } +} + const DiscordThemes = { - light: { - reactionColor: "#F2F3F5", - messageTextColor: "#313338", - background: "#FFF", - }, - dark: { - reactionColor: "#202226", - messageTextColor: "#C6C7CC", - background: "#1C1D22", - }, - redmoon: { - reactionColor: "#4e0505", - background: "linear-gradient(-25deg, #240000, #740606)", - }, - nightsapphire: { - reactionColor: "#180052", - background: "linear-gradient(-25deg, #000124, #260674)", - }, - emeraldearth: { - reactionColor: "#006d3f", - background: "linear-gradient(-25deg, #0c2400, #067446)", - }, - nightviolet: { - reactionColor: "#390085", - background: "linear-gradient(-25deg, #1d0024, #350674)", - }, - oldwood: { - reactionColor: "#714400", - background: "linear-gradient(-25deg, #240f00, #744806)", - }, - azuresky: { - reactionColor: "#007162", - background: "linear-gradient(-25deg, #001a24, #067465)", - }, - cherryvelvety: { - reactionColor: "#710049", - background: "linear-gradient(-25deg, #240017, #74064d)", - }, - forestdepth: { - reactionColor: "#616d00", - background: "linear-gradient(-25deg, #222400, #687406)", - }, - nightchestnut: { - reactionColor: "#4e0505", - background: "linear-gradient(-25deg, #190024, #740606)", - }, - mosscovered: { - reactionColor: "#4b6d11", - background: "linear-gradient(-25deg, #1c2400, #4c7406)", - }, - deepruby: { - reactionColor: "#74066e", - background: "linear-gradient(-25deg, #1f0024, #74066e)", - }, - fernvalley: { - reactionColor: "#1e6d00", - background: "linear-gradient(-25deg, #00240a, #247406)", - }, - forestshadows: { - reactionColor: "#086b00", - background: "linear-gradient(-25deg, #000624, #086700 , #0a7f01)", - }, - autumnblaze: { - reactionColor: "#742006", - background: "linear-gradient(-25deg, #240800, #742006)", - }, + light: { + reactionColor: "#F2F3F5", + messageTextColor: "#313338", + background: "#FFF", + }, + dark: { + reactionColor: "#202226", + messageTextColor: "#C6C7CC", + background: "#1C1D22", + }, + redmoon: { + reactionColor: "#4e0505", + background: "linear-gradient(-25deg, #240000, #740606)", + }, + nightsapphire: { + reactionColor: "#180052", + background: "linear-gradient(-25deg, #000124, #260674)", + }, + emeraldearth: { + reactionColor: "#006d3f", + background: "linear-gradient(-25deg, #0c2400, #067446)", + }, + nightviolet: { + reactionColor: "#390085", + background: "linear-gradient(-25deg, #1d0024, #350674)", + }, + oldwood: { + reactionColor: "#714400", + background: "linear-gradient(-25deg, #240f00, #744806)", + }, + azuresky: { + reactionColor: "#007162", + background: "linear-gradient(-25deg, #001a24, #067465)", + }, + cherryvelvety: { + reactionColor: "#710049", + background: "linear-gradient(-25deg, #240017, #74064d)", + }, + forestdepth: { + reactionColor: "#616d00", + background: "linear-gradient(-25deg, #222400, #687406)", + }, + nightchestnut: { + reactionColor: "#4e0505", + background: "linear-gradient(-25deg, #190024, #740606)", + }, + mosscovered: { + reactionColor: "#4b6d11", + background: "linear-gradient(-25deg, #1c2400, #4c7406)", + }, + deepruby: { + reactionColor: "#74066e", + background: "linear-gradient(-25deg, #1f0024, #74066e)", + }, + fernvalley: { + reactionColor: "#1e6d00", + background: "linear-gradient(-25deg, #00240a, #247406)", + }, + forestshadows: { + reactionColor: "#086b00", + background: "linear-gradient(-25deg, #000624, #086700 , #0a7f01)", + }, + autumnblaze: { + reactionColor: "#742006", + background: "linear-gradient(-25deg, #240800, #742006)", + }, }; function setDiscordTheme(colorId) { - const discordMessages = document.getElementsByTagName("discord-messages"); + const discordMessages = document.getElementsByTagName("discord-messages"); - const styles = { - reactionColor: "#131318", - messageTextColor: "#DDDEE1", - background: "#000", - ...(DiscordThemes[colorId] || {}), - }; + const styles = { + reactionColor: "#131318", + messageTextColor: "#DDDEE1", + background: "#000", + ...(DiscordThemes[colorId] || {}), + }; + + const callback = (mutationList, observer) => { + for (const mutation of mutationList) { + if ( + mutation.type === "attributes" && + mutation.attributeName === "class" + ) { + const reactions = + document.getElementsByTagName("discord-reaction"); + const messageColors = document.querySelectorAll( + ".discord-message .discord-message-markup" + ); - // Callback function to execute when mutations are observed - const callback = (mutationList, observer) => { - for (const mutation of mutationList) { - if ( - mutation.type === "attributes" && - mutation.attributeName === "class" - ) { - const reactions = - document.getElementsByTagName("discord-reaction"); - const messageColors = document.querySelectorAll( - ".discord-message .discord-message-markup" - ); - - const botToApp = - document.querySelectorAll('.discord-application-tag'); - - if (styles.background) - mutation.target.style.background = styles.background; - mutation.target.style.backgroundColor = styles.exampleColor; - for (const reaction of reactions) { - // change the div which is the actual reaction - reaction.children.item(0).style.backgroundColor = - styles.reactionColor; - } - messageColors.forEach((text) => { - text.style.color = styles.messageTextColor; - }); - - botToApp.forEach(tag => { - if (tag.textContent.includes("Bot")) { - tag.textContent = tag.textContent.replace("Bot", "App"); - tag.setAttribute("aria-label", "Verified App"); - } - }); - - // Changes "00/00/0000" to "Today at 00:00". - const timestamps = document.querySelectorAll( - ".discord-message-timestamp" - ); - timestamps.forEach((timestamp) => { - var time = new Date().getTime(); - var minuteExample = new Date().getMinutes(); - var hourExample = new Date().getHours(); - const formattedMinute = - minuteExample < 10 - ? `0${minuteExample}` - : minuteExample; - const formattedHour = - hourExample < 10 ? `0${hourExample}` : hourExample; - const formattedTime = `Today at ${formattedHour}:${formattedMinute}`; - timestamp.textContent = formattedTime; - }); - } + const botToApp = + document.querySelectorAll('.discord-application-tag'); + + if (styles.background) + mutation.target.style.background = styles.background; + mutation.target.style.backgroundColor = styles.exampleColor; + for (const reaction of reactions) { + reaction.children.item(0).style.backgroundColor = + styles.reactionColor; } - }; + messageColors.forEach((text) => { + text.style.color = styles.messageTextColor; + }); + + botToApp.forEach(tag => { + if (tag.textContent.includes("Bot")) { + tag.textContent = tag.textContent.replace("Bot", "App"); + tag.setAttribute("aria-label", "Verified App"); + } + }); - for (message of discordMessages) { - const mutObv = new MutationObserver(callback); - mutObv.observe(message, {attributes: true}); + const timestamps = document.querySelectorAll( + ".discord-message-timestamp" + ); + timestamps.forEach((timestamp) => { + var time = new Date().getTime(); + var minuteExample = new Date().getMinutes(); + var hourExample = new Date().getHours(); + const formattedMinute = + minuteExample < 10 + ? `0${minuteExample}` + : minuteExample; + const formattedHour = + hourExample < 10 ? `0${hourExample}` : hourExample; + const formattedTime = `Today at ${formattedHour}:${formattedMinute}`; + timestamp.textContent = formattedTime; + }); + + removeTimestamp(); + } } + }; + + for (message of discordMessages) { + const mutObv = new MutationObserver(callback); + mutObv.observe(message, { attributes: true }); + } } function applySettings() { - let data; + let data; - try { - data = JSON.parse(localStorage.getItem("json")); - } catch { - } + try { + data = JSON.parse(localStorage.getItem("json")); + } catch {} const defaultData = { "discord-example-theme": "dark", @@ -155,19 +532,56 @@ function applySettings() { "text-font": "Open Sans, sans-serif", }; - if (!data) localStorage.setItem("json", JSON.stringify(defaultData)); - data ??= defaultData; + const html = document.querySelector("html"); + + html.style.fontFamily = data["text-font"]; + html.style.fontSize = data["text-size"]; + html.style.textShadow = data["text-hg"]; + + document.querySelectorAll('.chapter > li.chapter-item').forEach(el => { + if (el.querySelector('div')) { + const text = el.querySelector('div').textContent.trim(); + if (text === 'Functions' || text === 'Premium') { + el.classList.add('functions-section'); + } + } + }); + + const currentPath = window.location.pathname; + const currentHref = window.location.href; - document.querySelectorAll('.chapter > li.chapter-item').forEach(el => { - if (el.querySelector('div')) { - const text = el.querySelector('div').textContent.trim(); - if (text === 'Functions' || text === 'Premium') { - el.classList.add('functions-section'); - } + if (currentPath.includes('/tools/')) { + const fileName = currentPath.split('/').pop(); + window.location.replace('https://bdfd-tool.github.io/bdfd-wiki/nightly/tools/' + fileName); + } + else if (currentPath.includes('/terms.html') || currentHref.includes('terms.html')) { + window.location.replace('https://botdesignerdiscord.com/tos'); + } + else { + const allLinks = document.querySelectorAll('a[href]'); + + allLinks.forEach(link => { + const href = link.getAttribute('href'); + + if (href) { + if (href.indexOf('../tools/') === 0) { + const newHref = 'https://bdfd-tool.github.io/bdfd-wiki/nightly/tools/' + href.substring(9); + link.setAttribute('href', newHref); } + + if (href.includes('terms.html')) { + link.setAttribute('href', 'https://botdesignerdiscord.com/tos'); + } + } }); - - setDiscordTheme(data["discord-example-theme"]); + } + + setDiscordTheme(data["discord-example-theme"]); } -applySettings(); +document.addEventListener('DOMContentLoaded', function() { + createAndUpdateLastEdit(); + enhanceNavigationSimple(); + createObjectInfo(); + applySettings(); +}); diff --git a/src/theme/settings/code-hg.js b/src/theme/settings/code-hg.js index 8c357d181a5..7ab9576d572 100644 --- a/src/theme/settings/code-hg.js +++ b/src/theme/settings/code-hg.js @@ -105,7 +105,15 @@ function highlight(scheme) { } codeBlocks.forEach((codeBlock) => { - let code = escapeHtml(codeBlock.textContent); + let originalText = codeBlock.textContent; + originalText = originalText.replace(/\n+$/, ''); + + let code = originalText; + + code = code + .replace(/&/g, "&") + .replace(//g, ">"); code = code .replace(/\;/g, styling("semicolonHighlight", scheme)) @@ -124,8 +132,29 @@ function highlight(scheme) { ); }); - codeBlock.innerHTML = code; + const lines = code.split('\n'); + const lineCount = lines.length; + + let lineNumbersHtml = ''; + for (let i = 1; i <= lineCount; i++) { + const safeI = String(i).replace(/[&<>"']/g, ''); + lineNumbersHtml += `
${safeI}
`; + } + + const formattedCode = lines.map(line => { + if (line.trim() === '') { + return '
 
'; + } + return `
${line}
`; + }).join(''); + + codeBlock.innerHTML = ` +
+
${lineNumbersHtml}
+
${formattedCode}
+
+ `; }); } -highlight(scheme); +highlight(scheme); \ No newline at end of file diff --git a/src/theme/settings/style.css b/src/theme/settings/style.css index 6f79d0b787a..91d5af96d6e 100644 --- a/src/theme/settings/style.css +++ b/src/theme/settings/style.css @@ -8,46 +8,6 @@ body { visibility: hidden; } -/* Tag Beta Feature */ - -.tag-beta { - user-select: none; - -webkit-user-select: none; - border-style: solid; - border-color: rgba(255, 255, 255, 0.1); - margin: auto; - margin-top: 15px; - width: fit-content; - padding: 10px 10px; - border-width: 1px; - border-radius: 10px; - display: flex; - align-items: center; - background: var(--card-bg); -} - -.tag-beta .warn { - font-size: 2.25em; - margin-right: 7.5px; -} - -.tag-beta .text { - display: flex; - flex-direction: column; - align-items: flex-start; - margin-bottom: 5px; -} - -.tag-beta .head { - font-weight: bold; - margin-bottom: 2.5px; - font-size: 1.1em; -} - -.tag-beta .desc { - font-size: 0.9em; -} - /* Discord Message Preview*/ .discord-messages { diff --git a/src/tools/json.md b/src/tools/json.md new file mode 100644 index 00000000000..0de147a42d5 --- /dev/null +++ b/src/tools/json.md @@ -0,0 +1,7 @@ + + +Redirecting to https://bdfd-tool.github.io/bdfd-wiki/nightly/tools/json.html \ No newline at end of file