Core Settings
These values define how px_discord connects to Discord and validates player permissions.Role Gate
px_discord supports optional role-based access control to restrict server entry.Role Mode Behavior
When Mode = ‘any’:- Player must have at least one listed role
- Most common setup
- Suitable for verification or membership systems
- Player must have every listed role
- Used for strict permission environments
- Suitable for private or staff-only servers
How It Works
The system runs entirely server-side and handles all Discord communication securely.Connection Flow
- The resource initializes using your configured Discord bot token
- Guild validation ensures the bot is connected to the correct server
- Player Discord identifiers are detected automatically
- Role data is requested and validated against configured requirements
Role Validation Flow
- Discord roles are fetched using secure API requests
- Role data is cached to reduce unnecessary requests
- Players are approved or denied based on configured role logic
- Access decisions are handled entirely server-side
Permission Handling
- All validation runs before player access is granted
- No client-side role checks are required
- Permissions stay consistent across reconnects
Fallback Behavior
If the Discord API fails or returns invalid data:- Cached role data is used when available
- Players are temporarily restricted if validation cannot be completed
- The system retries automatically on the next request cycle
Performance
px_discord is designed to remain lightweight and efficient.- Role data is cached to reduce API usage
- Requests are interval-based, not constant
- Minimal memory usage during validation
- Fully server-driven logic with optimized handling
Debug Mode
When enabled, the script prints useful logs for:
- Discord connection checks
- Role validation results
- Access decisions
- API response handling