Registry / messaging / telegram-bot-api-v4

telegram-bot-api-v4

JSON →
library4.6.4gogounverified

Package tgbotapi provides functions and types for interacting with the Telegram Bot API.

go get gopkg.in/telegram-bot-api.v4
INSTALL
IMPORT
SIG · TELEGRAM-BOT-API-V
T
telegram-bot-api-v4
messaginggov4.6.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tgbotapi
gopkg.in/telegram-bot-api.v4

Create a bot and echo messages.

package main import ( "log" "gopkg.in/telegram-bot-api.v4" ) func main() { bot, err := tgbotapi.NewBotAPI("YOUR_TOKEN") if err != nil { log.Fatal(err) } bot.Debug = true u := tgbotapi.NewUpdate(0) updates, err := bot.GetUpdatesChan(u) if err != nil { log.Fatal(err) } for update := range updates { if update.Message != nil { msg := tgbotapi.NewMessage(update.Message.Chat.ID, update.Message.Text) bot.Send(msg) } } }
Debug
Known issues
breakingThis version (v4) is outdated; consider upgrading to v5 for latest API features.
fix
Use gopkg.in/telegram-bot-api.v5 or github.com/go-telegram-bot-api/telegram-bot-api/v5
affects: >=4.0.0 <5.0.0
Upgrade
Version history
4.6.4latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
20
OpenAI (training)
1
Resources
telegram-bot-api-v4 — go get telegram-bot-api-v4 · libregistry