Updates channel removed from BotAPI

This commit is contained in:
Gleb Sinyavsky 2015-11-21 17:26:28 +03:00
parent 6da34a6ba5
commit 2a5cf8652d
3 changed files with 19 additions and 16 deletions

View file

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"time"
"strings"
)
// APIResponse is a response from the Telegram API with the result stored raw.
@ -112,11 +113,14 @@ 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] == '/'
}
func (m *Message) Command() string {
return strings.Split(m.Text, " ")[0]
}
// PhotoSize contains information about photos, including ID and Width and Height.
type PhotoSize struct {
FileID string `json:"file_id"`