Analysis updated 2026-05-18
Build a Telegram bot that replies to commands and messages.
Run a userbot automation using a phone-number login instead of a bot token.
Migrate an existing Pyrogram, Telethon, or GramJS session into a Go project.
| iluvx/go-tg-api | dream-horizon-org/datagen | realrenatto/take-over | |
|---|---|---|---|
| Stars | 60 | 59 | 57 |
| Language | Go | Go | Go |
| Setup difficulty | moderate | easy | easy |
| Complexity | 3/5 | 2/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Go 1.25+ and a Telegram api_id/api_hash from my.telegram.org/apps.
go-tg-api is a Go library for building Telegram bots and user-account clients on top of the MTProto protocol, the same low-level protocol the official Telegram apps use. It is built on top of an existing lower-level library called gotd/td and wraps it in an easier API, so developers get full access to Telegram features without writing the connection and encryption handling themselves. The library covers the everyday work of a bot or automation script: replying to messages, banning or unbanning users, forwarding messages, downloading media, and managing chats and channels. Updates from Telegram flow through a dispatcher that supports filters, so a program can react only to messages matching certain text, commands, or custom conditions, and handler groups let developers control which handlers run and in what order. Middleware hooks let a bot handle Telegram's flood-wait rate limits automatically rather than crashing when it sends too many messages too quickly. One notable feature is session portability. A session represents a logged-in account, and this library can import sessions created by other popular Telegram libraries such as Pyrogram, Telethon, GramJS, and even Telegram Desktop, so a project switching to go-tg-api does not have to force every user or bot to log in again. Sessions can be stored in memory, in SQLite, through a custom SQL database via GORM, or as a portable string. Installing it is a standard Go module fetch, and it requires Go version 1.25 or newer along with an API id and hash obtained from Telegram's own developer site. The README includes a short example that gets a working echo bot running in under fifty lines of code, plus a set of runnable example projects covering authentication methods, middleware, and media downloading. The project is currently at a beta version, meaning its public interface may still change, and it is released under the GNU General Public License version 3.
A Go library for building Telegram bots and user clients on MTProto, with session import from Pyrogram, Telethon, and GramJS.
Mainly Go. The stack also includes Go, gotd/td, SQLite.
GNU GPL v3, free to use and modify but derivative works must also be open sourced under the same license.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.