fix all golint errors, add info about audio uploads

This commit is contained in:
Syfaro 2015-06-26 01:53:20 -05:00
parent 5b2104f974
commit a17651c8fe
5 changed files with 290 additions and 258 deletions

13
bot.go
View file

@ -1,23 +1,24 @@
// Methods for interacting with the Telegram Bot API.
// Package tgbotapi has bindings for interacting with the Telegram Bot API.
package tgbotapi
type BotApi struct {
// BotAPI has methods for interacting with all of Telegram's Bot API endpoints.
type BotAPI struct {
Token string `json:"token"`
Debug bool `json:"debug"`
Self User `json:"-"`
Updates chan Update `json:"-"`
}
// Creates a new BotApi instance.
// NewBotAPI creates a new BotAPI instance.
// Requires a token, provided by @BotFather on Telegram
func NewBotApi(token string) (*BotApi, error) {
bot := &BotApi{
func NewBotAPI(token string) (*BotAPI, error) {
bot := &BotAPI{
Token: token,
}
self, err := bot.GetMe()
if err != nil {
return &BotApi{}, err
return &BotAPI{}, err
}
bot.Self = self