Overview
Jill Stingray uses a sophisticated permission system that allows server administrators to control:- Who can use each command (permission levels)
- Where commands can be used (channel whitelisting)
- Whether commands are enabled or disabled
/config command, which requires “Manage Server” permission by default.
Permission Levels
The bot supports the following permission tiers:| Permission | Description | Discord Permission Required |
|---|---|---|
| Everyone | No restrictions | None |
| Kick Members | Moderation actions | KICK_MEMBERS |
| Ban Members | Moderation actions | BAN_MEMBERS |
| Manage Messages | Message management | MANAGE_MESSAGES |
| Manage Roles | Role management | MANAGE_ROLES |
| Manage Server | Server configuration | MANAGE_GUILD |
| Manage Emojis/Stickers | Emoji management | MANAGE_GUILD_EXPRESSIONS |
| Administrator | Full server control | ADMINISTRATOR |
| Developer Only | Bot owner exclusive | Special flag |
Permission Checking Logic
Fromutils/permissions.js:15-83, the permission system:
- Bot owner bypass - Bot owner (set via
BOT_OWNER_IDenv var) bypasses all checks - Command-specific rules - Checks custom permission requirements from database
- Default fallback - Uses the command’s default permission level
- Null/Everyone - If permission is
nullor"everyone", allows all users
Configuring Command Permissions
Setting Permission Requirements
Use/config permission to set the minimum permission level for a command:
- Reset to Default
- Administrator
- Manage Server
- Manage Roles
- Manage Messages
- Kick Members
- Ban Members
- Everyone (None)
commands/config.js:100-127, these options are presented as autocomplete choices in the slash command.
Examples
When you reset to default, the bot uses the permission level defined in
utils/default.js for that command.Response Feedback
The bot provides clear confirmation messages:Channel Restrictions
Adding Channel Whitelists
Restrict commands to specific channels using/config channel:
Removing Channel Restrictions
How Channel Restrictions Work
Fromcommands/config.js:200-218 and events/interactionCreate.js:50-55:
Enabling and Disabling Commands
Toggle Command Status
/config itself, which cannot be disabled).
Implementation Details
Fromcommands/config.js:196-199 and events/interactionCreate.js:44-49:
Viewing Current Settings
Overview of All Commands
- 🟢/🔴 Status indicator (enabled/disabled)
- Command name
- Permission level
- Channel restriction status
commands/config.js:363-375:
Single Command Details
Advanced Configuration
Layered Permission System
Permissions are resolved in this order (fromcommands/config.js:296-316):
- Database override - Custom settings from
/config permission - Default rules - Defined in
utils/default.js - Command metadata - The
default_member_permissionsfield in command definition
Settings Cache
The bot caches permission settings for 60 seconds to reduce database queries:/config.
Permission Format Reference
Fromcommands/config.js:9-26, these are the internal mappings:
Best Practices
Start restrictive, relax as needed
Start restrictive, relax as needed
Begin with tighter permissions and loosen them based on community feedback. It’s easier to grant access than revoke it.
Use channel restrictions for spam prevention
Use channel restrictions for spam prevention
Limit fun commands like
/8ball, /surprise, and /mix to dedicated bot channels to prevent spam in discussion channels.Reserve admin commands appropriately
Reserve admin commands appropriately
Commands like
/config, /purge, and /role should remain restricted to trusted moderators or administrators.Document your server's permission structure
Document your server's permission structure
Keep a reference of which roles have which Discord permissions, so you can properly configure bot command access.
Test changes with a moderator account
Test changes with a moderator account
After adjusting permissions, test with a non-admin account to verify the restrictions work as expected.
Troubleshooting
”Access Denied” Messages
If legitimate users are getting denied:- Check the command’s permission level:
/config overview command:commandname - Verify the user has the required Discord permission in their roles
- Ensure the command isn’t disabled: check the status indicator
- Check channel restrictions if the error mentions channels
Settings Not Applying
If permission changes don’t take effect:- Settings cache refreshes every 60 seconds - wait briefly
- The
/configcommand automatically clears the cache on changes - Check the database directly if issues persist
Commands Showing as “Everyone” When They Shouldn’t
This happens when:- Permission is explicitly set to
nullin database - Default rule has
min_perm: null - No permission is defined anywhere
/config permission with “Reset to Default” to restore the intended permission level.
Related Commands
/help- View all available commands and their descriptions/config toggle- Enable or disable commands/config permission- Set permission requirements/config channel- Configure channel restrictions/config overview- View current settings