Skip to content

Commit 24aa8f5

Browse files
committed
Update README.md and the default ALLOWED_ROLE_ID in htop.js
1 parent 1de02f4 commit 24aa8f5

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ Use the `/htop` command to view a live list of the most resource-intensive proce
3636
The `/htop` command is restricted to a specific Discord user ID for security reasons. Only the designated user can run this command to view system processes.
3737

3838
The command code is located at [`src/commands/htop.js`](./src/commands/htop.js).
39+
To specify who can run the command, update the `ALLOWED_USER_ID` or `ALLOWED_ROLE_ID` constants in `src/commands/htop.js`:
40+
- If both are set, the command will allow access if the user matches either the user ID or the role ID (logical OR).
3941

40-
To customize which user can execute the command, update the `ALLOWED_USER_ID` constant in the command's code:
4142

4243
```js
4344
const ALLOWED_USER_ID = "123456789012345678"; // REPLACE WITH YOUR USER ID
45+
const ALLOWED_ROLE_ID = "123456789012345678"; // REPLACE WITH YOUR ROLE ID
4446
```
4547

4648
## 📦 Requirements
@@ -72,7 +74,6 @@ DISCORD_CHANNEL_ID=your-discord-channel-id
7274

7375
```
7476
node index.js
75-
7677
```
7778

7879
## 🚀 Auto-run at Startup (systemd)

src/commands/htop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const {
99
const si = require("systeminformation");
1010

1111
const ALLOWED_USER_ID = "123456789012345678"; // REPLACE WITH YOUR USER ID
12-
const ALLOWED_ROLE_ID = "1392088061424439348"; // REPLACE WITH YOUR ROLE ID
12+
const ALLOWED_ROLE_ID = "123456789012345678"; // REPLACE WITH YOUR ROLE ID
1313

1414

1515
function getUniqueProcessesByName(processList) {

0 commit comments

Comments
 (0)