Added a few helper methods for the type of Chat on the Chat type
parent
8e71d1db32
commit
e1a0a819c0
15
types.go
15
types.go
|
@ -60,6 +60,21 @@ type Chat struct {
|
||||||
LastName string `json:"last_name"`
|
LastName string `json:"last_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsPrivate returns true if the Chat is a private conversation
|
||||||
|
func (c *Chat) IsPrivate() bool {
|
||||||
|
return c.Type == "private"
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsGroup returns true if the Chat is a group conversation
|
||||||
|
func (c *Chat) IsGroup() bool {
|
||||||
|
return c.Type == "group"
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChannel returns true if the Chat is a channel
|
||||||
|
func (c *Chat) IsChannel() bool {
|
||||||
|
return c.Type == "channel"
|
||||||
|
}
|
||||||
|
|
||||||
// Message is returned by almost every request, and contains data about almost anything.
|
// Message is returned by almost every request, and contains data about almost anything.
|
||||||
type Message struct {
|
type Message struct {
|
||||||
MessageID int `json:"message_id"`
|
MessageID int `json:"message_id"`
|
||||||
|
|
Loading…
Reference in New Issue