1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// All public items are documented as of 0.4.0.
// ─── Macros (must come first — macro_rules! are order-dependent) ───
/// Ergonomic handler macros (`handler!`, `form_handler!`) and BotApi delegation macros.
// ─── Core types & errors ───
/// Error types for API calls and handler logic.
/// Core types: ChatId, MessageId, Screen identifiers, message content, parsed updates.
// ─── Screen system (the heart of Blazegram) ───
/// Virtual Chat Differ — computes minimal API operations for screen transitions.
/// Diff operation executor — applies edit/delete/send with retry and fallback.
/// Inline keyboard builder with buttons, rows, grids, navigation.
/// Markup processor: `*bold*` `_italic_` → Telegram HTML, plus HTML builder helpers and `escape()`.
/// Screen builder — declarative UI for chat messages.
// ─── Runtime ───
/// grammers MTProto adapter implementing [`BotApi`](crate::bot_api::BotApi).
///
/// Split into sub-modules for send, media, admin, settings, forum, and stars operations.
/// `BotApi` trait — 60+ async methods abstracting Telegram API calls.
/// Re-export for backward compatibility with pre-0.4 code that used
/// `blazegram::grammers_adapter::*`.
/// App builder and main event loop.
/// Handler context — the single object handlers interact with.
/// File-backed session — MemorySession + JSON persistence. Zero SQLite.
/// Command/callback/input router with prefix matching.
/// Per-chat lock guaranteeing sequential update processing.
/// State storage trait + in-memory store with snapshot support.
/// Raw grammers Update → IncomingUpdate parser (isolates TL pattern matching).
pub
// ─── Features ───
/// Broadcast messages to multiple chats.
/// Branching conversation system — multi-step dialogues with conditional flow.
/// Multi-step form wizards with validation.
/// FTL-based i18n with `{ $var }` interpolation.
/// Inline query results with builder API.
/// Paginated lists with auto-generated navigation buttons.
/// Progressive screen updates (streaming, progress bars). Auto-cancelled on navigate().
/// Delayed action scheduler — fire callbacks after a duration.
/// Template engine: `{{ var }}`, `{% if %}`, `{% for %}`.
// ─── Infrastructure ───
/// File ID cache — avoid re-uploading the same media.
/// Prometheus-style counters and histograms.
/// Middleware trait + built-in logging, analytics, throttle.
/// Token-bucket rate limiter with automatic FLOOD_WAIT handling.
/// Pure-Rust persistent state store (redb). Zero C deps, no SQLite conflicts.
/// Requires the `redb` feature (enabled by default).
// ─── Testing ───
/// Mock BotApi for unit tests without Telegram.
/// TestApp harness for integration-style tests.
// ─── Prelude ───
/// Re-exports everything you need: `use blazegram::prelude::*;`
// ─── Optional stores ───
/// Redis-backed state store (requires `redis` feature).