Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki Update 7 #329

Merged
merged 10 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 11 additions & 4 deletions src/bdscript/channelType.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
# $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
```
$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)
11 changes: 6 additions & 5 deletions src/bdscript/charCount.md
Original file line number Diff line number Diff line change
@@ -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)
30 changes: 9 additions & 21 deletions src/bdscript/dm.md
Original file line number Diff line number Diff line change
@@ -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.
34 changes: 34 additions & 0 deletions src/bdscript/dmComplex.md
Original file line number Diff line number Diff line change
@@ -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.
45 changes: 25 additions & 20 deletions src/bdscript/giveRole.md
Original file line number Diff line number Diff line change
@@ -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)
14 changes: 7 additions & 7 deletions src/bdscript/ping.md
Original file line number Diff line number Diff line change
@@ -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)
29 changes: 22 additions & 7 deletions src/bdscript/takeRole.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
# $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[]

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