all repos — telegram-bot-api @ 6da34a6ba5ef97891fcf581cf9275fe16503a5d8

Golang bindings for the Telegram Bot API

Message IsCommand method added
Gleb Sinyavsky zhulik.gleb@gmail.com
Sat, 21 Nov 2015 16:43:39 +0300
commit

6da34a6ba5ef97891fcf581cf9275fe16503a5d8

parent

af029c366ce76c9e394ff18c43a5174314e0ce2e

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

jump to
M types.gotypes.go

@@ -112,6 +112,11 @@ func (m *Message) IsGroup() bool {

return m.From.ID != m.Chat.ID } +// IsGroup returns if the message was sent to a group. +func (m *Message) IsCommand() bool { + return m.Text != "" && m.Text[0] == '/' +} + // PhotoSize contains information about photos, including ID and Width and Height. type PhotoSize struct { FileID string `json:"file_id"`