Telegram bot that replies with random quotes from a text file (python-telegram-bot)
1.2K
epicmorg/telegramSmall Telegram bots. Currently one: bot-quotes — answers /say (and inline queries) with a
random quote from quotes.txt. Python 3 from epicmorg/debian:trixie,
python-telegram-bot 22.
/usr/local/share/epicmorg/telegram/bot/quotes: bot.py, a sample quotes.txt
and translations.json (sources)/start, /say, /help, /version; all texts and command descriptions come from
translations.jsonquotes.txt and translations.json are re-read when they change on disk — no restart needed| Tags | Dockerfile |
|---|---|
bot-quotes | . |
Every tag is pushed to docker.io, quay.io and ghcr.io (epicmorg/telegram:<tag> on each) - same digest everywhere.
quotes.txt (one quote per line) and translations.json.services:
quotes:
image: epicmorg/telegram:bot-quotes
restart: unless-stopped
environment:
TELEGRAM_BOT_TOKEN: "<bot_id>:<secret>"
volumes:
- ./quotes.txt:/usr/local/share/epicmorg/telegram/bot/quotes/quotes.txt:ro
- ./translations.json:/usr/local/share/epicmorg/telegram/bot/quotes/translations.json:ro
| Variable | Default | Meaning |
|---|---|---|
TELEGRAM_BOT_TOKEN | — | bot token |
TELEGRAM_BOT_TOKEN_FILE | — | path to a file with the token (e.g. a Docker secret); wins over TELEGRAM_BOT_TOKEN. Without both, token.txt in the data dir is used if present |
BOT_DATA_DIR | the bot directory | where quotes.txt, translations.json, token.txt are looked up |
BOT_QUOTES_FILE / BOT_TRANSLATIONS_FILE | <data dir>/… | explicit file paths |
BOT_PARSE_MODE | plain text | HTML or MarkdownV2 if quotes contain markup |
BOT_INLINE_RESULTS | 20 | inline answers per query (1–50) |
BOT_SAY_IN_GROUPS | off | true — answer a bare /say in groups without an @mention |
BOT_VERSION | — | reply to /version (otherwise version_message from translations.json) |
BOT_LOG_LEVEL | INFO | log level |
Content type
Image
Digest
sha256:53139ba8a…
Size
696.4 MB
Last updated
about 16 hours ago
docker pull epicmorg/telegram:bot-quotes