all repos — telegram-bot-api @ 90c48448d2f023b3c7d5d14379ad8e4deae07ebb

Golang bindings for the Telegram Bot API

more comments on things
Syfaro syfaro@foxpaw.in
Fri, 26 Jun 2015 01:19:29 -0500
commit

90c48448d2f023b3c7d5d14379ad8e4deae07ebb

parent

07072ebce73bea4d334e95680a9cfaa88d9e2257

2 files changed, 4 insertions(+), 0 deletions(-)

jump to
M bot.gobot.go

@@ -1,3 +1,4 @@

+// Methods for interacting with the Telegram Bot API. package tgbotapi type BotApi struct {

@@ -7,6 +8,8 @@ Self User `json:"-"`

Updates chan Update `json:"-"` } +// Creates a new BotApi instance. +// Requires a token, provided by @BotFather on Telegram func NewBotApi(token string) (*BotApi, error) { bot := &BotApi{ Token: token,
M updates.goupdates.go

@@ -1,5 +1,6 @@

package tgbotapi +// Returns a chan that is called whenever a new message is gotten. func (bot *BotApi) UpdatesChan(config UpdateConfig) (chan Update, error) { bot.Updates = make(chan Update, 100)