Test Join
Overview
The /test-join command simulates a member joining the server, triggering the guildMemberAdd event and all associated handlers without requiring an actual user to join.
Command Details
Permissions Required
User:
ADMINISTRATORpermissionBot: Depends on triggered handlers
Command Syntax
/test-joinNo parameters required. Response is ephemeral (only visible to you).
Purpose
This command is designed for testing and development purposes to:
Test welcome message functionality
Verify member join event handlers
Debug join-related features
Test database member creation
Verify role assignment on join
Check DM welcome messages
What It Does
Simulates Event: Fires the
guildMemberAddeventUses Your Account: Simulates YOU joining (you're already in the server)
Triggers Handlers: All join event handlers execute
No Actual Join: You don't actually leave and rejoin
Features
1. Safe Testing
Join roles and welcome actions execute as configured (roles/messages may change)
You remain in server with existing roles
Can test repeatedly without side effects
2. Complete Simulation
Triggers ALL join event handlers
Tests database operations
Verifies welcome messages
Checks role assignments
3. Development Tool
Essential for development workflow
Saves time versus actual joins/leaves
Allows rapid iteration on join features
Usage Example
Response:
What happens:
Welcome message posted (if configured)
Welcome DM sent to you (if configured)
Member record created/updated in database
Join roles assigned (if configured)
Any custom join logic executes
Use Cases
Developing welcome messages: Test message format and content
Testing role assignments: Verify auto-roles on join work
Debugging join handlers: Identify issues in join logic
Verifying database: Check member records are created
Testing DMs: Ensure welcome DMs send properly
Testing Workflow
Make changes to join event handlers
Compile code:
yarn compileUse
/test-jointo trigger handlersVerify behavior
Iterate as needed
No need to:
Leave and rejoin server
Use alt accounts
Ask others to join for testing
What Gets Triggered
Event Handlers
Located in src/events/memberEvents.ts:
Exported handler:
memberJoin(event type:Events.GuildMemberAdd)Database member creation
Welcome message posting
Welcome DM sending
Initial role assignment
Logging and any custom join logic
Typical Join Flow
Member Added Event fires
Database: Member record created/updated
Welcome Channel: Welcome message posted
DM: Welcome DM sent to user
Roles: Auto-roles assigned
Logging / Custom Logic: Any logging and guild-specific join logic executes
Limitations
Since you're already in the server, some behaviors may differ from a real join
You already have roles (won't remove them)
Database record likely already exists
Some checks may handle existing members differently
For most accurate testing of NEW member joins, test in development server or use test accounts.
Related Commands
Test Leave - Simulate member leaving
Backend Manager - Check database after testing
Best Practices
Test in development server first: Before production testing
Review logs: Check console/logs for errors
Check database: Verify records are created correctly
Test DMs: Confirm messages are sent
Disable in production: Remove or restrict in live environment
Configuration
Join behaviors are configured in:
config.json- Welcome channel, messages, rolessrc/events/memberEvents.ts- Join event handlers
Configure:
Welcome channel ID
Welcome message content
Auto-assigned roles
DM welcome message
Security Note
This command should be restricted to administrators only. In production, consider disabling or removing testing commands.
Tips
Use frequently during development
Combine with
/test-leavefor complete flow testingCheck audit logs after test to verify all actions
Test with different configurations
Verify database state after each test
Watch for errors in console
Test DM permissions (ensure bot can DM you)
Troubleshooting
Nothing happens:
Check event handler is registered
Verify welcome channel is configured
Check bot permissions in welcome channel
Review console logs for errors
No DM received:
Check your DM settings (allow DMs from server members)
Verify bot has proper permissions
Check DM sending code for errors
Database not updated:
Check database connection
Verify database write permissions
Review database logs
Welcome message missing:
Verify channel ID in config
Check bot permissions in channel
Ensure welcome feature is enabled
Last updated
Was this helpful?