Member System Documentation
The Member System is the core component of AlbionManager that handles member registration, role management, and integration with Discord roles. This comprehensive guide will walk you through all aspects of the member system.
/setup start command.
📖 Table of Contents
- System Overview
- Member Registration
- Dashboard Management
- Discord Commands
- Role Management
- Data Structure
- Troubleshooting
🔍 System Overview
The Member System provides:
- Albion Online Integration: Links Discord users with their Albion Online characters
- Role Synchronization: Automatically assigns Discord roles based on member data
- Web Dashboard: Visual interface for managing members
- Discord Commands: Bot commands for registration and management
- Data Persistence: SQLite database storage with Sequelize ORM
👥 Member Registration
Automatic Registration (Recommended)
Members can register themselves using the Discord slash command:
/register player-name: YourPlayerName first-role: DPS second-role: Healer region: EU
Registration Process:
- Member uses the
/registercommand in Discord - Bot validates the player name with Albion Online API
- Verifies if player is part of the configured guild
- Creates member record in database with roles and region
- Assigns appropriate Discord role (if configured)
- Sends confirmation message with member details
Manual Registration (Admin Only)
Administrators can register members using:
/force-register user: @DiscordUser player-name: PlayerName first-role: DPS second-role: Healer region: EU
/force-register as an admin, then update the information later when the API catches up.
🖥️ Dashboard Management
The web dashboard provides member viewing and basic management tools:
Accessing the Dashboard
- Visit your bot's web interface
- Login with Discord OAuth
- Select a guild from the sidebar dropdown
- Click "View Members" from the guild overview
Dashboard Features
Member List View
- Table Display: Shows all registered members in a sortable table
- Global Search: Search across all fields (player name, Discord ID, roles, region)
- Column Filters: Filter by specific values in each column
- Sorting: Click column headers to sort alphabetically or numerically
Setup Configuration Management
The dashboard also provides access to modify bot configuration:
- Guild Settings: Update guild information and server region
- Role Mappings: Modify Discord role assignments for classes and regions
- Channel Settings: Change log channel configuration
- Live Preview: See current configuration before making changes
/setup start again, but with a more user-friendly interface.
Member Information Displayed
- Player Name: Albion Online character name
- Discord ID: Discord user ID
- First Role: Primary combat role
- Second Role: Secondary combat role
- Region: Player's region (NA, EU, ASIA)
Available Actions
- Edit Member: Modify member information directly in the dashboard (Edit button)
- Delete Member: Remove member from system (Delete button)
- Live Updates: Changes made in the dashboard take effect immediately
- Role Updates: Changing member roles in the dashboard automatically updates Discord role assignments
💬 Discord Commands
User Commands
/register
Purpose: Register your Discord account with an Albion Online player
Usage: /register player-name: [name] first-role: [role] second-role: [role] region: [region]
Parameters:
player-name(required): Your Albion Online player namefirst-role(required): Your primary combat rolesecond-role(required): Your secondary combat roleregion(required): Your region (NA, EU, ASIA)
Available Roles:
- Arcane Support
- Battlemount
- Clump Tank
- Curse Support
- D-Tank
- DPS
- Healer
- Oathkeeper/Groot
Example: /register player-name: JohnWarrior first-role: DPS second-role: Healer region: EU
Admin Commands
/force-register
Purpose: Register another user (admin only)
Usage: /force-register user: [@user] player-name: [name] first-role: [role] second-role: [role] region: [region]
Permissions: Requires "Manage Roles" permission
/members
Purpose: Display paginated member list with search and filter options
Usage: /members
Features:
- Paginated display with navigation buttons
- Members organized alphabetically in ranges (A-G, H-P, Q-Z)
- Shows player names with Discord mentions
- 5-minute interaction timeout
- Guild-specific member listing
/remove
Purpose: Remove a member from the system
Usage: /remove user: [@user]
Permissions: Requires administrator permissions
/check-unregistered
Purpose: List Discord users who haven't registered
Usage: /check-unregistered
Output: Shows unregistered users with registration prompts
/flush
Purpose: Manually clean up Discord roles for users who are no longer registered or no longer in the Albion Online guild
Usage: /flush
Permissions: Requires administrator permissions
Function:
- Removes member roles from Discord users who are not registered in the bot
- Verifies active guild membership: Checks via Albion Online API if registered players are still in the configured guild
- Removes roles from users whose in-game characters have left the guild
- Cleans up class roles (DPS, Healer, etc.) from unregistered or inactive users
- Removes region roles (NA, EU, ASIA) from unregistered or inactive users
- Provides a detailed report of cleaned roles and affected users
/flush command periodically to clean up roles from users who are no longer registered. This is by design to prevent accidental role removal and give administrators control over when cleanup occurs.
/flush command performs a comprehensive check by querying the Albion Online API to verify that registered players are still active members of your configured guild. If a player has left the guild in-game, their Discord roles will be automatically removed during the flush operation.
/flush regularly (weekly or monthly) to keep your Discord roles clean and organized. This is especially important after removing multiple members or during server cleanups.
🎭 Role Management
The bot automatically assigns Discord roles based on member registration data. The system supports multiple types of roles that are configured per guild.
Role Types
Main Member Role
Every registered member automatically receives the main member role configured in the guild setup. This is the primary role that identifies registered members.
Class Roles
Based on the first-role and second-role selections during registration, members receive corresponding Discord roles:
- Arcane Support Role - For Arcane Support players
- Battlemount Role - For Battlemount players
- Clump Tank Role - For Clump Tank players
- Curse Support Role - For Curse Support players
- D-Tank Role - For D-Tank players
- DPS Role - For DPS players
- Healer Role - For Healer players
- Oathkeeper/Groot Role - For Oathkeeper/Groot players
Region Roles
Members also receive a region role based on their selection:
- NA Region Role - For North America players
- EU Region Role - For Europe players
- ASIA Region Role - For Asia players
Role Configuration
Roles are configured through the /setup start command by guild administrators. All role types must be mapped to existing Discord roles:
- Required: Main member role (member-role)
- Required: Management role (management-role)
- Required: Booster role (booster-role)
- Required: All class roles (8 total) - Each combat class must have a corresponding Discord role
- Required: All region roles (3 total) - NA, EU, and ASIA regions must each have a Discord role
Automatic Role Assignment
Roles are automatically assigned during registration:
- Main Member Role: Always assigned to registered members
- Primary Class Role: Based on first-role selection
- Secondary Class Role: Based on second-role selection (if different from primary)
- Region Role: Based on region selection
Role Assignment Behavior
- Guaranteed Assignment: All registered members will receive their appropriate roles since all mappings are configured
- Duplicate Prevention: If primary and secondary roles are the same, only one role is assigned
- Error Handling: If role assignment fails, registration still completes with error logging
- Permission Checks: Bot must have "Manage Roles" permission and its role must be higher than assigned roles
- Role Validation: All roles are validated during setup to ensure they exist
Manual Role Cleanup
The bot does not automatically remove Discord roles when members are removed from the system. This requires manual intervention using the /flush command.
Why Manual Cleanup?
- Safety: Prevents accidental role removal due to temporary issues
- Control: Gives administrators full control over when cleanup occurs
- Flexibility: Allows for grace periods when members temporarily leave
- Audit Trail: Manual execution ensures administrators are aware of role changes
When to Run /flush
- After removing multiple members from the bot
- During regular server maintenance (weekly/monthly)
- When you notice unregistered users still have member roles
- Before important events to ensure role accuracy
- When players leave the guild in-game: To automatically clean up Discord roles for members who are no longer in the Albion Online guild
/flush command will scan all Discord server members, compare against registered users in the database, verify current guild membership via Albion Online API, and remove bot-managed roles from users who are not registered or no longer in the configured guild. It provides a detailed report of all actions taken.
📊 Data Structure
Member Model
Each member record contains:
{
"id": "auto_increment_id",
"playerName": "Albion Online Player Name",
"playerId": "albion_player_id_from_api",
"discordServerId": "discord_server_id",
"discordMemberId": "discord_user_id",
"firstRole": "DPS",
"secondRole": "Healer",
"region": "EU",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T12:30:00.000Z"
}
Database Relationships & Constraints
- Unique Constraints:
- One Discord user per server (discordMemberId + discordServerId)
- One player name per server (playerName + discordServerId)
- Related Models:
- BankAccount - Member financial transactions
- Transaction - Individual transaction records
- Attendance - Event participation tracking
- SiphonTransaction - Energy contribution records
🔧 Troubleshooting
Common Issues
Setup Command Fails
Symptoms: Setup command returns error or doesn't complete
Solution: Please refer to the comprehensive First Steps guide which covers all setup requirements, troubleshooting, and step-by-step instructions.
Registration Fails
Symptoms: User gets error when trying to register
Possible Causes:
- Player name doesn't exist in Albion Online
- Player recently joined guild: Albion API hasn't updated yet (can take up to 3 days)
- Player is not part of the configured guild
- User already registered (duplicate Discord user or player name)
- Invalid role selections (first and second role must be different)
- Database connection issues
- Missing bot permissions
- Player is blacklisted
Solutions:
- Verify player name exists in Albion Online
- Confirm player is member of the configured guild
- Wait for API update: If player recently joined, try again in a few hours or days
- Use force-register: Admins can use
/force-registerfor urgent cases - Use
/removeto clear existing registration if updating - Select different first and second roles
- Check blacklist status
- Verify database connectivity
- Ensure bot has "Manage Roles" permission
Roles Not Assigned
Symptoms: Member registers but doesn't get Discord role
Solutions:
- Check role configuration in setup
- Verify bot's role is higher than assigned roles
- Run manual role sync from dashboard
- Check role names match exactly
Dashboard Access Issues
Symptoms: Cannot access member management in dashboard
Solutions:
- Verify Discord OAuth login
- Check user has admin permissions
- Clear browser cache and cookies
- Verify server configuration
Data Recovery
If member data is lost or corrupted:
- Check automatic database backups
- Use backup restoration tools
- Re-register members if necessary
- Contact support with error logs