more comments on things
parent
07072ebce7
commit
90c48448d2
3
bot.go
3
bot.go
|
@ -1,3 +1,4 @@
|
||||||
|
// Methods for interacting with the Telegram Bot API.
|
||||||
package tgbotapi
|
package tgbotapi
|
||||||
|
|
||||||
type BotApi struct {
|
type BotApi struct {
|
||||||
|
@ -7,6 +8,8 @@ type BotApi struct {
|
||||||
Updates chan Update `json:"-"`
|
Updates chan Update `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Creates a new BotApi instance.
|
||||||
|
// Requires a token, provided by @BotFather on Telegram
|
||||||
func NewBotApi(token string) (*BotApi, error) {
|
func NewBotApi(token string) (*BotApi, error) {
|
||||||
bot := &BotApi{
|
bot := &BotApi{
|
||||||
Token: token,
|
Token: token,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package tgbotapi
|
package tgbotapi
|
||||||
|
|
||||||
|
// Returns a chan that is called whenever a new message is gotten.
|
||||||
func (bot *BotApi) UpdatesChan(config UpdateConfig) (chan Update, error) {
|
func (bot *BotApi) UpdatesChan(config UpdateConfig) (chan Update, error) {
|
||||||
bot.Updates = make(chan Update, 100)
|
bot.Updates = make(chan Update, 100)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue