explaingit

tucnak/telebot

4,606GoAudience · developerComplexity · 2/5Setup · easy

TLDR

Go framework for building Telegram bots that handles all communication with Telegram servers so you only write message-handling logic, not networking code.

Mindmap

mindmap
  root((repo))
    What it does
      Telegram bot framework
      Go language
      Handles networking
    Features
      Command handling
      Inline query mode
      File sending
      Reply keyboards
    How it works
      Bot token auth
      Channel-based messages
      Event per message type
    File uploads
      Audio and images
      Cached after first upload
    Use cases
      Slash command bots
      Inline query bots
      File upload bots
Click or tap to explore — scroll the page freely

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

Things people build with this

USE CASE 1

Build a Telegram bot in Go that replies to slash commands like /hi or /help

USE CASE 2

Create a Telegram inline bot that responds when users type its name anywhere in the app without opening a chat

USE CASE 3

Send images or audio files from a Go program to a Telegram user or group

USE CASE 4

Attach a custom button keyboard to Telegram messages so users tap choices instead of typing free text

Tech stack

Go

Getting it running

Difficulty · easy Time to first run · 30min

Requires a Telegram bot token obtained from @BotFather, store the token in an environment variable, not hardcoded in source.

In plain English

Telebot is a framework for building Telegram bots using the Go programming language. Telegram bots are special accounts that respond to messages automatically. When someone sends a bot a command or message in a private chat or group, the bot's underlying code receives that message and can reply. Telebot handles the communication layer with Telegram's servers so that you write logic instead of networking code. The basic workflow is to create a bot instance using an access token you get from Telegram, then listen for incoming messages on a channel. A channel here is a Go concept: a queue that feeds messages to your code as they arrive. You check each message and respond to the ones you care about. The minimal example in the README shows a bot that reads messages and replies with a greeting when someone sends the text "/hi". The framework also supports inline mode, a Telegram feature where users type a bot's name directly in a message field anywhere in the app and get results back without opening a separate chat. Telebot handles incoming inline queries on a separate channel alongside regular messages, letting you run both at the same time. File sending is also covered. You can send audio, images, or other files from your local filesystem. Telebot tracks uploaded files so that the same file is not uploaded again on subsequent sends. Reply markup lets you attach custom keyboards or force-reply prompts to messages, giving users button grids to tap instead of typing free text. Installation is through Go's standard package manager. The README recommends keeping your bot token in an environment variable rather than hardcoding it in your source code. The project's README notes that work on both a v1 and v2 API was in progress at the time it was written.

Copy-paste prompts

Prompt 1
Write a Go Telegram bot using telebot that replies to the /start command with a welcome message and your bot name.
Prompt 2
How do I set up an inline query handler in telebot so my bot responds when users type its username in any chat?
Prompt 3
Show me how to send a photo file from disk to a Telegram user using telebot in Go.
Prompt 4
How do I add a reply keyboard with buttons to a telebot message so users can select from options?
Prompt 5
Write a telebot Go bot that reads its token from an environment variable and logs all incoming messages to stdout.
Open on GitHub → Explain another repo

← tucnak on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.