A comprehensive Discord bot demonstrating the revolutionary Discord Components V2 system. This demo showcases how to build modern, interactive Discord applications using the latest Discord.js features and Components V2 architecture.
Discord Components V2 is the next generation of Discord's component system, offering:
- Rich Text Displays - Up to 4000 characters with full markdown support
- Advanced Layouts - Sections, containers, and media galleries
- Interactive Elements - Buttons, select menus, and file attachments
- Modern Design - Clean, organized, and visually appealing interfaces
This version demonstrates ALL Discord Components V2 features using the proper Discord.js builders, brought to you by AuthGuards.
- πΉ TextDisplay - Static text with markdown support (up to 4000 characters)
- π Separator - Visual dividers with spacing options
- π Section - Groups text with accessories (thumbnails, buttons)
- πΌοΈ Thumbnail - Small images in sections
- πΊ ChannelSelectMenu - Dropdown for channel selection
- πΌοΈ MediaGallery - Image carousels/galleries (up to 10 images)
- π Button - Interactive elements (links and actions)
- π File - Attached files (JSON, images, etc.)
- π¦ Container - Groups multiple components with accent colors
- Channel Selection - Shows selected channel info with Components V2
- Support Button - Displays AuthGuards help information using Components V2
- File Download - AuthGuards demo JSON file attachment
- Link Buttons - Direct links to AuthGuards.com and Discord server
git clone https://github.com/authguards/discord-v2-demo.git
cd discord-v2-demonpm installEdit the configuration in index.js and deploy-commands.js:
const config = {
token: 'YOUR_BOT_TOKEN_HERE',
clientId: 'YOUR_CLIENT_ID_HERE',
guildId: 'YOUR_GUILD_ID_HERE' // Optional, for testing
};npm run deploynpm start- Use
/democommand in your Discord server - See all Components V2 features in action!
/demo- Comprehensive Components V2 demonstration with AuthGuards branding
- Go to Discord Developer Portal
- Click "New Application"
- Give your application a name (e.g., "AuthGuards V2 Demo")
- Click "Create"
- In your application, go to "General Information"
- Copy the "Application ID" - this is your
DISCORD_CLIENT_ID
- Go to the "Bot" section in your application
- Click "Add Bot"
- Copy the bot token - this is your
DISCORD_BOT_TOKEN - Important: Keep this token secret!
- Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode)
- Right-click on your server name
- Click "Copy ID" - this is your
DISCORD_GUILD_ID
- Go to "OAuth2" > "URL Generator"
- Select "bot" and "applications.commands" scopes
- Select these permissions:
- Send Messages
- Use Slash Commands
- Embed Links
- Attach Files
- Read Message History
- Copy the generated URL and invite the bot to your server
const message = {
content: 'Your message content',
flags: MessageFlags.IsComponentsV2, // Enable Components V2
components: [
// Component array here
]
};- Type 9: Sections (text with optional accessories)
- Type 10: Text Displays (markdown text)
- Type 11: Thumbnails (small images)
- Type 12: Media Galleries (image collections)
- Type 14: Separators (spacing elements)
This demo version shows the complete implementation of Discord's Components V2 system with AuthGuards branding:
- π‘οΈ AuthGuards Branding - Custom colors, links, and styling
- Proper Builders - Uses official Discord.js Components V2 builders
- Real Examples - Every component type with practical examples
- Interactive Design - Buttons and select menus that actually work
- File Attachments - Dynamic AuthGuards demo file generation
- Rich Layout - Container with AuthGuards accent colors and organized structure
- Comprehensive Guide - Built-in documentation explaining each component
- Website: https://authguards.com
- Discord Server: https://discord.authguards.com
- GitHub: https://github.com/authguards
This demo is based on official Discord documentation and best practices:
- Discord Components V2 Overview
- Message.style Components V2 Guide
- Discord.js Documentation
- Discord Developer Portal
We welcome contributions to improve this demo! Here's how you can help:
- 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
- Add new Components V2 examples
- Improve existing functionality
- Fix bugs or issues
- Add new interactive features
- Enhance documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- Components V2 is still experimental and may have limitations
- Discord.js v14.14.1+ is required for full functionality
- Test thoroughly in a development server before production deployment
- Rate Limits - Be aware of Discord's API restrictions
-
Bot not responding to commands
- Check bot permissions in your server
- Verify the bot token is correct
- Ensure the bot is online
-
Components not displaying
- Verify
MessageFlags.IsComponentsV2is set - Check Discord.js version (14.14.1+ required)
- Ensure proper component structure
- Verify
-
Commands not registering
- Run
npm run deployto register commands - Check client ID and bot token
- Verify bot has
applications.commandsscope
- Run
- Discord Support: https://discord.authguards.com
- GitHub Issues: Create an issue
- Documentation: https://authguards.com
- Discord Team - For creating the amazing Components V2 system
- Discord.js Team - For the excellent library and documentation
- AuthGuards Community - For feedback and support
π‘οΈ Built with β€οΈ by AuthGuards
Website β’ Discord β’ GitHub
Ready to build the future of Discord applications? Start with this demo!
