2026-03-08 18:16:19 +00:00
# ModReplyBot Reddit Bot
2026-03-08 18:08:24 +00:00
This bot watches a subreddit for moderator reports containing triggers, approves posts, and leaves stickied comments. Triggers and comments are configured via a subreddit wiki page. All other settings are handled via environment variables.
## Features
- Watches for moderator reports with triggers
- Approves posts and leaves stickied comments
- Triggers/comments configured via subreddit wiki
- Supports multiple triggers/comments
- Docker and baremetal support
## Configuration
### 1. Subreddit Wiki Page
2026-03-08 18:16:19 +00:00
Create a wiki page (e.g. `modreplybot-config` ) in your subreddit using Automoderator YAML format. Example:
2026-03-08 18:08:24 +00:00
```
triggers:
- trigger: help
comment: |
Thank you for your report!
This post is now approved.
- trigger: question
comment: |
This post has been approved.
Your question will be answered soon.
```
Each entry under `triggers` defines a trigger and its associated multi-line comment.
### 2. Environment Variables
Create a `.env` file (or set env variables directly) with:
```
REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_client_secret
REDDIT_USERNAME=your_username
REDDIT_PASSWORD=your_password
2026-03-08 18:16:19 +00:00
REDDIT_USER_AGENT=modreplybot by /u/your_username
2026-03-08 18:08:24 +00:00
REDDIT_SUBREDDIT=your_subreddit
2026-03-08 18:16:19 +00:00
REDDIT_WIKI_PAGE=modreplybot-config
2026-03-08 18:08:24 +00:00
```
## Installation
### Docker Compose (Recommended)
1. Copy `.env.example` to `.env` and fill in your values.
2. Run:
```
docker compose up -d
```
### Docker Run
1. Copy `.env.example` to `.env` and fill in your values.
2. Run:
```
docker run --env-file .env slfhstd.uk/slfhstd/modreplybot:latest
```
### Baremetal (Direct Python)
1. Install Python 3.11+
2. Install dependencies:
```
pip install -r requirements.txt
```
3. Set environment variables or create a `.env` file.
4. Run:
```
python modbot.py
```
## Building the Docker Image
If you want to build your own image:
```
docker build -t modreplybot .
```
## Troubleshooting
- Ensure your Reddit credentials are correct and have moderator permissions.
- The bot must be able to read the wiki page and approve posts.
- Check logs for errors.
## License
MIT