Skip to content

perashanid/discord-welcome-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Welcome Bot

A comprehensive Discord bot designed to welcome new users, manage roles, provide server information, and offer moderation tools. Perfect for community servers!

Features

Welcome System

  • Customizable welcome messages with placeholders
  • Automatic welcome DMs to new members
  • Leave message notifications
  • Auto-role assignment for new members
  • Interactive setup with /setup

Verification System

  • DM-based verification codes
  • Button verification for ease of use
  • Manual verification by moderators
  • Verification role assignment
  • Configurable verification settings

Role Management

  • 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

ℹ Information System

  • FAQ system with categories
  • Server information command
  • User information with detailed stats
  • Avatar and banner display
  • Custom commands for quick responses

Moderation Tools

  • Warning system with database tracking
  • Timeout/mute functionality
  • Kick and ban commands
  • Message purging
  • Channel lock/unlock
  • Slowmode management
  • Comprehensive logging

Logging

  • Message edit and delete tracking
  • Member join/leave logging
  • Role changes
  • Voice channel activity
  • Nickname changes
  • Avatar updates
  • Invite tracking

Quick Start Guide

Prerequisites

  • Python 3.8 or higher
  • A Discord account
  • A Discord server where you have admin permissions

Detailed Setup Instructions

Step 1: Create a Discord Bot Application

  1. Go to Discord Developer Portal
  2. Click "New Application" (top right corner)
  3. Enter a name for your bot (e.g., "Welcome Bot")
  4. Click "Create"
  5. (Optional) Add a description and avatar in the "General Information" section

Step 2: Configure Bot Settings

  1. In the left sidebar, click "Bot"
  2. Click "Add Bot" and confirm
  3. 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
  4. Click "Save Changes"
  5. Under "Token", click "Reset Token" then "Copy" (save this somewhere safe!)

Step 3: Invite Bot to Your Server

  1. In the left sidebar, click "OAuth2""URL Generator"

  2. Under "Scopes", select:

    • bot
    • applications.commands
  3. 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
  4. Copy the generated URL at the bottom

  5. Paste the URL in your browser

  6. Select your server from the dropdown

  7. Click "Authorize"

  8. Complete the CAPTCHA

Step 4: Install Python Dependencies

  1. Open a terminal/command prompt
  2. Navigate to the bot folder:
    cd discord_welcome_bot
  3. Install required packages:
    pip install -r requirements.txt

Step 5: Configure Environment Variables

  1. Copy the example environment file:

    • Windows: copy .env.example .env
    • Mac/Linux: cp .env.example .env
  2. Open .env in 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"

Step 6: Run the Bot

python bot.py

You should see output like:

==================================================
 Bot Online: YourBotName
 Bot ID: 123456789012345678
 Guilds: 1
 Users: 50
⏰ Started at: 2026-02-01 12:00:00 UTC
==================================================

Bot Configuration

Initial Server Setup

Once the bot is running and in your server, use these commands to configure it:

1. Run the Setup Wizard

/setup

This interactive wizard helps you configure:

  • Welcome channel
  • Rules channel
  • Help channel
  • Log channel
  • Auto-role

2. Set Up Verification (Optional)

/verification_setup

Configure member verification:

  • Enable/disable verification
  • Set verification role

3. Create Role Menus

/create_role_menu

Create self-assignable role menus for your members.

4. Add FAQs

/faq_add

Add frequently asked questions for new members.


Commands Reference

Welcome Commands

Command Description Permission
/setup Interactive setup wizard Administrator
/welcome_message Set custom welcome message Manage Server
/test_welcome Preview welcome message Manage Server

Verification Commands

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

Role Commands

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

ℹ Information Commands

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

Moderation Commands

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

Help Commands

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

Customization Guide

Welcome Message Placeholders

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!

Environment Variables

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

Troubleshooting

Bot doesn't respond to commands

  • Make sure the bot is online (check console for "Bot Online" message)
  • Verify the bot token in .env is 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

Welcome messages not sending

  • Run /setup and set a welcome channel
  • Verify the bot has "Send Messages" permission in the welcome channel
  • Check the bot can see the welcome channel

Role menus not working

  • 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)

Verification not working

  • Run /verification_setup and 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

Slash commands not appearing

  • 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

Database errors

  • Make sure the data/ folder exists and is writable
  • Check disk space availability
  • Try deleting data/bot_database.db to reset (will lose saved data)

Project Structure

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages