Discord Multimedia Bot
A powerful Discord bot that can send messages and search for multimedia files on Google with enhanced display capabilities.
Features
- 🏓 Ping Command - Simple ping command to check if the bot is working
- 📨 Message Sending - Send messages to any channel in the server
- 🔍 Multimedia Search - Search for images and videos with embedded preview
- 📈 Google Trends - Show current trending topics by country with grouped articles
- ⬇️ File Download - Download and share multimedia files directly in Discord
- 🟠 Bitcoin Monitor - Real-time Bitcoin transaction monitoring
- 🚪 Channel Access - Join and send messages to specific Discord channels by ID
- 🎫 Bot Invitation - Generate invitation links to add the bot to other servers
Installation
- Clone this repository
- Install dependencies:
npm install - Create a
.envfile with your bot token:DISCORD_TOKEN=your_token_here - Run the bot:
node index.js
Commands
🏓 Ping
/ping
Simple response to check if the bot is online.
📨 Send Message
/send channel:#channel-name message:Your message here
Sends a message to the specified channel.
channel: The target channel (required)message: The message content (required)
🔍 Search Media
/search query:cute puppies type:image count:3
Searches for multimedia content on Google with enhanced display.
query: What to search for (required)type: Either "image" or "video" (required)count: Number of results to show (1-5, default: 3)
Image Search Features:
- Displays images directly in Discord with embeds
- Shows content type information
- Validates image URLs before displaying
- Supports JPG, PNG, GIF, and WebP formats
Video Search Features:
- Creates rich embeds with video information
- Shows YouTube video thumbnails automatically
- Includes video descriptions when available
- Supports YouTube, Vimeo, and direct video files
📈 Trending Topics
/trends country:ES
Shows current trending topics from Reddit's popular posts.
country: Country code (US, ES, GB, FR, DE, JP, BR, or Global) (optional, default: US)
Trends Features:
- Source: Reddit trending posts from r/popular
- Posts grouped by subreddit
- Rich embeds with clickable links to discussions
- Real-time upvote metrics and engagement data
- Direct links to Reddit discussions
⬇️ Download Files
/download url:https://example.com/image.jpg title:My Image
Downloads and shares multimedia files directly in Discord.
url: Direct URL to the multimedia file (required)title: Optional title for the file (optional)
Download Features:
- Validates multimedia URLs before downloading
- Checks file size (8MB Discord limit)
- Supports images, videos, and audio files
- Automatically cleans up temporary files
- Shows file information in rich embeds
🚪 Join Channel
/join-channel channel-id:768329192131526686 message:Hello from bot!
Makes the bot access and send a message to a specific Discord channel.
channel-id: Discord channel ID (optional, defaults to your specified channel)message: Custom message to send (optional)
Join Channel Features:
- Access channels by ID across different servers
- Automatic permission checking
- Rich embed with connection information
- Error handling for invalid channels or permissions
- Supports any text-based Discord channel
🎫 Bot Invitation
/invite permissions:basic
Generates an invitation link to add this bot to Discord servers.
permissions: Permission level (basic, moderate, admin) (optional, default: basic)
Invitation Features:
- Automatic invitation link generation
- Multiple permission levels
- Direct Discord authorization link
- Bot information display
- Easy server integration
Security Features
- ✅ Environment variables for token security
- ✅ URL validation for multimedia content
- ✅ File size checking
- ✅ Temporary file cleanup
- ✅ Error handling and user feedback
Supported File Types
Images: JPG, JPEG, PNG, GIF, WebP, BMP, SVG Videos: MP4, WebM, MOV, AVI, MKV, FLV Audio: MP3, WAV, OGG, M4A, AAC, FLAC
Technical Implementation
- dotenv for secure environment variable management
- Enhanced fetch with proper headers and error handling
- Discord.js v14 with modern slash commands
- Google-it for search functionality
- Stream pipeline for efficient file downloads
- Rich embeds for multimedia display
Security Note
⚠️ Important: Keep your bot token private and never commit it to a public repository. Always use environment variables for sensitive data.
Error Handling
The bot includes comprehensive error handling for:
- Invalid URLs
- Network timeouts
- File size limitations
- Permission errors
- API rate limits
Performance Features
- Efficient file streaming for downloads
- Automatic temporary file cleanup
- URL validation before processing
- Content type verification
- Background processing for long operations