formatting fixes

This commit is contained in:
2026-03-10 22:36:57 +00:00
parent 00cebd44dc
commit ca0f165257
+45 -67
View File
@@ -15,34 +15,12 @@ ModReplyBot is a Reddit bot for moderators that automates post approval and stic
## Configuration ## Configuration
### 1. Wiki Page Configuration ### 1. Wiki Page Configuration
Edit your subreddit wiki page (name set by `REDDIT_WIKI_PAGE` env variable) with YAML like: Edit your subreddit wiki page (name set by `REDDIT_WIKI_PAGE` env variable) with YAML like:
``` ```yaml
triggers: triggers:
- trigger: help
# ModReplyBot
ModReplyBot is a Reddit bot for moderators that automates post actions and stickied comments based on subreddit wiki configuration. It responds to mod comments and mod reports containing trigger phrases, auto-comments on posts with configured tags, and now supports chat-based config reloads. All configuration is managed via a subreddit wiki page and environment variables.
## Features
- Responds to moderator comments containing trigger phrases (starting with `!`)
- Responds to moderator reports containing trigger phrases (starting with `!`)
- Sets post flair, locks posts/comments, and posts stickied comments
- Posts automatic comments based on tags in post titles (e.g., `[Bedrock]`, `[Java]`)
- Triggers, tag comments, and bot config are managed via a subreddit wiki page
- Chat-based config reload: send a chat message containing `reload-config` to the bot from a moderator account to reload the wiki config
- Persistent database for auto-commented posts and processed chat requests (survives restarts and container recreations)
- Docker and baremetal support
## Configuration
### 1. Wiki Page Configuration
Edit your subreddit wiki page (name set by `REDDIT_WIKI_PAGE` env variable) with YAML like:
```
triggers:
- trigger: help - trigger: help
comment: | comment: |
Thank you for your report! Thank you for your report!
@@ -57,67 +35,67 @@ triggers:
Welcome to the community! Welcome to the community!
status: log-only status: log-only
post_tags: post_tags:
- tag: Bedrock, Java - tag: Bedrock, Java
comment: | comment: |
__[Click here if your post says "Sorry, this post was removed by Reddits filters"](...)__ __[Click here if your post says "Sorry, this post was removed by Reddits filters"](...)__
status: enabled status: enabled
flair_id: 12345678-aaaa-bbbb-cccc-1234567890ab flair_id: 12345678-aaaa-bbbb-cccc-1234567890ab
``` ```
- Triggers: Bot responds to mod comments and mod reports containing `!trigger` (e.g., `!help`) with the configured comment and actions. - Triggers: Bot responds to mod comments and mod reports containing `!trigger` (e.g., `!help`) with the configured comment and actions.
- post_tags: Bot posts the comment automatically on new posts with matching tags in the title and can set flair. - post_tags: Bot posts the comment automatically on new posts with matching tags in the title and can set flair.
- Status options: `enabled`, `log-only`, `disabled`. - Status options: `enabled`, `log-only`, `disabled`.
- Optional actions: `flair_id`, `stickied`, `lock_post`, `lock_comment`. - Optional actions: `flair_id`, `stickied`, `lock_post`, `lock_comment`.
### 2. Environment Variables ### 2. Environment Variables
Create a `.env` file (or set env variables directly) with: Create a `.env` file (or set env variables directly) with:
``` ```
REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_client_secret REDDIT_CLIENT_SECRET=your_client_secret
REDDIT_USERNAME=your_username REDDIT_USERNAME=your_username
REDDIT_PASSWORD=your_password REDDIT_PASSWORD=your_password
REDDIT_USER_AGENT=modreplybot by /u/your_username REDDIT_USER_AGENT=modreplybot by /u/your_username
REDDIT_SUBREDDIT=your_subreddit REDDIT_SUBREDDIT=your_subreddit
REDDIT_WIKI_PAGE=modreplybot-config REDDIT_WIKI_PAGE=modreplybot-config
LOG_LEVEL=Default LOG_LEVEL=Default
``` ```
## Installation ## Installation
### Docker Compose (Recommended) ### Docker Compose (Recommended)
1. Copy `.env.example` to `.env` and fill in your values. 1. Copy `.env.example` to `.env` and fill in your values.
2. Run: 2. Run:
``` ```
docker compose up -d docker compose up -d
``` ```
* The DB folder is mounted for persistent database storage. * The DB folder is mounted for persistent database storage.
### Docker Run ### Docker Run
1. Copy `.env.example` to `.env` and fill in your values. 1. Copy `.env.example` to `.env` and fill in your values.
2. Run: 2. Run:
``` ```
docker run --env-file .env -v $(pwd)/DB:/app/DB slfhstd.uk/slfhstd/modreplybot:latest docker run --env-file .env -v $(pwd)/DB:/app/DB slfhstd.uk/slfhstd/modreplybot:latest
``` ```
### Baremetal (Direct Python) ### Baremetal (Direct Python)
1. Install Python 3.11+ 1. Install Python 3.11+
2. Install dependencies: 2. Install dependencies:
``` ```
pip install -r requirements.txt pip install -r requirements.txt
``` ```
3. Set environment variables or create a `.env` file. 3. Set environment variables or create a `.env` file.
4. Run: 4. Run:
``` ```
python modreplybot.py python modreplybot.py
``` ```
## Chat-Based Config Reload ## Chat-Based Config Reload
- To reload the wiki config, send a chat message containing `reload-config` to the bot account from a moderator account. - To reload the wiki config, send a chat message containing `reload-config` to the bot account from a moderator account.