TWIR Deploy Notify is a small Rust CLI that turns the latest This Week in Rust issue into a series of Telegram posts.
What it does:
- Finds the newest TWIR Markdown issue file in
this-week-in-rust/content. - Parses the issue into sections.
- Generates Telegram friendly messages:
- one Telegram post per section
- automatically splits sections and overly long lines to fit Telegram limits
- appends the issue link (derived from issue number and date) to each post
- Sends the posts to the configured Telegram chat.
- Pins the first sent message and removes the service notification.
- Cleans up any previously generated
output_*.mdfiles before writing new ones.
- TWIR issues are long, and Telegram has message size limits.
- You want consistent formatting and splitting without manual editing.
- You want a repeatable way to publish the latest issue to one or more chats.
- Rust toolchain (stable).
- A local clone of
rust-lang/this-week-in-rustwith thecontentdirectory available. - Telegram bot token and chat id.
Clone TWIR into a twir subdirectory (sparse checkout of content):
git clone --depth 1 --filter=blob:none --sparse https://github.com/rust-lang/this-week-in-rust twir && cd twir && git sparse-checkout set content && cd ..cargo run --bin twir-deploy-notify -- twir/content/<file-name>.mdGenerate plain text instead of Telegram markup:
cargo run --bin twir-deploy-notify -- --plain twir/content/<file-name>.mdEnable detailed logs:
RUST_LOG=info cargo run --bin twir-deploy-notify -- twir/content/<file-name>.mdEnvironment variables for sending to Telegram:
DEV_BOT_TOKENandDEV_CHAT_IDdev chat credentialsPROD_BOT_TOKENandPROD_CHAT_IDproduction chat credentials- If
*_CHAT_IDis numeric, it is automatically prefixed with-100when sending requests to Telegram
- If
TWIR_SKIP_DEVELOPER_SENDoptional boolean that skips the developer sendTWIR_SKIP_PRODUCTION_SENDoptional boolean that skips the production send
If neither credential pair is fully configured, the CLI exits with an error. Partial configuration (only one variable from a pair) is also treated as an error.
See LICENSE_QQRM_LAPOCHKA.