You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Nix e4b13509e6
Merge branch 'master' into master
7 years ago
tests Added VideoNote support 8 years ago
.gitignore Passport Updates (#1) 7 years ago
.travis.yml Remove go1.4 from travis configuration 7 years ago
LICENSE.txt add license 10 years ago
README.md Merge branch 'master' into master 7 years ago
bot.go Merge branch 'master' into master 7 years ago
bot_test.go A number of small improvements. 7 years ago
configs.go Add initial support for sendMediaGroup. 7 years ago
helpers.go Add initial support for sendMediaGroup. 7 years ago
helpers_test.go Add NewInlineQueryResultPhotoWithThumb for #54. 9 years ago
log.go A number of small improvements. 7 years ago
passport.go Fix capitalization in doc. 7 years ago
types.go Merge pull request #199 from treeder/master 7 years ago
types_test.go fix tests, linter errors and fmt 8 years ago

README.md

Golang bindings for the Telegram Bot API with support socks5 proxy

GoDoc Travis

All methods are fairly self explanatory, and reading the godoc page should explain everything. If something isn't clear, open an issue or submit a pull request.

The scope of this project is just to provide a wrapper around the API without any additional features. There are other projects for creating something with plugins and command handlers without having to design all that yourself.

Join the development group if you want to ask questions or discuss development.

Example

First, ensure the library is installed and up to date by running go get -u github.com/go-telegram-bot-api/telegram-bot-api.

This is a very simple bot that just displays any gotten updates, then replies it to that chat.

package main

import (
	"log"

	"github.com/go-telegram-bot-api/telegram-bot-api"
)

func main() {
	bot, err := tgbotapi.NewBotAPI("MyAwesomeBotToken","socks5","url-proxy",nil)
	if err != nil {
		log.Panic(err)
	}

	bot.Debug = true

	log.Printf("Authorized on account %s", bot.Self.UserName)

	u := tgbotapi.NewUpdate(0)
	u.Timeout = 60

	updates, err := bot.GetUpdatesChan(u)

	for update := range updates {