Lint issues fixed

This commit is contained in:
Gleb Sinyavsky 2015-11-21 19:43:24 +03:00
parent d638757359
commit 4037dbed02
3 changed files with 63 additions and 8 deletions

View file

@ -113,10 +113,12 @@ func (m *Message) IsGroup() bool {
return m.From.ID != m.Chat.ID
}
// IsCommand returns true if message starts from /
func (m *Message) IsCommand() bool {
return m.Text != "" && m.Text[0] == '/'
}
// Command returns first word from message
func (m *Message) Command() string {
return strings.Split(m.Text, " ")[0]
}