An intelligent Reddit commenting bot designed to help grow your karma responsibly. Features smart post filtering, rate limiting, and comprehensive safety measures to ensure compliance with Reddit's terms of service.
This bot is for educational purposes only. Users must:
- ✅ Follow Reddit's Terms of Service
- ✅ Respect individual subreddit rules
- ✅ Use responsibly with appropriate delays
- ✅ Post meaningful, relevant comments
- ❌ NOT use for spam or malicious purposes
Misuse of this bot may result in account suspension or banning.
- 🎯 Multi-subreddit targeting - Comment across multiple communities
- 🛡️ Built-in safety features - Rate limiting, duplicate detection, post filtering
- 🧠 Smart post selection - Avoids old posts, own posts, heavily commented posts
- 🎲 Random comment selection - Customizable comment templates
- 📊 Comprehensive logging - Track all bot activity
- 🧪 Dry-run mode - Test without posting actual comments
- 🎮 Interactive mode - Manual control and monitoring
- ⚡ Easy setup - Automated installation and configuration
- Python 3.7 or higher
- A Reddit account
- Reddit API credentials (free)
git clone https://github.com/yourusername/Reddit-Comment-Bot.git
cd Reddit-Comment-Botpip install -r requirements.txtOr use the automated setup:
chmod +x setup.sh
./setup.sh-
Go to Reddit Apps: Visit https://www.reddit.com/prefs/apps
-
Login: Sign in to your Reddit account
-
Create New App:
- Click "Create App" or "Create Another App"
- Fill in the form:
- Name:
MyRedditBot(or any name you prefer) - App type: Select "script"
⚠️ This is crucial! - Description: Optional
- About URL: Leave blank
- Redirect URI:
http://localhost:8080
- Name:
-
Submit: Click "Create app"
-
Get Your Credentials: After creation, you'll see:
┌─────────────────────────────────────┐ │ MyRedditBot │ │ personal use script by YourUsername │ │ │ │ AbCdEf12345678 ← CLIENT_ID │ │ secret: AbCdE...901 ← SECRET │ │ [edit] [delete] │ └─────────────────────────────────────┘
Copy the example environment file:
cp .env.example .envEdit .env with your credentials:
# Reddit API Credentials
REDDIT_CLIENT_ID=your_client_id_from_step_5
REDDIT_CLIENT_SECRET=your_client_secret_from_step_5
REDDIT_USER_AGENT=RedditBot/1.0 by YourUsername
REDDIT_USERNAME=your_reddit_username
REDDIT_PASSWORD=your_reddit_password
# Bot Configuration
MIN_DELAY=30
MAX_DELAY=120
MAX_COMMENTS_PER_SUBREDDIT=5Test your credentials:
python3 test_credentials.pyExpected output:
🔐 Reddit Credential Tester
========================================
✅ REDDIT_CLIENT_ID: AbCdEf12345678
✅ REDDIT_CLIENT_SECRET: ***************
✅ All credentials found! Testing connection...
🎉 SUCCESS! Connected as: YourUsername
Safe testing (recommended first):
# Dry run - no actual comments posted
python3 reddit_bot.py --dry-run --max-comments 2
# Interactive mode for manual control
python3 reddit_bot.py --interactiveLive operation (start small!):
# Start with just 3 comments
python3 reddit_bot.py --max-comments 3
# Normal operation
python3 reddit_bot.pypython3 reddit_bot.py [OPTIONS]
Options:
--dry-run Test without posting comments
--interactive Run in interactive mode
--max-comments N Limit total comments to N
--help Show help message# Target subreddits (without 'r/' prefix)
TARGET_SUBREDDITS = [
'AskReddit',
'funny',
'todayilearned',
# Add your preferred subreddits
]
# Comment behavior
COMMENT_BEHAVIOR = {
'max_retries': 3,
'avoid_own_posts': True,
'avoid_already_commented': True,
}
# Rate limiting
RATE_LIMITS = {
'min_delay': 30, # Minimum seconds between comments
'max_delay': 120, # Maximum seconds between comments
}Add one comment per line:
This is really interesting!
Great perspective on this topic.
Thanks for sharing this insight.
I learned something new today.
python3 utils.py --statspython3 utils.py --activitypython3 utils.py --backup- Rate Limiting: 30-120 second delays between comments
- Post Age Filter: Only comments on recent posts (< 24 hours)
- Duplicate Prevention: Tracks previously commented posts
- Own Post Avoidance: Never comments on your own posts
- Score Threshold: Only comments on posts with minimum upvotes
- Comment Limit: Maximum comments per subreddit per run
- Dry Run Mode: Test everything without posting
- Interactive Mode: Manual approval for each action
- Comprehensive Logging: Track all bot activity
- Easy Monitoring: View stats and recent activity
The bot creates detailed logs in bot.log:
2025-07-04 16:34:45,218 - RedditBot - INFO - ✅ Successfully connected as u/YourUsername
2025-07-04 16:34:45,835 - RedditBot - INFO - [DRY RUN] Would comment on 'Post Title...' in r/AskReddit
2025-07-04 16:34:45,835 - RedditBot - INFO - [DRY RUN] Comment: Great post! Thanks for sharing.
- INFO: Normal operations
- WARNING: Non-critical issues
- ERROR: Problems that need attention
Edit config.py:
TARGET_SUBREDDITS = [
'AskReddit',
'funny',
'YourFavoriteSubreddit', # Add here
]Edit comments.txt or modify COMMENT_TEMPLATES in config.py:
COMMENT_TEMPLATES = [
"Your custom comment here",
"Another thoughtful response",
"Engaging question or observation",
]RATE_LIMITS = {
'min_delay': 60, # Longer delays
'max_delay': 300,
}
POST_SELECTION = {
'min_score': 50, # Higher score threshold
'max_comments': 100, # Fewer comments limit
}RATE_LIMITS = {
'min_delay': 20, # Shorter delays
'max_delay': 60,
}
# ⚠️ Use with caution!❌ Failed to connect to Reddit: received 401 HTTP response
Solutions:
- ✅ Check username and password are correct
- ✅ Verify CLIENT_ID and CLIENT_SECRET
- ✅ Ensure app type is set to "script"
- ✅ Disable 2FA on Reddit account
❌ received 429 HTTP response
Solutions:
- ⏱️ Wait 10-15 minutes before trying again
- 📉 Increase delays in
config.py - 📊 Reduce comments per subreddit
⚠️ No suitable posts found in r/subreddit
Solutions:
- 📅 Check if posts are too old (adjust
max_age_hours) - 📊 Lower the
min_scorethreshold - 🎯 Try different subreddits
- Check the logs:
tail -f bot.log - Test credentials:
python3 test_credentials.py - Run diagnostics:
python3 utils.py --test - Use dry-run mode:
python3 reddit_bot.py --dry-run
- Start Small: Begin with 2-3 comments per session
- Quality Over Quantity: Use meaningful, relevant comments
- Monitor Response: Watch your karma and adjust if needed
- Respect Communities: Read and follow subreddit rules
- Regular Breaks: Don't run the bot continuously
✅ Good Comments:
- "This is really insightful, thanks for sharing!"
- "I never thought about it that way before."
- "Great explanation, very helpful!"
❌ Avoid:
- Generic responses like "Nice post"
- Completely irrelevant comments
- Promotional or spam content
Use cron for automated runs:
# Run every 2 hours with 3 comments max
0 */2 * * * cd /path/to/Reddit-Comment-Bot && python3 reddit_bot.py --max-comments 3Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
git clone https://github.com/yourusername/Reddit-Comment-Bot.git
cd Reddit-Comment-Bot
pip install -r requirements.txt
cp .env.example .env
# Configure your .env file
python3 test_credentials.pyThis project is licensed under the MIT License - see the LICENSE file for details.
This software is provided "as is" without warranty. Users are responsible for compliance with:
- Reddit's Terms of Service
- Individual subreddit rules
- Local laws and regulations
The authors are not responsible for any misuse or consequences of using this software.
- PRAW - Python Reddit API Wrapper
- Reddit API for providing the platform
- The open-source community for inspiration and tools
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Discussions
- 📖 Documentation: See QUICKSTART.md for rapid setup
Remember: Use this bot responsibly and always follow Reddit's community guidelines! 🤖✨