zhyu/nadia
66.0
Adequate · 3 October 2026
19.1k
lines of production code
Elixir
primary language
2
measurements over time
What this system is
Nadia is an Elixir library that provides a client for interacting with the Telegram Bot API and the Telegraph API. It supports multiple bot identities, session persistence, and media handling through configurable HTTP clients and typed data models. The system includes scaffolding tools for generating bot handlers and comprehensive testing utilities for both unit and live integration scenarios.
How it got here
2015 — Nadia 1.6.1 release and modernization
7 changes.
This period focused on the Nadia 1.6.1 release, which modernized the library by switching from Poison to Jason for JSON handling and updating the HTTP client stack to Req. It introduced explicit client support, bot scaffolding tasks, and structured API behavior contracts to improve developer experience and code organization. The release also significantly expanded test coverage with live integration tests and comprehensive unit tests for core API functionality.
2016–2026 — API expansion and example enhancements
7 changes.
This period focused on expanding the library's capabilities by adding typed models for Telegram inline queries, integrating the Telegraph API, and introducing a Req-based HTTP client adapter. It also significantly enriched the project with comprehensive examples for session persistence, media handling, and error recovery, supported by new test coverage for these components and the bot generation tooling.
Features
Add Req HTTP adapter for API requests
Introduces a new HTTP client implementation using the Req library, allowing the application to use Req for making API requests and handling downloads. This provides an alternative to the existing HTTP client backend, supporting POST requests with form and multipart body encoding, as well as streaming downloads.
_lib/nadia/http\client · high confidence
Add Telegraph API integration
Introduces a new module for interacting with the Telegraph API, including request/response plumbing, data models for accounts and pages, and a parser for API results.
lib/nadia/graph · high confidence
Added typed models for Inline Query Results and Input Message Content
New Elixir modules have been introduced to define the data structures for Telegram Bot API inline query results and input message content. The \Nadia.Model.InlineQueryResult\ module provides typed structs for various result types (such as Article, Photo, Gif, Video, Audio, Voice, Document, Location, Venue, and Contact) as well as their cached variants, ensuring type safety for outgoing content. Additionally, the \Nadia.Model.InputMessageContent\ module defines structs for text, location, venue, and contact input content, enabling users to construct precise inline query responses with properly typed fields.
lib/nadia/model · high confidence
Introduces bot scaffolding task and structured API behavior contracts
Developers can now generate a basic bot handler and test suite using the new \mix nadia.gen.bot\ task, which creates a module implementing the \Nadia.Handler\ behavior with a default \/start\ command echo. The library also restructures its public API by introducing \Nadia.Behaviour\ and its sub-modules (such as \BotAccount\, \Business\, \Chats\, \Games\, \GiftsAndVerification\, and \Interactions\) to define explicit callback signatures for Telegram Bot API methods, providing a standardized interface for client implementations and mocking.
lib/nadia · high confidence
New example modules for session persistence, media handling, and error recovery
Added several new example files in the \examples/\ directory to demonstrate advanced usage patterns. \conversation\_bot.ex\ and \inline\_keyboard\_bot.ex\ provide reference implementations for stateful conversational flows and inline keyboard interactions. Three session store backends are now available as examples: \database\_session\_store.ex\ (an optimistic, application-owned database backend with conflict resolution), \disk\_session\_store.ex\ (a persistent ETS/DETS-based store), and \media\_files.ex\ (helpers for sending documents, albums, paid media, and stories with bounded uploads). Additionally, \retry\_errors.ex\ offers a utility for handling Telegram flood-control and chat-migration errors with bounded retries.
examples · high confidence
Behavioural changes
Nadia 1.6.1 release with improved error handling and contributor guidelines
This release introduces contributor guidelines covering local checks, live smoke tests, and the CI release process. It also fixes low-level request setup failures for invalid option shapes and missing bot tokens by returning intentional %Nadia.Model.Error{} results before HTTP is attempted, rather than failing at the network layer.
(repo-wide) · high confidence
Nadia library adds explicit client support and replaces JSON library with Jason
The library now supports explicit bot identities via a \%Nadia.Client{}\ struct, allowing users to pass a client as the first argument to API wrappers (e.g., \Nadia.send\_message(client, ...)\), while legacy config-based calls remain supported. Additionally, the underlying JSON encoding has been switched from Poison to Jason, which affects how permissions and other JSON payloads are serialized in API requests.
lib · high confidence
Updated configuration example for modern Elixir and proxy support
The default configuration file has been replaced with a modernized example tailored for Elixir. The new config.exs.example demonstrates runtime configuration using the :system environment variable pattern for bot tokens, includes commented-out examples for managing multiple named bots, and documents support for HTTP/HTTPS proxies and custom API endpoints. The legacy config.exs file containing outdated Mix.Config instructions has been removed.
config · high confidence
Test coverage
Added live integration tests and expanded unit test coverage; Added tests for example code and session store behavior; Added tests for the Req HTTP client adapter; Added tests for the \nadia.gen.bot\ Mix task; Comprehensive test coverage for the Nadia Telegram Bot API client.
Dependencies
Update Elixir runtime requirement and HTTP client dependencies
The project now requires Elixir 1.20 or higher and has updated its core dependencies to Jason 1.4.5 and Req 0.7.2, replacing the previous HTTP client stack. This change ensures compatibility with modern Elixir versions and leverages the newer Req library for API requests, while also updating documentation tooling to ExDoc 0.40.3.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 65 → 66 (+0.5)
- Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.
Lenses
- Code Health 95 → 95 (-0.1)
- Architecture 97 → 86 (-10.7)
- Maturity 53 → 54 (+0.7)
- Readiness 67 → 69 (+1.7)
- Security 76 → 80 (+3.9)
Resolved (14)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (11 lines × 3) (lib/nadia/input_profile_photo.ex)
- Duplicated block (11–13 lines × 5) (lib/nadia/input_contact_message_content.ex)
- Duplicated block (13–14 lines × 2) (lib/nadia/input_contact_message_content.ex)
- Duplicated block (5 lines × 2) (lib/nadia/input_invoice_message_content.ex)
- Duplicated block (5 lines × 3) (lib/nadia/input_paid_media.ex)
- Duplicated block (6 lines × 2) (lib/nadia.ex)
- Duplicated block (6 lines × 3) (lib/nadia/input_media.ex)
- Duplicated block (6 lines × 4) (lib/nadia/input_contact_message_content.ex)
- Duplicated block (6 lines × 7) (lib/nadia/input_contact_message_content.ex)
- Medium CVE: EEF-[CVE redacted] (mix.lock)
- Members sharing a duplicated core (5 members, 50+ identical tokens) (lib/nadia/input_contact_message_content.ex)
- Off-boarding risk: anonymized user #1
New (16)
- Duplicated block (11 lines × 4) (lib/nadia/input_poll_media.ex)
- Duplicated block (12–14 lines × 5) (lib/nadia/input_contact_message_content.ex)
- Duplicated block (5 lines × 2) (lib/nadia/input_media.ex)
- Duplicated block (6 lines × 2) (lib/nadia/input_invoice_message_content.ex)
- Duplicated block (6 lines × 2) (lib/nadia/input_media.ex)
- Duplicated block (6 lines × 2) (lib/nadia/input_profile_photo.ex)
- Duplicated block (6 lines × 3) (lib/nadia/input_paid_media.ex)
- Duplicated block (7 lines × 2) (lib/nadia.ex)
- Duplicated block (7 lines × 2) (lib/nadia/polling.ex)
- Duplicated block (7 lines × 4) (lib/nadia/input_contact_message_content.ex)
- Duplicated block (7 lines × 7) (lib/nadia/input_contact_message_content.ex)
- Duplicated block (8 lines × 3) (lib/nadia/input_media.ex)
- Medium CVE: EEF-[CVE redacted] (mix.lock)
- Members sharing a duplicated core (5 members, 50+ identical tokens) (lib/nadia/input_contact_message_content.ex)
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
zhyu/nadia was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit f3c813c4ffdfc433f0e15bf6a848dc58fe7f14cf — the exact code this score is about.
- Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-8fe32cd45d00.