-
Notifications
You must be signed in to change notification settings - Fork 0
04. Managing Bot Permissions
Properly managing permissions for TGraph Bot is crucial for maintaining the security and integrity of your Discord server. This page will guide you through setting up and managing permissions for TGraph Bot commands.
Discord uses a role-based permission system. Each command can be restricted to specific roles or users, allowing fine-grained control over who can use which bot features.
-
Open Server Settings:
- Click on your server name in Discord.
- Select "Server Settings" from the dropdown menu.
-
Navigate to Integrations:
- In the left sidebar, click on "Integrations".
- Find and click on "TGraph Bot" in the list of integrations.
-
Configure Command Permissions:
- In the "Command Permissions" section, you'll see a list of all TGraph Bot commands.
- For each command, you can specify which roles or users have permission to use it.
Here are our recommended permission settings for TGraph Bot commands:
-
/about
and/uptime
: Allow for all members. -
/config
: Restrict to admin roles only. -
/my_stats
: Allow for all members or restrict to specific roles if desired. -
/update_graphs
: Restrict to admin roles only.
Pay special attention to these commands, as they can significantly impact bot behavior:
-
/config
: This command can change bot settings. It should be restricted to trusted administrators only. -
/update_graphs
: While less sensitive, frequent use could strain your server. Consider restricting it to moderators or administrators.
TGraph Bot includes an automatic permission checker that runs on startup. It will log any potential security risks, such as sensitive commands being accessible to all users.
The permission check looks like this in the log:
Command permissions for guild 'Your Server Name':
+--------------------------------+---------------------------+
| Permission Entity | Accessible by |
+================================+===========================+
| Bot Overall Permissions | @everyone (Allowed) |
+--------------------------------+---------------------------+
| /about | @everyone (Allowed) |
+--------------------------------+---------------------------+
| /config | Admin Role (Allowed) |
+--------------------------------+---------------------------+
| /my_stats | @everyone (Allowed) |
+--------------------------------+---------------------------+
| /update_graphs | Mod Role (Allowed) |
+--------------------------------+---------------------------+
| /uptime | @everyone (Allowed) |
+--------------------------------+---------------------------+
If users report being unable to use certain commands:
- Check the server's audit log to see if permissions were recently changed.
- Verify that the user has the correct role for the command they're trying to use.
- Ensure that TGraph Bot has the necessary permissions in your server settings.
- Principle of Least Privilege: Give users the minimum permissions necessary for their needs.
- Regular Audits: Periodically review and update command permissions.
- Use Roles: Instead of assigning permissions to individual users, use roles for easier management.
- Document Changes: Keep a record of permission changes and the reasons for them.
Remember, proper permission management is key to maintaining a secure and well-functioning Discord server with TGraph Bot.