Skip to content
Jingzhe

Examples

Repository examples live in crates/jingzhe/examples.

Example Coverage
get_me Bot information and the smallest API request
polling Commands, shared state, message handling, and typed button callbacks
files Uploading, downloading, and reusing Telegram files
full_api Typed messages, rich messages, Widgets, and Inline Mode
webhook Standalone Axum webhook service
axum_integration Merge webhook routes into an existing Axum service

Regular examples:

Terminal
cargo run -p jingzhe --example get_me
cargo run -p jingzhe --example polling
cargo run -p jingzhe --example files
cargo run -p jingzhe --example full_api

Webhook examples require the feature:

Terminal
cargo run -p jingzhe --features webhook --example webhook
cargo run -p jingzhe --features webhook --example axum_integration

Copy the configuration template from the repository root:

Terminal
cp -n .env.example .env

At minimum:

.env
TELEGRAM_BOT_TOKEN=replace-with-your-bot-token

The file examples also need TELEGRAM_CHAT_ID and UPLOAD_PATH. Webhook examples also need WEBHOOK_URL and WEBHOOK_SECRET.