Honkbot (Rust)#
A single Bluesky bot that listens to the full firehose via Jetstream and replies to animal commands with random Flickr images.
Rewrite of bskybots/honkbot in Rust for reliability and performance.
Commands#
| Command | Animal | Reply Text |
|---|---|---|
/honk |
Goose | HONK |
/awoo |
Wolf | AWOO |
/baaa |
Goat | BAAA |
/bork |
Dog/Puppy | BORK |
/hiss |
Snake | HISS |
/hoot |
Owl | HOOT |
/meehh |
Sheep | MEEHH |
/meow |
Cat | MEOW |
/mumble |
Marmot | MUMBLE |
/oink |
Pig | OINK |
/ribbit |
Frog | RIBBIT |
/squee |
Capybara | SQUEE |
/yowl |
Bobcat | YOWL |
Setup#
-
Copy
.env.exampleto.envand fill in your credentials:BSKY_HANDLE— your bot's Bluesky handleBSKY_PASSWORD— an app password for the bot accountFLICKR_KEY— a Flickr API key (get one here)
-
Seed fallback images (used when Flickr is down or rate-limited):
./seed_fallback_images.shThis downloads ~12 images per category into
fallback_images/. You can also manually add your own.jpg/.png/.webpfiles. -
Build and run:
cargo build --release ./target/release/honkbot
Features#
- Single binary handles all 13 animal commands
- Jetstream WebSocket for efficient firehose consumption (only receives
app.bsky.feed.postevents) - Automatic reconnection with cursor tracking on disconnect
- Bounded concurrency (10 concurrent reply tasks) to avoid flooding APIs
- Session refresh with automatic retry on auth failures
- Flickr fallback images — if Flickr is down or rate-limited, picks a random image from
fallback_images/<command>/ - Image resizing for images over 1MB (Bluesky blob limit)
- Structured logging via
tracing(setRUST_LOG=debugfor verbose output)
Architecture#
Jetstream (WSS) → match post text against triggers → spawn bounded task:
1. Search Flickr for random animal image
2. Download & resize if needed
3. Upload blob to Bluesky
4. Create reply post with image