1
0

Added IsEvent message util

This commit is contained in:
Maxim Lebedev 2018-08-15 15:56:05 +05:00
parent f9dc63aa28
commit c841acc6eb
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F

View File

@ -280,3 +280,15 @@ func (msg *Message) HasCaption() bool {
func (msg *Message) HasAuthorSignature() bool {
return msg != nil && msg.AuthorSignature != ""
}
// IsEvent checks what current message is a any chat event.
func (m *Message) IsEvent() bool {
return m.IsChannelChatCreatedEvent() ||
m.IsDeleteChatPhotoEvent() ||
m.IsGroupChatCreatedEvent() ||
m.IsLeftChatMemberEvent() ||
m.IsNewChatMembersEvent() ||
m.IsNewChatTitleEvent() ||
m.IsSupergroupChatCreatedEvent() ||
m.IsNewChatPhotoEvent()
}