mirror of
https://github.com/tiennm99/openai-status-bot.git
synced 2026-10-15 16:15:08 +00:00
feat(config): use REDIS_URL for redis
This commit is contained in:
1 parent
f022e8463c
commit
204a76a32d
8 files changed
+82
-50
No files matched your search
+3
-1
@@ -11,6 +11,7 @@
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# set TELEGRAM_BOT_TOKEN in .env
|
||||
# REDIS_URL is overridden to redis://redis:6379/0 by docker compose
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
@@ -27,6 +28,7 @@ Run bot:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# export TELEGRAM_BOT_TOKEN or source .env with your shell workflow
|
||||
# REDIS_URL defaults to redis://localhost:6379/0
|
||||
go run ./cmd/openai-status-bot
|
||||
```
|
||||
|
||||
@@ -34,7 +36,7 @@ go run ./cmd/openai-status-bot
|
||||
|
||||
```bash
|
||||
go test ./...
|
||||
go build ./cmd/openai-status-bot
|
||||
go build -o /tmp/openai-status-bot ./cmd/openai-status-bot
|
||||
```
|
||||
|
||||
Then send `/start` to the Telegram bot and run `/status`. If the same token was previously used by a webhook deployment, startup clears that webhook before long polling begins.
|
||||
@@ -38,7 +38,7 @@ Subscriber set members are `chatID` or `chatID:threadID`. Missing settings defau
|
||||
|
||||
## Runtime
|
||||
|
||||
The service uses Telegram `getUpdates`, so it does not need a public webhook URL. On startup it calls `deleteWebhook` before long polling, which allows migration from a webhook-based deployment using the same bot token. Docker Compose starts Redis and the bot.
|
||||
The service uses Telegram `getUpdates`, so it does not need a public webhook URL. On startup it calls `deleteWebhook` before long polling, which allows migration from a webhook-based deployment using the same bot token. Redis is configured with `REDIS_URL`. Docker Compose starts Redis and the bot.
|
||||
|
||||
## Failure Behavior
|
||||
|
||||
|
||||
Reference in new issue
Block a user