Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yanzay/tbot
Go library for Telegram Bot API
https://github.com/yanzay/tbot
bot golang telegram
Last synced: 3 months ago
JSON representation
Go library for Telegram Bot API
- Host: GitHub
- URL: https://github.com/yanzay/tbot
- Owner: yanzay
- License: mit
- Created: 2015-09-11T16:19:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-19T22:57:51.000Z (about 1 year ago)
- Last Synced: 2024-09-30T23:37:52.659Z (4 months ago)
- Topics: bot, golang, telegram
- Language: Go
- Homepage: https://yanzay.github.io/tbot-doc/
- Size: 2.68 MB
- Stars: 355
- Watchers: 12
- Forks: 55
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - tbot - Telegram bot server with API similar to net/http. (Bot Building)
- awesome-Char - tbot - Telegram bot server with API similar to net/http. (Bot Building / Contents)
- awesome-go - tbot - Telegram bot server with API similar to net/http. (Bot Building)
- fucking-awesome-go - tbot - Telegram bot server with API similar to net/http. (Bot Building)
- awesome-go - tbot - Telegram bot server with API similar to net/http. (Bot Building)
- awesome-go - tbot
- awesome-go - tbot - Telegram bot server with API similar to net/http. (Bot Building)
- awesome-go - tbot - Telegram bot server with API similar to net/http. - :arrow_down:5 - :star:2 (Bot Building)
- awesome-go - tbot - Telegram Bot Server - ★ 168 (Third-party APIs)
- awesome-go-cn - tbot
- awesome-go-extra - tbot - 09-11T16:19:25Z|2021-03-22T20:26:16Z| (Bot Building / Free e-books)
- awesome-go-with-stars - tbot - Telegram bot server with API similar to net/http. (Bot Building)
- awesome-discoveries - tbot - Telegram Bot Server _(`Go`)_ (Servers)
- awesome-go-cn - tbot
- awesome-go-plus - tbot - Telegram bot server with API similar to net/http. ![stars](https://img.shields.io/badge/stars-356-blue) (Bot Building)
- awesome-go-plus - tbot - Telegram bot server with API similar to net/http. ![stars](https://img.shields.io/badge/stars-355-blue) (Bot Building)
README
# tbot - Telegram Bot Server [![GoDoc](https://godoc.org/github.com/yanzay/tbot?status.svg)](https://godoc.org/github.com/yanzay/tbot) [![Go Report Card](https://goreportcard.com/badge/github.com/yanzay/tbot)](https://goreportcard.com/report/github.com/yanzay/tbot) [![GitHub Actions](https://github.com/yanzay/tbot/workflows/Test/badge.svg)](https://github.com/yanzay/tbot/actions)
![logo](https://raw.githubusercontent.com/yanzay/tbot/master/logo.png)
## Features
- Full Telegram Bot API **4.7** support
- **Zero** dependency
- Type-safe API client with functional options
- Capture messages by regexp
- Middlewares support
- Can be used with go modules
- Support for external logger
- MIT licensed## Installation
With go modules:
```bash
go get github.com/yanzay/tbot/v2
```Without go modules:
```bash
go get github.com/yanzay/tbot
```## Support
Join [telegram group](https://t.me/tbotgo) to get support or just to say thank you.
## Documentation
Documentation: [https://yanzay.github.io/tbot-doc/](https://yanzay.github.io/tbot-doc/).
Full specification: [godoc](https://godoc.org/github.com/yanzay/tbot).
## Usage
Simple usage example:
[embedmd]:# (examples/basic/main.go)
```go
package mainimport (
"log"
"os"
"time""github.com/yanzay/tbot/v2"
)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!")
})
err := bot.Start()
if err != nil {
log.Fatal(err)
}
}
```## Examples
Please take a look inside [examples](https://github.com/yanzay/tbot/tree/master/examples) folder.