A comprehensive Discord bot designed to welcome new users, manage roles, provide server information, and offer moderation tools. Perfect for community servers!
- Customizable welcome messages with placeholders
- Automatic welcome DMs to new members
- Leave message notifications
- Auto-role assignment for new members
- Interactive setup with
/setup
- DM-based verification codes
- Button verification for ease of use
- Manual verification by moderators
- Verification role assignment
- Configurable verification settings
- Self-assignable role menus with buttons
- Multiple role categories
- Maximum role limits per user
- Exclusive role groups (unique selection)
- Easy role menu creation and management
- FAQ system with categories
- Server information command
- User information with detailed stats
- Avatar and banner display
- Custom commands for quick responses
- Warning system with database tracking
- Timeout/mute functionality
- Kick and ban commands
- Message purging
- Channel lock/unlock
- Slowmode management
- Comprehensive logging
- Message edit and delete tracking
- Member join/leave logging
- Role changes
- Voice channel activity
- Nickname changes
- Avatar updates
- Invite tracking
- Python 3.8 or higher
- A Discord account
- A Discord server where you have admin permissions
- Go to Discord Developer Portal
- Click "New Application" (top right corner)
- Enter a name for your bot (e.g., "Welcome Bot")
- Click "Create"
- (Optional) Add a description and avatar in the "General Information" section
- In the left sidebar, click "Bot"
- Click "Add Bot" and confirm
- Under "Privileged Gateway Intents", enable ALL of the following:
- PRESENCE INTENT - To see member status
- SERVER MEMBERS INTENT - To track member joins/leaves
- MESSAGE CONTENT INTENT - To log message edits/deletes
- Click "Save Changes"
- Under "Token", click "Reset Token" then "Copy" (save this somewhere safe!)
-
In the left sidebar, click "OAuth2" → "URL Generator"
-
Under "Scopes", select:
- bot
- applications.commands
-
Under "Bot Permissions", select "Administrator" (recommended)
OR manually select these permissions:
- Manage Roles
- Manage Channels
- Kick Members
- Ban Members
- Manage Messages
- Manage Nicknames
- Moderate Members
- Read Message History
- View Channels
- Send Messages
- Embed Links
- Attach Files
- Mention Everyone
- Add Reactions
- Use Slash Commands
-
Copy the generated URL at the bottom
-
Paste the URL in your browser
-
Select your server from the dropdown
-
Click "Authorize"
-
Complete the CAPTCHA
- Open a terminal/command prompt
- Navigate to the bot folder:
cd discord_welcome_bot - Install required packages:
pip install -r requirements.txt
-
Copy the example environment file:
- Windows:
copy .env.example .env - Mac/Linux:
cp .env.example .env
- Windows:
-
Open
.envin a text editor and fill in your values:DISCORD_TOKEN=YOUR_ACTUAL_BOT_TOKEN_HERE BOT_PREFIX=! OWNER_ID=YOUR_DISCORD_USER_ID
How to get your Discord User ID:
- Enable Developer Mode in Discord (User Settings → Advanced → Developer Mode)
- Right-click your name → "Copy User ID"
python bot.pyYou should see output like:
==================================================
Bot Online: YourBotName
Bot ID: 123456789012345678
Guilds: 1
Users: 50
⏰ Started at: 2026-02-01 12:00:00 UTC
==================================================
Once the bot is running and in your server, use these commands to configure it:
/setup
This interactive wizard helps you configure:
- Welcome channel
- Rules channel
- Help channel
- Log channel
- Auto-role
/verification_setup
Configure member verification:
- Enable/disable verification
- Set verification role
/create_role_menu
Create self-assignable role menus for your members.
/faq_add
Add frequently asked questions for new members.
| Command | Description | Permission |
|---|---|---|
/setup |
Interactive setup wizard | Administrator |
/welcome_message |
Set custom welcome message | Manage Server |
/test_welcome |
Preview welcome message | Manage Server |
| Command | Description | Permission |
|---|---|---|
/verify |
Verify yourself | Everyone |
/verification_setup |
Configure verification | Administrator |
/force_verify |
Manually verify a user | Manage Roles |
/verification_status |
Check verification status | Manage Roles |
| Command | Description | Permission |
|---|---|---|
/roles |
View and select roles | Everyone |
/create_role_menu |
Create a role menu | Manage Roles |
/add_role_to_menu |
Add role to menu | Manage Roles |
/remove_role_from_menu |
Remove role from menu | Manage Roles |
/delete_role_menu |
Delete a role menu | Manage Roles |
/list_role_menus |
List all role menus | Manage Roles |
/give_role |
Give role to member | Manage Roles |
/remove_role |
Remove role from member | Manage Roles |
| Command | Description | Permission |
|---|---|---|
/faq |
View FAQs | Everyone |
/serverinfo |
Show server info | Everyone |
/userinfo |
Show user info | Everyone |
/avatar |
Show user avatar | Everyone |
/banner |
Show user banner | Everyone |
/roles |
List all server roles | Everyone |
/emoji |
Get emoji information | Everyone |
/faq_add |
Add FAQ | Manage Messages |
/faq_remove |
Remove FAQ | Manage Messages |
/faq_list |
List all FAQs | Manage Messages |
/custom_command |
Create custom command | Manage Server |
/remove_custom_command |
Remove custom command | Manage Server |
/list_custom_commands |
List custom commands | Everyone |
| Command | Description | Permission |
|---|---|---|
/warn |
Warn a user | Manage Messages |
/warnings |
View user's warnings | Manage Messages |
/clear_warnings |
Clear user's warnings | Manage Messages |
/mute |
Timeout/mute a user | Moderate Members |
/unmute |
Remove timeout | Moderate Members |
/kick |
Kick a user | Kick Members |
/ban |
Ban a user | Ban Members |
/unban |
Unban a user | Ban Members |
/banlist |
List banned users | Ban Members |
/purge |
Delete multiple messages | Manage Messages |
/slowmode |
Set channel slowmode | Manage Channels |
/lock |
Lock a channel | Manage Channels |
/unlock |
Unlock a channel | Manage Channels |
/nickname |
Change a user's nickname | Manage Nicknames |
| Command | Description |
|---|---|
/help |
Show main help menu with categories |
/help welcome |
Welcome system help |
/help roles |
Role management help |
/help info |
Information commands help |
/help moderation |
Moderation commands help |
/help verification |
Verification system help |
Use these placeholders in your custom welcome message:
| Placeholder | Description | Example Output |
|---|---|---|
{user} |
Mentions the new user | @Username |
{username} |
User's display name | Username |
{server} |
Server name | My Awesome Server |
{member_count} |
Total member count | 100 |
Example Custom Welcome Message:
Welcome {user} to {server}!
You are our {member_count}th member! We're excited to have you here.
Please read the rules
Pick your roles in #roles
Introduce yourself in #general
Enjoy your stay!
| Variable | Description | Default |
|---|---|---|
DISCORD_TOKEN |
Your bot token (required) | - |
BOT_PREFIX |
Prefix for text commands | ! |
OWNER_ID |
Bot owner's Discord ID | 0 |
DATABASE_PATH |
SQLite database location | data/bot_database.db |
LOG_LEVEL |
Logging level | INFO |
- Make sure the bot is online (check console for "Bot Online" message)
- Verify the bot token in
.envis correct - Ensure the bot has been invited to your server with proper permissions
- Check that the bot has permission to send messages in the channel
- Run
/setupand set a welcome channel - Verify the bot has "Send Messages" permission in the welcome channel
- Check the bot can see the welcome channel
- Ensure the bot's role is above the roles it's trying to assign (Server Settings → Roles → Drag bot role higher)
- Verify the bot has "Manage Roles" permission
- Check that the roles aren't managed by an integration (like Twitch/YouTube subs)
- Run
/verification_setupand enable verification - Set a verification role
- Ensure the bot can send DMs to users (or users have DMs enabled)
- Check the bot has permission to assign the verification role
- Wait up to 1 hour for Discord to sync commands (first time)
- Try kicking and re-inviting the bot
- Ensure you selected "applications.commands" when inviting
- Make sure the
data/folder exists and is writable - Check disk space availability
- Try deleting
data/bot_database.dbto reset (will lose saved data)
discord_welcome_bot/
bot.py # Main bot entry point
requirements.txt # Python dependencies
.env.example # Environment template
.gitignore # Git ignore file
README.md # This file
data/ # Database storage
bot_database.db # SQLite database (created on first run)
cogs/ # Bot modules
welcome.py # Welcome/leave system
verification.py # Member verification
roles.py # Role management
information.py # FAQs and info commands
moderation.py # Moderation tools
help_system.py # Help command
logging.py # Event logging
utils/ # Utilities
config.py # Configuration
database.py # Database handler
embeds.py # Embed templates