This repository hosts a suite of 4 automated Reddit bots:
The primary bot is AutoCrosspostBot.
It monitors Reddit comments across r/all and looks for comments that suggest a community matching the pattern:
/r/SomeOtherSubreddit or r/SomeOtherSubreddit
When a user suggests another subreddit (e.g. r/gatesopencomeonin in a r/wholesomememes thread):
- Phase 1: The bot saves the suggestion to a PostgreSQL database.
- Phase 2 (Aged Filter Check): After a waiting period (e.g. 2 hours), the bot batch-verifies via
reddit.info()that the comment is still available and meets the score threshold. - Phase 3 (Final Crosspost): After a maturation period (e.g. 3 months), the bot crossposts the original submission to the target subreddit with an explanatory localized reply.
u/sub_doesnt_exist_bot: Replies to comments that link to non-existent subreddits, searching Reddit's live community index for close matches or suggesting community creation.u/same_subreddit_bot: Replies to comments that link to the exact same subreddit where the comment was posted ("Yes, that's where we are.").u/same_post_bot: Replies to comments linking to a target subreddit that already has an existing post with the exact same content.
The easiest way to run the bot and PostgreSQL 24/7 (e.g. on a free Google Cloud e2-micro or Oracle Cloud VM) is using Docker Compose:
cd /opt
git clone https://github.com/Toldry/RedditAutoCrosspostBot.git
cd RedditAutoCrosspostBot
cp .env.example .env
# Edit .env with your Reddit account credentials and API secretsTip
You can create and manage your Reddit bot credentials (client IDs and client secrets) via the classic developer portal at old.reddit.com/prefs/apps.
docker compose up -d --builddocker compose logs -f botdocker compose down- Python 3.10+
- PostgreSQL 14+
# 1. Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt # Optional: for release management (bump-my-version)
# 2. Configure .env with your local DATABASE_URL
cp .env.example .env
# 3. Set PYTHONPATH and run the bot module
export PYTHONPATH=src # Linux/macOS
$env:PYTHONPATH="src" # Windows PowerShell
python -m racbReleases adhere to Semantic Versioning and are managed with bump-my-version:
bump-my-version bump patch # or minor / majorYou can run this bot 100% free on Google Cloud's Always Free e2-micro tier:
- Provision the VM using declarative flags:
gcloud compute instances create reddit-crosspost-bot --flags-file=deploy/instance-flags.yaml
- The VM will automatically execute
deploy/cloud-init.yamlon first boot, provisioning 2GB swap space, Docker, and Docker Compose. - See
AGENTS.mdfor architecture details.
If you like the bot, you're welcome to donate to help maintain and improve it:

