mtgo
A fast, idiomatic Go client library for the Telegram MTProto API, covering bots and user accounts, with generated protocol types, a handler and middleware system, a plugin lifecycle, pluggable storage backends and MTProxy support.
mtgo implements the Telegram MTProto 2.0 protocol in Go, including encryption, key generation, CDN handling and file transfers, with a high-level client API covering messages, chats, media, inline results, stories, payments and business connections. Updates are dispatched to handlers registered with filters, priorities and handler groups, middleware can run at both the RPC-invocation and update-dispatch levels, and a plugin system adds lifecycle hooks; a single process can run multiple bot or user clients together.
It can import and export sessions in the formats used by other MTProto libraries such as Telethon, Pyrogram, GramJS, mtcute and tdesktop, store session state in SQLite, PostgreSQL, MongoDB or a custom adapter, connect over MTProxy or a WebSocket or HTTP transport for restrictive networks, and automatically reconnect with exponential backoff.
It installs as a Go module, with a separate CLI tool and an installable agent skill for coding agents such as Claude Code and Codex.