Skip to content

devalecs/tgo

Repository files navigation

Telegram bot API Client written in Golang

Travis GoDoc

GetUpdatesChan example

package main

import "gopkg.in/devalecs/tgo.v1"

func main() {
	c := tgo.NewClient("yourTelegramBotAPIToken")

	updatesChan := c.GetUpdatesChan(tgo.GetUpdatesParams{
		Timeout: 60,
	})

	for update := range updatesChan {
		if update.Message == nil {
			continue
		}

		c.SendMessage(tgo.SendMessageParams{
			ChatID: update.Message.Chat.ID,
			Text:   "Pong",
		})
	}
}

About

Telegram bot API Client written in Golang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages