Discord Welcome Bot

Test this app for free
25
import os
import discord
from discord import app_commands
from abilities import apply_sqlite_migrations
from sqlalchemy.orm import Session as SQLAlchemySession

from models import Base, engine, Session, GuildSettings

def generate_oauth_link(client_id):
    base_url = "https://discord.com/api/oauth2/authorize"
    redirect_uri = "http://localhost"
    scope = "bot"
    permissions = "8"  # Administrator permission for simplicity, adjust as needed.
    return f"{base_url}?client_id={client_id}&permissions={permissions}&scope={scope}"

intents = discord.Intents.default()
intents.messages = True
intents.message_content = True
intents.members = True  # Enable member events

bot = discord.Client(intents=intents, activity=discord.CustomActivity("Example Activity"))
tree = app_commands.CommandTree(bot)

@bot.event
Get full code

Created: | Last Updated:

Discord bot that welcomes new members and notifies channels when streaming live on YouTube.

Discord Welcome Bot Template Guide

This template creates a Discord bot that welcomes new members to your server with customizable welcome messages in a designated channel.

Getting Started

  • Click "Start with this Template" to begin using the Discord Welcome Bot template

Initial Setup

You'll need to create a Discord bot and get the required credentials:

  • Go to the Discord Developer Portal (https://discord.com/developers/applications)
  • Create a new application
  • Navigate to the "Bot" section
  • Click "Add Bot" and confirm
  • Under the "TOKEN" section, click "Copy" to get your BOT_TOKEN
  • Go to the "OAuth2" section and copy your CLIENT_ID
  • Enable the "Message Content Intent" slider under the Bot section

Add these credentials in the Environment Secrets tab: * BOT_TOKEN * CLIENT_ID

Test the Bot

  • Click the "Test" button to start the deployment
  • The CLI will provide an OAuth link to invite your bot to your Discord server
  • Click the link and select the server where you want to add the bot
  • Grant the necessary permissions

Using the Bot

The bot provides two main commands:

  • /set-welcome-channel - Set the channel where welcome messages will appear (requires "Manage Server" permission)
  • /echo - Makes the bot echo back any message you send

When new members join your server, the bot will automatically send a welcome message in the designated welcome channel.

Example welcome message: 🎉 Welcome @username to ServerName! 🎉 We're excited to have you here! Feel free to introduce yourself and make yourself at home! 🏠

That's it! Your Discord Welcome Bot is now ready to greet new members in your server.



Template Benefits

  1. Enhanced User Engagement & Retention
  2. Automatically welcomes new members with customized messages
  3. Creates an immediate positive first impression
  4. Helps maintain active community participation
  5. Reduces member drop-off rates through immediate engagement

  6. Streamlined Community Management

  7. Automates welcome processes, saving moderator time
  8. Configurable welcome channels through simple commands
  9. Reduces manual moderation workload
  10. Ensures consistent greeting experience for all new members

  11. Database-Driven Customization

  12. Stores guild-specific settings in SQLite database
  13. Allows for scalable server-specific configurations
  14. Enables data-driven decision making
  15. Maintains settings persistence across bot restarts

  16. Professional Server Appearance

  17. Creates a more professional and organized server environment
  18. Demonstrates active community management
  19. Enhances server credibility
  20. Improves overall user experience

  21. Easy Integration & Setup

  22. Simple OAuth2 implementation for quick bot installation
  23. Clear error handling and setup instructions
  24. Minimal configuration requirements
  25. Secure token management through environment variables

Technologies