Skip to content

Commit

Permalink
Merge pull request #429 from Rainb0wKey/patch-7
Browse files Browse the repository at this point in the history
New functions ( $isInteger[] $floor[] $ceil[] ) + Example fix
  • Loading branch information
kubastick committed Aug 17, 2024
2 parents 27d3367 + 06a58b0 commit 9702079
Show file tree
Hide file tree
Showing 20 changed files with 361 additions and 30 deletions.
3 changes: 3 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
- [$categoryCount](./bdscript/categoryCount.md)
- [$categoryCount[]](./bdscript/categoryCountComplex.md)
- [$categoryID](./bdscript/categoryID.md)
- [$ceil](./bdscript/ceil.md)
- [$changeCooldownTime](./bdscript/changeCooldownTime.md)
- [$changeUsername](./bdscript/changeUsername.md)
- [$changeUsernameWithID](./bdscript/changeUsernameWithID.md)
Expand Down Expand Up @@ -190,6 +191,7 @@
- [$findChannel](./bdscript/findChannel.md)
- [$findRole](./bdscript/findRole.md)
- [$findUser](./bdscript/findUser.md)
- [$floor](./bdscript/floor.md)
- [$footer](./bdscript/footer.md)
- [$footerIcon](./bdscript/footerIcon.md)
- [$getBanReason](./bdscript/getBanReason.md)
Expand Down Expand Up @@ -239,6 +241,7 @@
- [$isBooster](./bdscript/isBooster.md)
- [$isBot](./bdscript/isBot.md)
- [$isHoisted](./bdscript/isHoisted.md)
- [$isInteger](./bdscript/isInteger.md)
- [$isMentionable](./bdscript/isMentionable.md)
- [$isNSFW](./bdscript/isNSFW.md)
- [$isNumber](./bdscript/isNumber.md)
Expand Down
55 changes: 55 additions & 0 deletions src/bdscript/ceil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# $ceil
Rounds the number **up** and returns the smallest integer greater than or equal to a specified number.

## Syntax
```
$ceil[Number]
```

### Parameters
- `Number` `(Type: Integer, Float || Flag: Required)`: The number that will be rounded.

## Example
```
$nomention
Result: $ceil[$message]
```

```discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example 6.3
- user_id: 1009018156494368798
username: BDFD Support
color: "#378afa"
bot: true
verified: true
content: |
Result: 7
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example -6.4
- user_id: 1009018156494368798
username: BDFD Support
color: "#378afa"
bot: true
verified: true
content: |
Result: -6
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example 8
- user_id: 1009018156494368798
username: BDFD Support
color: "#378afa"
bot: true
verified: true
content: |
Result: 8
```
55 changes: 55 additions & 0 deletions src/bdscript/floor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# $floor
Rounds the number **down** and returns the largest integer less than or equal to a specified number.

## Syntax
```
$floor[Number]
```

### Parameters
- `Number` `(Type: Integer, Float || Flag: Required)`: The number that will be rounded.

## Example
```
$nomention
Result: $floor[$message]
```

```discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example 6.2
- user_id: 1009018156494368798
username: BDFD Support
color: "#378afa"
bot: true
verified: true
content: |
Result: 6
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example -6.4
- user_id: 1009018156494368798
username: BDFD Support
color: "#378afa"
bot: true
verified: true
content: |
Result: -7
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example 9
- user_id: 1009018156494368798
username: BDFD Support
color: "#378afa"
bot: true
verified: true
content: |
Result: 9
```
59 changes: 59 additions & 0 deletions src/bdscript/isInteger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# $isInteger
Checks if the specified value is an integer or not.

```admonish tip
`true` means the value is an integer, `false` means it isn’t.
```

## Syntax
```
$isInteger[Value]
```

### Parameters
- `Value` `(Type: String || Flag: Required)`: The string that will be checked.

## Example
```
$nomention
Integer?: $isInteger[$message]
```

```discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example number
- user_id: 1009018156494368798
username: BDFD Support
color: "#378afa"
bot: true
verified: true
content: |
Integer?: false
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example 1.8
- user_id: 1009018156494368798
username: BDFD Support
color: "#378afa"
bot: true
verified: true
content: |
Integer?: false
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example 4
- user_id: 1009018156494368798
username: BDFD Support
color: "#378afa"
bot: true
verified: true
content: |
Integer?: true
```
9 changes: 5 additions & 4 deletions src/bdscript/nodeVersion.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ $nomention
Node version: $nodeVersion
```

```discord yaml
``` discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example
- username: BDFD Support
color: "#b9a0e0"
user_id: 1009018156494368798
color: "#378afa"
bot: true
verified: true
content: |
Node version: 05-07-2023-c8800d6
Node version: 11-08-2024-44c8617
```

> You can use [`$botNode`](./botNode.md) to find out which node your bot is on.
8 changes: 5 additions & 3 deletions src/bdscript/nodeVersionComplex.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ $nomention
13 Node Version: $nodeVersion[13]
```

```discord yaml
``` discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example
- username: BDFD Support
color: "#b9a0e0"
user_id: 1009018156494368798
color: "#378afa"
bot: true
verified: true
content: |
13 Node Version: 05-07-2023-c8800d6
```

18 changes: 16 additions & 2 deletions src/bdscript/ping.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ $ping
## Example
```
$nomention
Pong! `$pingms`
Pong! $pingms
```

``` discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example
- username: BDFD Support
user_id: 1009018156494368798
color: "#378afa"
bot: true
verified: true
content: |
Pong! 5ms
```
![example](https://user-images.githubusercontent.com/111157596/250922355-2b9717e6-e175-4feb-a218-f121f886a324.png)
17 changes: 15 additions & 2 deletions src/bdscript/round.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,20 @@ $round[Number;(Decimal place)]
## Example
```
$nomention
$round[100.123;1]
Result: $round[100.123;1]
```

![example](https://user-images.githubusercontent.com/69215413/125875437-417ae90b-c685-4aad-94b7-1767e153b7f3.png)
``` discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example
- username: BDFD Support
user_id: 1009018156494368798
color: "#378afa"
bot: true
verified: true
content: |
Result: 100.1
```
17 changes: 15 additions & 2 deletions src/bdscript/serverCount.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ $nomention
I'm currently in $serverCount servers!
```

![example](https://user-images.githubusercontent.com/69215413/126365568-9b9ced49-6955-4e74-934d-688f0fcda366.png)
``` discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example
- username: BDFD Support
user_id: 1009018156494368798
color: "#378afa"
bot: true
verified: true
content: |
I'm currently in 203 servers!
```

> Can be used in bot status
> Can be used in bot status
18 changes: 16 additions & 2 deletions src/bdscript/serverDescription.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ $serverDescription
## Example
```
$nomention
Hey, this server has a great description: $serverDescription
Server description: $serverDescription
```

``` 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 description: Welcome to the Official Bot Designer For Discord community server!
```
![Example](https://user-images.githubusercontent.com/70456337/189480730-f72d6770-2e45-4f01-b73c-cec642ccf51f.png)
18 changes: 16 additions & 2 deletions src/bdscript/serverDescriptionComplex.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ $serverDescription[Guild ID]
## Example
```
$nomention
Server description: $serverDescription[$message[1]]
Server description: $serverDescription[$message]
```

``` discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example 1009018669982031912
- username: BDFD Support
user_id: 1009018156494368798
color: "#378afa"
bot: true
verified: true
content: |
Server description: Welcome to the BDFD Support server! Enjoy stay with us!
```
![example](https://user-images.githubusercontent.com/111157596/231823496-12571db3-ba85-4e73-845c-bee765a4c4bc.png)
18 changes: 16 additions & 2 deletions src/bdscript/shardID.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ $shardID
## Example
```
$nomention
$shardID
Shard: $shardID
```

``` discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example
- username: BDFD Support
user_id: 1009018156494368798
color: "#378afa"
bot: true
verified: true
content: |
Shard: 1
```
![example](https://user-images.githubusercontent.com/95774950/162153099-4fb1bf14-44de-4f7c-b5d6-604f43ab76aa.png)
16 changes: 15 additions & 1 deletion src/bdscript/slashCommandsCount.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,18 @@ $slashCommandsCount
$nomention
I have $slashCommandsCount slash commands!
```
![example](https://user-images.githubusercontent.com/69215413/126920314-1ad9374e-d19d-43f5-8939-f9abf48a62de.png)

``` discord yaml
- user_id: 803569638084313098
username: RainbowKey
color: "#E67E22"
content: |
!example
- username: BDFD Support
user_id: 1009018156494368798
color: "#378afa"
bot: true
verified: true
content: |
I have 4 slash commands!
```
Loading

0 comments on commit 9702079

Please sign in to comment.