• Stars
    star
    353
  • Rank 120,322 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created about 9 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go library for Telegram Bot API

tbot - Telegram Bot Server GoDoc Go Report Card GitHub Actions

logo

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:

go get github.com/yanzay/tbot/v2

Without go modules:

go get github.com/yanzay/tbot

Support

Join telegram group to get support or just to say thank you.

Documentation

Documentation: https://yanzay.github.io/tbot-doc/.

Full specification: godoc.

Usage

Simple usage example:

package main

import (
	"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 folder.

More Repositories

1

notify-telegram

GitHub Action: Build notifications for Telegram
Go
62
star
2

googlespeak

Go interface for Google TTS in Google Translate
Go
8
star
3

netcat

Simple netcat on go
Go
7
star
4

goproxy

TCP proxy with hex dumper
Go
5
star
5

picasso

Picasso Game for Telegram
Go
3
star
6

seccon

Secure TCP connection via SSH for Go.
Go
3
star
7

gorduino

Arduino wrapper for Go.
Go
2
star
8

cfg

A configuration file parser library for Go / Golang
Go
2
star
9

dl

YouTube download service
Go
2
star
10

jsonpath

Go
2
star
11

yahooweather

Go implementation for getting weather from Yahoo.
Go
2
star
12

govpn

Automatic VPN in minutes
Go
2
star
13

log

Go logging rethinked
Go
2
star
14

rsakeys

Helper package for working with RSA keypair.
Go
2
star
15

automata

Implementation of simple protocol Automata for Arduino and Go client.
Go
2
star
16

yanzay.github.io

CSS
1
star
17

huho2

JavaScript
1
star
18

youtuber

Go
1
star
19

bsalliance

Go
1
star
20

bankgo

Go
1
star
21

abiturient

Diploma project
Python
1
star
22

rook-dep

Dependency management tool for Go
Go
1
star
23

yanzay.com

JavaScript
1
star
24

lost

HTML
1
star
25

pagankolo

Python
1
star
26

gokiev

Go 1.6 Release Party
Go
1
star
27

intro

Introduction to Go presentation
Go
1
star
28

supermarket

Ruby
1
star
29

presentations

My presentations for meetups and conferences
JavaScript
1
star
30

goplay

Go Playground client
Go
1
star
31

reactiverecord

Go
1
star
32

besto

Go
1
star
33

gorrent

Go
1
star
34

clup

Cluster Processing
1
star
35

docker-hugo-builder

Shell
1
star
36

huho

Hugo Hosting
Go
1
star
37

teslo

draft
Go
1
star
38

tbot-doc

HTML
1
star
39

lviv-meetup

Go
1
star
40

action-temp

Dockerfile
1
star
41

powers

Go
1
star
42

autohome

Home automation with Go.
Go
1
star
43

hello-world-actions

1
star
44

lego

JavaScript
1
star
45

tbot.github.io

1
star
46

infra

1
star
47

secrets

my secrets, encrypted
Makefile
1
star
48

docker-hugo

Hugo Static Site Builder in Docker
1
star
49

audiobooks

CSS
1
star
50

dotfiles

My dotfiles
Vim Script
1
star
51

suprematism

Materials for presentation on Kyiv Go Meetup Aug 2019
JavaScript
1
star
52

draw

1
star
53

habraparser

Get latest topics from specified habs from habrahabr
Go
1
star
54

slacky

Slack bot
1
star
55

tamago

Go
1
star
56

pri

Ansible playbook for OSMC on Raspberry Pi
Shell
1
star