fix all golint errors, add info about audio uploads
This commit is contained in:
parent
5b2104f974
commit
a17651c8fe
5 changed files with 290 additions and 258 deletions
13
bot.go
13
bot.go
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue