A Discord bot that monitors user statuses, activities, and display names and automatically assigns roles based on configured text patterns.
- Automatic Role Assignment: Assigns roles to users when their profile contains specific text
- Multi-Source Monitoring: Monitors custom statuses, activity details, and display names
- Real-time Monitoring: Monitors profile changes in real-time
- Configurable Patterns: Support for multiple text patterns and corresponding roles
- Logging: Sends messages to a configured channel when roles are assigned/removed
- Admin Commands: Commands for checking profile text and reloading configuration
Need help or want to contribute? Join our Development/Support Server: https://discord.gg/3bwYgqQsQp
The bot checks for text patterns in:
- Custom Status Messages: User's custom status text
- Activity Details: Details from activities like games, Spotify, etc.
- Display Names: Server nicknames and global display names
- Activity Names: Names of activities and rich presence data
Note: Discord bios are not accessible via the bot API, but the bot monitors all other available text sources.
- Python 3.8 or higher
- A Discord bot token
- Administrator permissions in your Discord server
-
Clone this repository:
git clone <repository-url> cd Status-Role-Discord-Bot
-
Install dependencies:
pip install -r requirements.txt
-
Configure the bot by editing
config.json
:{ "bot_token": "YOUR_BOT_TOKEN_HERE", "guild_id": "YOUR_GUILD_ID_HERE", "log_channel_id": "YOUR_LOG_CHANNEL_ID_HERE", "status_roles": [ { "status_text": "discord.gg/maharlika", "role_id": "YOUR_ROLE_ID_HERE", "case_sensitive": false } ] }
bot_token
: Your Discord bot tokenguild_id
: The ID of the Discord server to monitorlog_channel_id
: Channel ID where the bot will send role assignment messagesstatus_roles
: Array of status pattern configurations
Each entry in status_roles
should have:
status_text
: The text to look for in user statusesrole_id
: The Discord role ID to assigncase_sensitive
: Whether the text matching should be case-sensitive (default: false)
- Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode)
- Right-click on servers, channels, or roles to copy their IDs
python bot.py
- Profile Monitoring: The bot monitors all members' presence updates and profile changes
- Pattern Matching: When any monitored text changes, it checks if the new text contains any configured patterns
- Role Assignment: If a match is found in any available text source, the corresponding role is assigned
- Role Removal: If a user removes the required text from all monitored sources, the role is removed
- Logging: All role changes are logged to the configured channel with details about where the match was found
If configured with:
{
"status_text": "discord.gg/maharlika",
"role_id": "123456789012345678",
"case_sensitive": false
}
Scenarios:
- User sets custom status to "Join our server! discord.gg/maharlika" → Gets the role
- User sets their nickname to "John - discord.gg/maharlika" → Gets the role
- User has a game activity with "discord.gg/maharlika" in details → Gets the role
- User removes text from all monitored sources → Loses the role
Bot sends messages to the log channel for all actions, showing where the match was found.
The bot requires the following permissions:
- View Channels
- Send Messages
- Manage Roles
- Read Message History
- Bot not responding: Check that the bot token is correct and the bot is online
- Role not assigned: Ensure the bot has permission to manage the target role
- No log messages: Verify the log channel ID is correct and the bot can send messages there
- Status not detected: Make sure the bot has the "Presence Intent" enabled in the Discord Developer Portal
This project is licensed under the MIT License - see the LICENSE file for details.