A powerful Discord bot that leverages AWS Rekognition's advanced computer vision capabilities to provide comprehensive image analysis, face detection, text extraction, celebrity recognition, content moderation, and face comparison directly within Discord servers.
Especially useful for organizations like Trace Labs and other OSINT communities, this bot streamlines image intelligence gathering and analysis, aiding in missing person investigations and real-time collaborative efforts.
Click to expand
- Object & Scene Detection: Identify thousands of objects, scenes, and concepts
- Text Extraction (OCR): Extract text from images with high accuracy
- Face Analysis: Detect faces with demographics, emotions, and facial attributes
- Celebrity Recognition: Identify famous people in images
- Content Moderation: Automatically detect inappropriate content
- Face Comparison: Compare faces between two images with similarity scoring
- Batch Processing: Analyze multiple features simultaneously
- High Accuracy: Powered by AWS's machine learning models
- Detailed Reports: Export comprehensive JSON analysis reports
- Image Support: Works with URLs and uploaded images (JPEG, PNG)
- Real-time Processing: Fast analysis with progress indicators
- Error Handling: Robust error management with user-friendly messages
- Slash Commands: Modern Discord interface with autocomplete
- Visual Results: Rich embeds with thumbnails and organized data
- File Attachments: Detailed JSON reports for further analysis
- Progress Updates: Real-time status updates during processing
- Smart Validation: Input validation and helpful error messages
Perform comprehensive image analysis with multiple AI features.
Options:
url(optional): Direct image URL to analyzeimage(optional): Upload an image file to analyzefeatures(optional): Specific features to analyze
Available Features:
- All Features (Recommended): Run complete analysis
- Labels & Objects: Detect objects, scenes, and concepts
- Text Detection (OCR): Extract text from images
- Face Analysis: Analyze faces, emotions, and demographics
- Content Moderation: Check for inappropriate content
- Celebrity Recognition: Identify famous people
Example:
/rekognition analyze image:[upload] features:All Features
/rekognition analyze url:https://example.com/image.jpg features:Face Analysis
Compare faces between two images with similarity scoring.
Options:
source_url/source_image: Reference image with the face to matchtarget_url/target_image: Image to search for matching facessimilarity(optional): Minimum similarity threshold (0-100, default: 80)
Example:
/rekognition compare source_image:[upload1] target_image:[upload2] similarity:75
/rekognition compare source_url:https://example.com/face1.jpg target_url:https://example.com/face2.jpg
- Node.js v16.9.0 or higher
- Discord Application and bot token
- AWS Account with Rekognition access
- AWS IAM User with appropriate permissions
git clone https://github.com/gl0bal01/discord-amazon-rekognition.git
cd discord-amazon-rekognitionnpm installcp .env.example .envEdit .env with your configuration:
# Discord Configuration
DISCORD_TOKEN=your_discord_bot_token_here
CLIENT_ID=your_discord_application_client_id_here
GUILD_ID=your_development_server_id_here
# AWS Configuration
AWS_ACCESS_KEY_ID=your_aws_access_key_id_here
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key_here
AWS_REGION=us-east-1Sign up at aws.amazon.com if you don't have an account.
- Go to IAM Console β Users β Create User
- Choose "Programmatic access"
- Create or attach a policy with these permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rekognition:DetectLabels",
"rekognition:DetectText",
"rekognition:DetectFaces",
"rekognition:DetectModerationLabels",
"rekognition:RecognizeCelebrities",
"rekognition:CompareFaces"
],
"Resource": "*"
}
]
}- Copy the Access Key ID and Secret Access Key
- Add them to your
.envfile
Select the region closest to your users:
us-east-1(N. Virginia) - Defaultus-west-2(Oregon)eu-west-1(Ireland)ap-southeast-1(Singapore)
- Go to Discord Developer Portal
- Click "New Application" and name your bot
- Go to "Bot" section and create a bot
- Copy the Bot Token to your
.envfile
- In the "General Information" section
- Copy the Application ID (this is your Client ID)
Your bot needs these permissions:
Send Messages(2048)Use Slash Commands(2147483648)Attach Files(32768)Embed Links(16384)
Permission Integer: 2147516160
# Development (instant deployment to test server)
npm run deploy
# Production (global deployment - takes up to 1 hour)
npm run deploy:global# Production
npm start
# Development with auto-restart
npm run devLook for these startup messages:
β
Loaded command: rekognition
π Created temporary files directory
π― Discord Amazon Rekognition Bot is ready!
π Logged in as: YourBotName#1234
Use this URL to invite your bot (replace YOUR_CLIENT_ID):
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=2147516160&scope=bot%20applications.commands
Required Permissions:
- Send Messages: Respond to commands
- Use Slash Commands: Register slash commands
- Attach Files: Send analysis reports and images
- Embed Links: Display rich result embeds
discord-amazon-rekognition/
βββ commands/
β βββ rekognition.js # Main Rekognition command
βββ temp/ # Temporary file storage
βββ .env.example # Environment variables template
βββ .gitignore # Git ignore rules
βββ deploy-commands.js # Command deployment script
βββ index.js # Main bot application
βββ LICENSE # MIT license
βββ package.json # Dependencies and scripts
βββ README.md # This documentation
/rekognition analyze
π Upload: family_photo.jpg
π― Features: All Features
Results:
- Objects: Person (99.5%), Clothing (95.2%), Smile (87.1%)
- Text: "Happy Birthday!" extracted from banner
- Faces: 3 faces detected with age ranges and emotions
- JSON Report: Detailed technical analysis attached
/rekognition compare
π Source: person1.jpg
π Target: group_photo.jpg
π Similarity: 75%
Results:
- Match Found: 89.2% similarity detected
- Additional Faces: 4 unmatched faces in target image
- Comparison Report: Detailed matching data
/rekognition analyze
π URL: https://example.com/document.jpg
π― Features: Text Detection (OCR)
Results:
- Extracted Text: All readable text from the image
- Confidence Scores: Accuracy ratings for each text element
- Bounding Boxes: Location data in JSON report
| Metric | Value |
|---|---|
| Analysis Speed | 2-5 seconds per image |
| Supported Formats | JPEG, PNG |
| Max Image Size | 5MB (JPEG), 8MB (PNG) |
| Accuracy Rate | 95%+ for most features |
| Concurrent Users | Unlimited |
| Uptime | 99.9% |
Solution:
- Verify
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYare in.env - Check that credentials are valid
- Ensure IAM user has Rekognition permissions
Solution:
- Use JPEG or PNG format only
- Ensure image file is not corrupted
- Check image size limits (5MB JPEG, 8MB PNG)
Solution:
- Ensure faces are clearly visible and well-lit
- Use higher resolution images
- Avoid heavily obscured or profile faces
Solution:
- Run
npm run deployto update commands - Check
CLIENT_IDis correct in.env - Wait up to 1 hour for global command deployment
Enable detailed logging:
NODE_ENV=developmentMonitor your usage at AWS Billing Console:
- Free Tier: 5,000 images/month for first 12 months
- Standard Pricing: $1-5 per 1,000 images (varies by feature)
- Rate Limits: 50 TPS (transactions per second)
- Image Size: 5MB JPEG, 8MB PNG
- Image Resolution: Minimum 80 pixels for face detection
- Concurrent Requests: 50 per account
- Message Size: 2000 characters
- File Upload: 25MB (Discord Nitro: 100MB)
- Embeds: 25 fields per embed
- No Image Storage: Images are processed and immediately deleted
- Temporary Files: Auto-cleanup after 60 seconds
- AWS Security: All data encrypted in transit and at rest
- No Logging: Personal image data is never logged
- Store AWS credentials securely
- Use IAM roles with minimal permissions
- Regularly rotate access keys
- Monitor AWS CloudTrail logs
- Keep dependencies updated
The bot includes automatic content moderation features to detect:
- Explicit content
- Suggestive content
- Violence
- Visually disturbing content
- Fork the repository
- Create a feature branch
- Implement your changes
- Add appropriate error handling
- Update documentation
- Submit a pull request
This bot uses AWS SDK v3 for better performance:
const { RekognitionClient, DetectLabelsCommand } = require('@aws-sdk/client-rekognition');
const client = new RekognitionClient({ region: 'us-east-1' });
const command = new DetectLabelsCommand(params);
const response = await client.send(command);Test with various image types:
- Different resolutions
- Various lighting conditions
- Multiple faces
- Text-heavy images
- Different file formats
| Resource | Link |
|---|---|
| π AWS Rekognition Docs | AWS Documentation |
| π Report Bug | GitHub Issues |
| β¨ Request Feature | Feature Request |
| π¬ Discord Support | Join Server |
| π§ AWS Console | AWS Management Console |
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Create an issue for bug reports
- Join our Discord server for support
- Check AWS Rekognition documentation for API questions
- Review Discord.js guide for bot development help
- AWS Rekognition - Powerful computer vision service
- Discord.js - Excellent Discord API library
- Discord Developer Portal - Bot development platform
- AWS SDK for JavaScript - Official AWS SDK



