This Discord bot provides welcome and leave messages, auto-role assignment, and server statistics tracking. The bot includes a web dashboard for easy configuration and monitoring.
- Welcome Messages: Customizable messages when users join your server
- Leave Messages: Customizable messages when users leave your server
- Auto-Role Assignment: Automatically assign roles to new members
- Self-Assignable Roles: Allow members to assign themselves specific roles
- Server Statistics: Track member joins, leaves, and activity over time
- Custom Prefix: Set a custom command prefix for your server
- Event Announcements: Celebrate member milestones and anniversaries
The web dashboard allows server administrators to:
- View server statistics
- Configure welcome and leave messages
- Manage auto-role and self-assignable roles
- Set custom command prefix
- Enable/disable features
The dashboard displays accurate statistics about your server:
- Today's Activity: Shows joins and leaves for the current day
- Weekly Activity: Shows joins and leaves for the current week
- Total Activity: Shows total joins and leaves since the bot joined
- Activity Graph: Displays member activity over the past 12 months
The statistics are updated in real-time and reflect actual server activity. When the bot is first added to a server, it will display estimated statistics until it collects enough real data.
Configure messages that are sent when members join or leave your server:
- Toggle: Enable or disable welcome/leave messages
- Message Type: Choose between text or embed format
- Content: Customize the message content with variables
- Channels: Select which channels receive the messages
Set up automatic role assignment for new members:
- Toggle: Enable or disable auto-role assignment
- Role Selection: Choose which roles are automatically assigned
- Self-Assignable Roles: Configure roles that members can assign themselves
Change the command prefix for your server:
- Go to the Settings tab in the dashboard
- Find the "Command Prefix" section
- Click "Change" and enter your new prefix (max 3 characters)
- The new prefix will be applied immediately
!help- Shows help information!ping- Checks if the bot is online!info- Shows information about the bot
!welcome config- Configure welcome messages!leave config- Configure leave messages
/role add <role>- Assign yourself a self-assignable role/role remove <role>- Remove a self-assigned role/role configure- Configure auto-role settings (admin only)
!prefix <new_prefix>- Change the command prefix (admin only)@BotName prefix <new_prefix>- Alternative way to change prefix if you forget current one
The bot stores configuration and statistics in MongoDB:
- Guild Configurations: Prefix, welcome/leave settings, role settings
- Statistics: Join/leave counts, member activity history
- User Data: Role assignments and preferences
The dashboard communicates with Discord's API and the bot's custom API:
- Discord API: Fetches server information, member counts, and roles
- Bot API: Retrieves and updates bot configuration and statistics
Required environment variables for the bot and dashboard:
DISCORD_BOT_TOKEN=your_bot_token_here DISCORD_CLIENT_ID=your_client_id_here DISCORD_CLIENT_SECRET=your_client_secret_here DISCORD_GUILD_ID=your_guild_id_here
USE_DATABASE=true MONGODB_URI=mongodb://localhost:27017/discordbot MONGODB_DB_NAME=discordbot
UPSTASH_REDIS_REST_URL=your_upstash_redis_url UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_token
DASHBOARD_ENABLED=true DASHBOARD_PORT=3000
NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your_random_secret_string_here


