ReadeckWiseBot is a lightweight Go binary designed for a simple Readwise-like experience in Telegram. It randomly retrieves a user-defined number highlights (annotations) from a Readeck instance and forwards them to a Telegram channel or chat on a daily schedule.
- Random Discovery: Pulls a random highlight or highlights from the user’s collection.
- Beautiful Formatting: Sends the highlights to Telegram in blockquotes, with direct links to Readeck articles.
- Scheduled: Runs automatically at a predefined time every day.
- Docker: Hardened, non-root Docker image with small resource footprint.
- Resource Limits: The bot is restricted to limited resources, and uses paginated API calls to be as efficient and fast as possible, even with thousands of highlights.
To use this bot, you will need:
- A Readeck Instance: Either self-hosted or the hosted version.
- Readeck API Token: Go to your Readeck profile -> API Tokens to generate one.
- Telegram Bot Token: Created via @BotFather.
- Telegram Chat ID: The ID of the channel or group where the bot will post.
- Message @BotFather on Telegram.
- Use the
/newbotcommand and follow the instructions. - Save the API Token provided.
- Add your bot as an Administrator to the channel or group you want to post to.
The easiest way to get your chat ID is to:
- Post a test message in your channel/group.
- Forward that message to @userinfobot.
- It will reply with the unique ID (e.g.,
-100123456789or12345678).
You can configure the bot using a config.yaml file in the project root:
readeck:
url: "https://readeck.example.com/api"
token: "your_readeck_token"
telegram:
token: "your_telegram_bot_token"
chat_id: -100123456789
bot:
retrieve_count: 1
schedule_time: "09:00" # HH:MM formatEvery setting can also be set via env variables making the config file unnecessary:
READECK_URLREADECK_TOKENTELEGRAM_TOKENTELEGRAM_CHAT_IDBOT_SCHEDULE_TIMERUN_ONCE(Set totrueto trigger a highlight immediately on startup for testing)
- Create a
docker-compose.yml:
services:
readeckwisebot:
image: ghcr.io/alanon202/readeckwisebot:main
container_name: readeckwise-bot
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
user: "1000:1000"
environment:
READECK_URL: ${READECK_URL}
READECK_TOKEN: ${READECK_TOKEN}
TELEGRAM_TOKEN: ${TELEGRAM_TOKEN}
TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID}
BOT_SCHEDULE_TIME: "09:00"
BOT_RETRIEVE_COUNT: 1
tmpfs:
- /tmp
volumes:
- ./config.yaml:/app/config.yaml:ro
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthcheck"]
interval: 120s
timeout: 5s
retries: 3
start_period: 5s
deploy:
resources:
limits:
cpus: '0.10'
memory: 64M
reservations:
memory: 16M- Run it:
docker compose up -dgo run .