A comprehensive Discord bot template with CAPTCHA verification, advanced ticket system, and anti-advertising protection. Perfect starter for your Discord server!
Created by AlexM π
- Visual CAPTCHA generation for new members
- Automatic role assignment after successful verification
- Smart cleanup system that removes CAPTCHA messages when users leave
- Configurable timeout (10 minutes) with automatic kick
- 3-attempt limit with kick on failure
- Real-time detection of Discord invite links
- Message editing protection - catches ads added via message edits
- Whitelist system for allowed server invites
- Automatic timeout for violators (5 minutes)
- Smart regex patterns for comprehensive detection
- 6 ticket categories: Technical Support, General Help, Suggestions, Reports, Partnerships, Other
- Transcript generation with multiple fallback services (paste.ee, dpaste)
- Direct message notifications with transcript links when tickets close
- Professional embed interface with buttons and modals
- Staff role pinging for immediate attention
- 20+ funny welcome messages with random selection
- Rich embeds with user avatar, join date, and member count
- User mention integration for personal touch
- Separate welcome channel from CAPTCHA verification
- Automatic member counting and statistics
- Dynamic command/event loading from filesystem
- Professional
/botinfocommand with detailed statistics - Comprehensive error handling and logging
- TypeScript-first development with full type safety
/ban- Ban members with reason logging/kick- Kick members with reason logging/help- Dynamic help system with all commands/ping- Latency testing/botinfo- Detailed bot statistics and information
- Node.js 18.0.0 or higher
- npm package manager
- A Discord Application created at Discord Developer Portal
-
Clone the repository
git clone https://github.com/ThisDudeBoy/discord-bot-template-advanced.git cd discord-bot-template-advanced -
Install dependencies
npm install
-
Environment Configuration
Create a
.envfile with your Discord bot credentials:# Discord Configuration DISCORD_TOKEN=your_bot_token_here CLIENT_ID=your_application_id_here GUILD_ID=your_guild_id_for_testing # Channel Configuration WELCOME_CHANNEL_ID=your_welcome_channel_id CAPTCHA_CHANNEL_ID=your_captcha_channel_id VERIFIED_ROLE_ID=your_verified_role_id TICKET_CATEGORY_ID=your_ticket_category_id LOG_CHANNEL_ID=your_log_channel_id STAFF_ROLE_ID=your_staff_role_id # Environment NODE_ENV=production
-
Deploy slash commands
npm run deploy
-
Start the bot
# Production npm run start:dev # Development with auto-reload npm run dev
discord-bot-template-advanced/
βββ π src/
β βββ π commands/ # Slash commands (auto-loaded)
β β βββ π general/ # General commands
β β β βββ help.ts # Dynamic help system
β β β βββ ping.ts # Latency testing
β β β βββ botinfo.ts # Bot statistics
β β βββ π moderation/ # Moderation commands
β β βββ ban.ts # Ban command with logging
β β βββ kick.ts # Kick command with logging
β βββ π events/ # Discord events (auto-loaded)
β β βββ ready.ts # Bot ready event
β β βββ guildMemberAdd.ts # CAPTCHA system
β β βββ guildMemberRemove.ts # CAPTCHA cleanup
β β βββ interactionCreate.ts # Commands, buttons, modals
β β βββ messageCreate.ts # Anti-advertising (new messages)
β β βββ messageUpdate.ts # Anti-advertising (message edits)
β βββ π utils/ # Utility functions
β β βββ captcha.ts # CAPTCHA generation with Canvas
β β βββ captchaManager.ts # Session management
β β βββ config.ts # Bot configuration
β β βββ embeds.ts # Reusable embed builders
β βββ π types/ # TypeScript definitions
β β βββ index.ts # Interface definitions
β βββ index.ts # Main bot entry point
βββ π package.json # Dependencies and scripts
βββ π tsconfig.json # TypeScript configuration
βββ π README.md # This file
- TypeScript - Type-safe JavaScript development
- Discord.js v14 - Modern Discord API wrapper
- Node.js - JavaScript runtime environment
- Canvas - CAPTCHA image generation
- Axios - HTTP client for transcript uploads
- Chalk - Terminal styling for logs
Replace the IDs in your .env file with your server's specific channel IDs:
# Welcome messages channel (where funny welcome messages are sent)
WELCOME_CHANNEL_ID=your_welcome_channel_id
# CAPTCHA verification channel (where new members get CAPTCHA)
CAPTCHA_CHANNEL_ID=your_captcha_channel_id
# Role given after successful CAPTCHA completion
VERIFIED_ROLE_ID=your_verified_role_id
# Ticket category (where ticket channels are created)
TICKET_CATEGORY_ID=your_ticket_category_id
# Staff role (gets pinged for new tickets)
STAFF_ROLE_ID=your_staff_role_idEdit src/events/messageCreate.ts to add allowed Discord servers:
const allowedInvites = [
'discord.gg/your-server-invite', // Add your server invites here
];npm run start:dev # Run with tsx (TypeScript execution)
npm run dev # Run with auto-reload on file changesnpm run build # Compile TypeScript to JavaScript
npm start # Run compiled JavaScriptWant to contribute? Awesome! Here's how:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Use TypeScript for all new code
- Follow existing code style and patterns
- Add JSDoc comments for functions
- Test thoroughly before submitting PRs
- β CAPTCHA verification system with visual challenges
- β Advanced ticket system with 6 categories and transcripts
- β Anti-advertising protection with regex detection
- β Dynamic command/event loading from filesystem
- β Professional embed interfaces throughout
- β TypeScript-first development with full type safety
- β Comprehensive error handling and logging
Currently no known issues! π
If you find any bugs, please create an issue.
Need help? Here are your options:
- π Read the documentation (this README)
- π Check existing issues on GitHub
- π Create a new issue if needed
- π¬ Join our Discord for live support: https://discord.gg/q6T3bX2ZFG
This project is licensed under the MIT License - see the LICENSE file for details.
This bot is provided "as is" without warranty. Use at your own risk and ensure compliance with Discord's Terms of Service.
- Discord.js Team for the amazing library
- Canvas contributors for CAPTCHA generation capabilities
- TypeScript Team for type safety
- The Discord Bot community for inspiration and best practices
Made with β€οΈ by AlexM
β Star this repo if it helped you! β