all repos — telegram-bot-api @ af029c366ce76c9e394ff18c43a5174314e0ce2e

Golang bindings for the Telegram Bot API

Bot IsMessageToMe method
Gleb Sinyavsky zhulik.gleb@gmail.com
Sat, 21 Nov 2015 16:33:58 +0300
commit

af029c366ce76c9e394ff18c43a5174314e0ce2e

parent

399d665b0a47ab14b54f54c2063e55a1258439af

1 files changed, 5 insertions(+), 0 deletions(-)

jump to
M bot.gobot.go

@@ -14,6 +14,7 @@ "net/url"

"os" "strconv" "time" + "strings" ) // BotAPI has methods for interacting with all of Telegram's Bot API endpoints.

@@ -196,6 +197,10 @@ log.Printf("getMe: %+v\n", user)

} return user, nil +} + +func (bot *BotAPI) IsMessageToMe(message Message) (bool) { + return strings.Contains(message.Text, "@"+bot.Self.UserName) } func (bot *BotAPI) Send(c Chattable) (Message, error) {