Files
Modreplybot/README.md
T

91 lines
2.1 KiB
Markdown
Raw Normal View History

2026-03-08 18:16:19 +00:00
# ModReplyBot Reddit Bot
2026-03-08 18:08:24 +00:00
2026-03-08 21:32:51 +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 local YAML file. All other settings are handled via environment variables.
2026-03-08 18:08:24 +00:00
## Features
- Watches for moderator reports with triggers
- Approves posts and leaves stickied comments
2026-03-08 21:32:51 +00:00
- Triggers/comments configured via config/config.yaml
2026-03-08 18:08:24 +00:00
- Supports multiple triggers/comments
- Docker and baremetal support
## Configuration
2026-03-08 21:32:51 +00:00
### 1. Trigger and Comment Configuration
Edit the file at `config/config.yaml` in your project directory. 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.
```
2026-03-08 21:32:51 +00:00
Each entry under `triggers` defines a trigger and its associated multi-line comment. The bot will automatically create this file with example content if it does not exist.
2026-03-08 18:08:24 +00:00
### 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
```
## 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