Skip to content

Commit 6da34a6

Browse files
committed
Message IsCommand method added
1 parent af029c3 commit 6da34a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ func (m *Message) IsGroup() bool {
112112
return m.From.ID != m.Chat.ID
113113
}
114114

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

0 commit comments

Comments
 (0)