telegram-bot-api/bot.go

24 lines
365 B
Go
Raw Normal View History

package tgbotapi
type BotApi struct {
Token string `json:"token"`
Debug bool `json:"debug"`
2015-06-26 06:44:14 +02:00
Self User `json:"-"`
Updates chan Update `json:"-"`
}
2015-06-26 06:44:14 +02:00
func NewBotApi(token string) (*BotApi, error) {
bot := &BotApi{
Token: token,
}
2015-06-26 06:44:14 +02:00
self, err := bot.GetMe()
if err != nil {
return BotApi{}, err
}
bot.Self = self
return bot
}