1
0
telegram/utils_chat.go

42 lines
577 B
Go
Raw Normal View History

2017-10-17 11:08:09 +00:00
package telegram
func (chat *Chat) IsPrivate() bool {
if chat == nil {
return false
}
2017-10-17 11:08:09 +00:00
return chat.Type == ChatPrivate
}
func (chat *Chat) IsGroup() bool {
if chat == nil {
return false
}
2017-10-17 11:08:09 +00:00
return chat.Type == ChatGroup
}
func (chat *Chat) IsSuperGroup() bool {
if chat == nil {
return false
}
2017-10-17 11:08:09 +00:00
return chat.Type == ChatSuperGroup
}
func (chat *Chat) IsChannel() bool {
if chat == nil {
return false
}
2017-10-17 11:08:09 +00:00
return chat.Type == ChatChannel
}
func (chat *Chat) HasPinnedMessage() bool {
if chat == nil {
return false
}
return chat.PinnedMessage != nil
}