cratefield_adapter_telegram/lib.rs
1//! `cratefield-adapter-telegram`: the [`TelegramBot`] port over the Telegram
2//! Bot API (issue #764), the harness's chat side. Uses the runtime's
3//! [`HttpClient`](cratefield_core::HttpClient) port — no vendor SDK, no
4//! `reqwest` — so the same adapter runs on Workers and natively, and the
5//! [`Clock`](cratefield_core::Clock) port to drive its local rate budgets so
6//! tests move time by hand.
7//!
8//! The outbound half ([`HttpTelegramBot`]) speaks the four calls a module
9//! needs — send, edit, delete, answer-callback — and refuses locally what
10//! Telegram would refuse remotely: an exhausted rate bucket returns
11//! [`TelegramError::RateLimited`] before any HTTP request is sent. The
12//! inbound half ([`parse_update`], [`webhook::parse_verified`]) turns one
13//! webhook delivery into a typed [`Update`], verified before it is parsed.
14
15#![doc = include_str!("../README.md")]
16#![forbid(unsafe_code)]
17
18mod client;
19mod update;
20
21pub mod conformance;
22pub mod fake;
23pub mod webhook;
24
25pub use client::{
26 ButtonKind, HttpTelegramBot, InlineButton, OutgoingMessage, RateLimits, SentMessage,
27 TelegramBot, TelegramError,
28};
29pub use update::{
30 CallbackQuery, ChannelPost, Chat, ChatKind, Command, Message, Update, UpdateError, UpdateKind,
31 User, parse_update,
32};