git404hub

what is go-tg-api fr?

iluvx/go-tg-api — explained in plain English

Analysis updated 2026-05-18

60GoAudience · developerComplexity · 3/5LicenseSetup · moderate

tl;dr

A Go library for building Telegram bots and user clients on MTProto, with session import from Pyrogram, Telethon, and GramJS.

vibe map

mindmap
  root((go-tg-api))
    What it does
      Telegram bot client
      User account client
      Update dispatcher
    Tech stack
      Go
      gotd/td
      SQLite
    Features
      Session import
      Flood wait middleware
      Filters and handlers
    Use cases
      Build a Telegram bot
      Run userbots
      Download media
    Audience
      Go developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Build a Telegram bot that replies to commands and messages.

VIBE 2

Run a userbot automation using a phone-number login instead of a bot token.

VIBE 3

Migrate an existing Pyrogram, Telethon, or GramJS session into a Go project.

what's the stack?

Gogotd/tdSQLiteGORM

how it stacks up fr

iluvx/go-tg-apidream-horizon-org/datagenrealrenatto/take-over
Stars605957
LanguageGoGoGo
Setup difficultymoderateeasyeasy
Complexity3/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 30min

Requires Go 1.25+ and a Telegram api_id/api_hash from my.telegram.org/apps.

GNU GPL v3, free to use and modify but derivative works must also be open sourced under the same license.

in plain english

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.

prompts (copy fr)

prompt 1
Show me how to adapt this repo's echo bot example to reply with a custom message.
prompt 2
Explain how session import from Pyrogram or Telethon works in this repo.
prompt 3
Walk me through setting up flood wait middleware using this repo.
prompt 4
What's the difference between ClientTypeBot and ClientTypePhone in this repo?

Frequently asked questions

what is go-tg-api fr?

A Go library for building Telegram bots and user clients on MTProto, with session import from Pyrogram, Telethon, and GramJS.

What language is go-tg-api written in?

Mainly Go. The stack also includes Go, gotd/td, SQLite.

What license does go-tg-api use?

GNU GPL v3, free to use and modify but derivative works must also be open sourced under the same license.

How hard is go-tg-api to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is go-tg-api for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.