Note: this is tbot v2, you can find v1 here.
- Full Telegram Bot API support
- Zero dependency
- Type-safe API client with functional options
- Capture messages by regexp
- Can be used with go modules
- Support for external logger
- MIT licensed
go get github.com/yanzay/tbot
Go modules supported.
Join telegram group to get support or just to say thank you.
Simple usage example:
package main
import (
"os"
"time"
"github.com/yanzay/tbot"
)
func main() {
bot := tbot.New(os.Getenv("TELEGRAM_TOKEN"))
c := bot.Client()
bot.HandleMessage(".*yo.*", func(m *tbot.Message) {
c.SendChatAction(m.Chat.ID, tbot.ActionTyping)
time.Sleep(1 * time.Second)
c.SendMessage(m.Chat.ID, "hello!")
})
bot.Start()
}
Please take a look inside examples folder.