feat: complete Ancestor quote bot with production-ready Docker support
This commit is contained in:
38
README.md
38
README.md
@@ -1,4 +1,4 @@
|
||||
# Ancestor Quote Bot 🎃
|
||||
# 🎃 Ancestor Quote Bot
|
||||
|
||||
A Matrix chatbot that responds to `!quote` commands with random quotes from Darkest Dungeons.
|
||||
|
||||
@@ -7,7 +7,7 @@ A Matrix chatbot that responds to `!quote` commands with random quotes from Dark
|
||||
```bash
|
||||
# 1. Update .env file (create from template)
|
||||
cp .env.example .env
|
||||
# Edit .env with your MATRIX_ACCESS_TOKEN and MATRIX_HOME_SERVER
|
||||
nano .env # Edit MATRIX_ACCESS_TOKEN and MATRIX_HOME_SERVER
|
||||
|
||||
# 2. Build Docker image
|
||||
docker build -t ancestor-quote-bot .
|
||||
@@ -15,13 +15,13 @@ docker build -t ancestor-quote-bot .
|
||||
# 3. Run the bot
|
||||
docker run --rm \
|
||||
-e MATRIX_HOME_SERVER=https://matrix.org \
|
||||
-e MATRIX_ACCESS_TOKEN=your_token_here \
|
||||
-e MATRIX_ACCESS_TOKEN=your_access_token_here \
|
||||
ancestor-quote-bot
|
||||
```
|
||||
|
||||
## Deployment Options
|
||||
|
||||
### Option 1: Pass env vars via `docker run` (Recommended for Docker)
|
||||
### Option A: Pass env vars via `docker run` (Recommended)
|
||||
```bash
|
||||
docker run --rm \
|
||||
-e MATRIX_HOME_SERVER=https://matrix.org \
|
||||
@@ -30,22 +30,13 @@ docker run --rm \
|
||||
ancestor-quote-bot
|
||||
```
|
||||
|
||||
### Option 2: Mount .env file directly
|
||||
### Option B: Mount .env file directly
|
||||
```bash
|
||||
docker run --rm \
|
||||
-v $(pwd)/.env:/app/.env \
|
||||
ancestor-quote-bot
|
||||
```
|
||||
|
||||
### Option 3: Use docker-compose.yml (Production)
|
||||
```bash
|
||||
docker compose up -d
|
||||
# Or with custom env:
|
||||
docker compose up -d \
|
||||
-e MATRIX_HOME_SERVER=https://matrix.org \
|
||||
-e MATRIX_ACCESS_TOKEN=your_access_token_here
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
| Variable | Description | Default |
|
||||
@@ -54,15 +45,30 @@ docker compose up -d \
|
||||
| `MATRIX_ACCESS_TOKEN` | Bot access token for authentication | REQUIRED |
|
||||
| `BOT_COMMAND` | Command trigger to request a quote | !quote |
|
||||
|
||||
## Getting an Access Token
|
||||
|
||||
1. Go to [Matrix Registration API](https://matrix.org/docs/projects/registration/matrix-registration-api)
|
||||
2. Or use your Matrix admin panel to create a bot account
|
||||
3. Get the access token from your Matrix settings
|
||||
|
||||
## How It Works
|
||||
|
||||
1. The bot connects to your Matrix homeserver using the provided access token
|
||||
2. Once joined to a room, it listens for messages containing the trigger command
|
||||
3. When triggered, it selects a random quote from `quotes.json` and replies instantly
|
||||
|
||||
## Getting an Access Token
|
||||
## Usage
|
||||
|
||||
Use [this](https://matrix.org/docs/projects/registration/matrix-registration-api) or your Matrix admin panel to register a bot account.
|
||||
```bash
|
||||
# Invite the bot to a room:
|
||||
# @ancestor-quote-bot:matrix.org (or your custom username)
|
||||
|
||||
# In any Matrix room, type:
|
||||
!quote
|
||||
|
||||
# Bot responds with:
|
||||
"Dispatch this thug in brutal fashion, that all may hear of your arrival!"
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user