Skip to content

Commit

Permalink
Merge pull request #412 from Rainb0wKey/patch-15
Browse files Browse the repository at this point in the history
$setUserRoles[] + $hour update
  • Loading branch information
kubastick authored Jul 13, 2024
2 parents b32fc38 + e6b90c2 commit 98c1ea6
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bdscript/hour.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# $hour
Returns the current hour.

> 🧙‍♂️ You can use [`$time`](./time.md) to change the timezone.
> You can use [`$time`](./time.md) to change the timezone.
> 📝 The `$hour` function uses the twenty-four-hour clock instead of two groups of twelve hours; this is also known as "Military Time".
> The `$hour` function uses the twenty-four-hour clock instead of two groups of twelve hours; this is also known as "Military Time".
## Syntax
```
Expand All @@ -27,5 +27,7 @@ Current Hour: $hour
color: "#748BD4"
bot: true
content: |
Current Hour: 21
<div id="hour"></div>
```

<script src="../theme/livetime.js"></script>
63 changes: 63 additions & 0 deletions src/bdscript/setUserRoles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# $setUserRoles
Overrides all roles of the given user.

## Syntax
```
$setUserRoles[User ID;Role ID;...]
```

### Parameters
- `User ID` `(Type: Snowflake || Flag: Required)`: ID of the user to set the role.
- `Role ID` `(Type: Snowflake || Flag: Required)`: Roles to be given to the user. Separate roles using `;`.

## Example
```
$nomention
$setUserRoles[$authorID;$roleID[Support]]
We've reset all your roles! Now you have "Support" role.
```
*In this example, we will remove all roles and give one role with "Support" name*.

```discord yaml
- user_id: 803569638084313098
username: RainbowKey
content: |
!roles
- user_id: 1009018156494368798
username: BDFD Support
bot: true
verified: true
content: |
Cool
BDFD
Moderator
- user_id: 803569638084313098
username: RainbowKey
content: |
!example
- user_id: 1009018156494368798
username: BDFD Support
bot: true
verified: true
content: |
We've reset all your roles! Now you have "Support" role.
- user_id: 803569638084313098
username: RainbowKey
content: |
!roles
- user_id: 1009018156494368798
username: BDFD Support
bot: true
verified: true
content: |
Support
```

> How [$roleID[]](./roleID.md) and [$authorID](./authorID.md) works?
### Code for `!roles` command:
```
$nomention
$userRoles[$authorID]
```
> [How $userRoles[] works?](./userRoles.md)
11 changes: 11 additions & 0 deletions src/theme/livetime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var day = new Date().getDate();
var time = new Date().getTime();
var second = new Date().getSeconds();
var minute = new Date().getMinutes();
var hour = new Date().getHours();

document.getElementById('day').innerHTML = "Current Day: " + day;
document.getElementById('unix').innerHTML = time;
document.getElementById('second').innerHTML = "Current Second: " + second;
document.getElementById('minute').innerHTML = "Current Minute: " + minute;
document.getElementById('hour').innerHTML = "Current Hour: " + hour;

0 comments on commit 98c1ea6

Please sign in to comment.