Build a Telegram bot in Go that replies to slash commands like /hi or /help
Create a Telegram inline bot that responds when users type its name anywhere in the app without opening a chat
Send images or audio files from a Go program to a Telegram user or group
Attach a custom button keyboard to Telegram messages so users tap choices instead of typing free text
Requires a Telegram bot token obtained from @BotFather, store the token in an environment variable, not hardcoded in source.
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.
← tucnak on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.