From c75ba941c12081b5c12f80317c9333e4dbc9abca Mon Sep 17 00:00:00 2001 From: Nicky <111157596+xNickyDev@users.noreply.github.com> Date: Tue, 4 Jul 2023 20:57:01 +0200 Subject: [PATCH] Wiki Update 7 (#329) * Update channelType.md * Update charCount.md * Update dm.md * Create dmComplex.md * Update giveRole.md * Update giveRole.md * Update ping.md * Update takeRole.md * Update giveRole.md * Update SUMMARY.md --- src/SUMMARY.md | 1 + src/bdscript/channelType.md | 15 +++++++++---- src/bdscript/charCount.md | 11 ++++----- src/bdscript/dm.md | 30 ++++++++----------------- src/bdscript/dmComplex.md | 34 ++++++++++++++++++++++++++++ src/bdscript/giveRole.md | 45 ++++++++++++++++++++----------------- src/bdscript/ping.md | 14 ++++++------ src/bdscript/takeRole.md | 29 ++++++++++++++++++------ 8 files changed, 115 insertions(+), 64 deletions(-) create mode 100644 src/bdscript/dmComplex.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 2e8650b876..599a32fb90 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -159,6 +159,7 @@ - [$displayName[]](./bdscript/displayNameComplex.md) - [$divide](./bdscript/divide.md) - [$dm](./bdscript/dm.md) + - [$dm[]](./bdscript/dmComplex.md) - [$dmChannelID](./bdscript/dmChannelID.md) - [$editButton](./bdscript/editButton.md) - [$editChannelPerms](./bdscript/editChannelPerms.md) diff --git a/src/bdscript/channelType.md b/src/bdscript/channelType.md index 4a71599f73..237399d21a 100644 --- a/src/bdscript/channelType.md +++ b/src/bdscript/channelType.md @@ -1,15 +1,15 @@ # $channelType - -Returns channel type. +Returns the type of a channel. ## Syntax ``` -$channelType[channel ID] +$channelType[Channel ID] ``` + > The different channel types that the bot will return are: `text`, `voice`, `category`, `thread`, `dm`, `stage`, `announcement` and `forum`. ### Parameters -- `channel ID` `(Type: Snowflake || Flag: Required)`: The channel which type will be returned. +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel which type will be returned. ## Example @@ -17,3 +17,10 @@ $channelType[channel ID] $nomention $channelType[$channelID] ``` +**Text Channel** + +![example1](https://user-images.githubusercontent.com/111157596/250920367-a11b2e62-deb7-44ef-a3aa-1e7975c61020.png) + +**DM Channel** + +![example2](https://user-images.githubusercontent.com/111157596/250920478-108e1b24-dfdc-4609-aedc-9ea328ac33fb.png) diff --git a/src/bdscript/charCount.md b/src/bdscript/charCount.md index a7a23aeb11..b6ea3528db 100644 --- a/src/bdscript/charCount.md +++ b/src/bdscript/charCount.md @@ -1,16 +1,17 @@ # $charCount -Gets the amount of characters in the provided 'text'. +Returns the amount of characters in the provided "Text". ## Syntax ``` -$charCount[text] +$charCount[Text] ``` ### Parameters -- `text` `(Type: String || Flag: Emptiable)`: The text to return the character count for. +- `Text` `(Type: String || Flag: Emptiable)`: The text to return the character count for. ## Example ``` -$charCount[$message] +$nomention +Your message has **$charCount[$message]** characters. ``` -> 🧙‍♂️ This example would return how many characters were in the author's message. +![example](https://user-images.githubusercontent.com/111157596/250920649-1ed2b250-8bcb-4c00-bff4-e3c06c1668ca.png) diff --git a/src/bdscript/dm.md b/src/bdscript/dm.md index 3336d3c2fc..d7d7c7de0c 100644 --- a/src/bdscript/dm.md +++ b/src/bdscript/dm.md @@ -1,31 +1,19 @@ # $dm -Direct messages a user. +Direct messages the user who runs the command. -## Usages -There are three possible usages of the `$dm` function. - -### Usage #1 +## Syntax ``` $dm ``` -This will send the message to the user that runs the command. - -### Usage #2 -``` -$dm[] -``` -This will send the message to the first mentioned user. -### Usage #3 +## Example ``` -$dm[UserID;...] +$nomention +$dm +Hello! ``` -This will send the message to every user with given User ID. - -## Parameters -- `userID` `(Type: Snowflake || Flag: Emptiable)`: The user to whom to send the direct message. - - +![example](https://user-images.githubusercontent.com/111157596/250920927-01f8c481-ab76-4810-a940-e060f7396003.png)\ +![example](https://user-images.githubusercontent.com/111157596/250920959-d1d8ecda-5a3a-4b65-9135-0502d13c6520.png) ## Note -If the command fails to send the message, make sure the user allows dm messages from everyone. +If the command fails to send the message, make sure you allow direct messages from everyone. diff --git a/src/bdscript/dmComplex.md b/src/bdscript/dmComplex.md new file mode 100644 index 0000000000..d8bcd34169 --- /dev/null +++ b/src/bdscript/dmComplex.md @@ -0,0 +1,34 @@ +# $dm[] +Direct messages one or multiple users. + +## Syntax +``` +$dm[User ID;...] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Emptiable)`: The user to whom to send the direct message. Use semicolons `;` as a separator to separate multiple user IDs. + +> 🧙‍♂️ You can leave the `User ID` argument empty to direct message the mentioned user. See [Example #1](#example-1) below. + +## Examples +### Example #1 +*This will direct message the mentioned user.* +``` +$nomention +$dm[] +$displayName says hello 👋 +``` +![example1](https://user-images.githubusercontent.com/111157596/250921279-a0f6cf34-8a24-49aa-a678-d1b015542b0a.png)\ +![example1](https://user-images.githubusercontent.com/111157596/250921319-335229ed-6002-424c-8634-d6c33815d792.png) + +### Example #2 +*This will direct message all the specified users.* +``` +$nomention +$dm[871078018041409608;729343563401265193] +$displayName says hello 👋 +``` + +## Note +If the command fails to send the message, make sure the user allows direct messages from everyone. diff --git a/src/bdscript/giveRole.md b/src/bdscript/giveRole.md index 23e096ea52..e93c00d68f 100644 --- a/src/bdscript/giveRole.md +++ b/src/bdscript/giveRole.md @@ -1,36 +1,41 @@ # $giveRole *(deprecated)* -> 🧙‍♂️ This command is deprecated instead better use [$roleGrant](./roleGrant.md). -Adds a role to the provided user. +> 🧙‍♂️ This command is deprecated, instead better use [`$roleGrant[]`](./roleGrant.md). -## Usages -There are two usages of the `$giveRole` function. +Adds a role to the provided user. -### Usage #1 +## Syntax ``` -$giveRole[userID;roleID] +$giveRole[User/Role ID;(Role ID)] ``` -Gives a role to the provided user. -#### Breakdown -- `userID` - The user to give the role to. -- `roleID` - The role to give the user. +### Parameters +- `User/Role ID` `(Type: Snowflake || Flag: Required)`: The user to add the specified role to **or** the role to add to the mentioned users. If only this parameter is provided, it will be read as "Role ID". +- `Role ID` `(Type: Snowflake || Flag: Optional)`: The role to add to the user. If this parameter is used, it reads the first parameter as "User ID". -### Usage #2 -``` -$giveRole[roleID] +## Examples +### Example #1 ``` -Gives the provided role to the mentioned user. +$nomention +$onlyPerms[manageroles;Missing permissions!] -#### Breakdown -- `roleID` - The role to give the mentioned user. +$giveRole[807004801753284618] +Added $roleName[807004801753284618] to $username[$mentioned[1]]! +``` +![example1](https://user-images.githubusercontent.com/69215413/123468942-6e8b6b80-d5c0-11eb-9102-afc48b70f622.png) -## Example +### Example #2 ``` +$nomention $onlyPerms[manageroles;Missing permissions!] -$giveRole[807004801753284618] -Added $roleName[807004801753284618] to $username[$mentioned[1]]! +$trimContent + +$giveRole[$mentioned[1];$message[2]] +Added the role **$roleName[$message[2]]** to **$username[$mentioned[1]]**! ``` +![example2](https://user-images.githubusercontent.com/111157596/250921826-a2a32410-a9da-4609-bee7-4076b8951e8b.png) -![example](https://user-images.githubusercontent.com/69215413/123468942-6e8b6b80-d5c0-11eb-9102-afc48b70f622.png) +## Related Resources +- [`$roleGrant[]`](./roleGrant.md) +- [`$takeRole[]`](./takeRole.md) diff --git a/src/bdscript/ping.md b/src/bdscript/ping.md index 47fda569f2..ce3a665b3c 100644 --- a/src/bdscript/ping.md +++ b/src/bdscript/ping.md @@ -1,14 +1,14 @@ # $ping -Shows the delay between sent message and bot's response. -The value of `$ping` is expressed in miliseconds. +Returns the ping of the bot's node, in milliseconds. -## Example command: +## Syntax ``` -Ping: $ping ms +$ping ``` -#### Expected output: +## Example ``` -Ping: 50 ms +$nomention +Pong! `$pingms` ``` -⠀ +![example](https://user-images.githubusercontent.com/111157596/250922355-2b9717e6-e175-4feb-a218-f121f886a324.png) diff --git a/src/bdscript/takeRole.md b/src/bdscript/takeRole.md index 803bf1fd33..479bb3cd78 100644 --- a/src/bdscript/takeRole.md +++ b/src/bdscript/takeRole.md @@ -1,20 +1,23 @@ # $takeRole -Removes a role from the provided/mentioned user. +*(deprecated)* -> 📌 As of December 2021, this function has been deprecated in favor of [$roleGrant](./roleGrant.md). +> 📌 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)] ``` ### Parameters -- `User/Role ID` `(Type: Snowflake || Flag: Required)`: The user to remove the role from or the role to remove from the mentioned users. If this parameter is only provided, it reads as "Role ID". +- `User/Role ID` `(Type: Snowflake || Flag: Required)`: The user to remove the specified role from **or** the role to remove from the mentioned users. If only this parameter is provided, it will be read as "Role ID". - `Role ID` `(Type: Snowflake || Flag: Optional)`: The role to remove from the user. If this parameter is used, it reads the first parameter as "User ID". -## Example +## Examples +### Example #1 ``` $nomention $allowRoleMentions[] @@ -22,8 +25,20 @@ $allowRoleMentions[] $takeRole[$mentionedRoles[1]] Removed <@&$mentionedRoles[1]> from the mentioned users! ``` -![Screenshot_20221029_193751](https://user-images.githubusercontent.com/95774950/198837013-a39c8a69-29aa-4cec-b319-0b04365c200d.png) +![example1](https://user-images.githubusercontent.com/95774950/198837013-a39c8a69-29aa-4cec-b319-0b04365c200d.png) + +### Example #2 +``` +$nomention +$allowMention +$allowRoleMentions[] + +$takeRole[$message[1];$mentionedRoles[1]] +Removed the role <@&$mentionedRoles[1]> from <@$message[1]>! +``` +![example2](https://user-images.githubusercontent.com/111157596/250922731-73a8a86d-d5ba-4cbf-a4cd-87f13440eeea.png)\ +![example2](https://user-images.githubusercontent.com/111157596/250922753-4db7473e-a85a-43d3-b88b-f97e0e869533.png) ## Related Resources -- [$roleGrant](./roleGrant.md) -- [$giveRole](./giveRole.md) +- [`$roleGrant[]`](./roleGrant.md) +- [`$giveRole[]`](./giveRole.md)