go fmt
Gleb Sinyavsky zhulik.gleb@gmail.com
Sat, 21 Nov 2015 17:39:19 +0300
M
bot.go
→
bot.go
@@ -13,16 +13,16 @@ "net/http"
"net/url" "os" "strconv" - "time" "strings" + "time" ) // 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:"-"` - Client *http.Client `json:"-"` + Token string `json:"token"` + Debug bool `json:"debug"` + Self User `json:"-"` + Client *http.Client `json:"-"` } // NewBotAPI creates a new BotAPI instance.@@ -198,7 +198,7 @@
return user, nil } -func (bot *BotAPI) IsMessageToMe(message Message) (bool) { +func (bot *BotAPI) IsMessageToMe(message Message) bool { return strings.Contains(message.Text, "@"+bot.Self.UserName) }