incoming.go
func (m *Message) Type() MessageType {
	if m.Text != nil {
		return TextMessage
	} else if m.Audio != nil {
		return AudioMessage
	} else if m.Document != nil {
		return DocumentMessage
	} else if m.Photo != nil {
		return PhotoMessage
	} else if m.Sticker != nil {
		return StickerMessage
	} else if m.Video != nil {
		return VideoMessage
	} else if m.Voice != nil {
		return VoiceMessage
	} else if m.Contact != nil {
		return ContactMessage
	} else if m.Location != nil {
		return LocationMessage
	} else if m.NewChatMember != nil {
		return NewChatMember
	} else if m.LeftChatMember != nil {
		return LeftChatMember
	} else if m.NewChatTitle != nil {
		return NewChatTitle
	} else if m.NewChatPhoto != nil {
		return NewChatPhoto
	} else if m.DeleteChatPhoto {
		return DeletedChatPhoto
	} else if m.GroupChatCreated {
		return GroupChatCreated
	} else if m.SupergroupChatCreated {
		return SupergroupChatCreated
	} else if m.ChannelChatCreated {
		return ChannelChatCreated
	} else if m.MigrateToChatID != nil {
		return MigrationToSupergroup
	} else if m.MigrateFromChatID != nil {
		return MigrationFromGroup
	} else if m.Venue != nil {
		return VenueMessage
	} else if m.PinnedMessage != nil {
		return PinnedMessage
	}

	return UnknownMessage
}
func (m *Message) Type() MessageType {
	if m.Text != nil {
		return TextMessage
	} else if m.Audio != nil {
		return AudioMessage
	} else if m.Document != nil {
		return DocumentMessage
	} else if m.Photo != nil {
		return PhotoMessage
	} else if m.Sticker != nil {
		return StickerMessage
	} else if m.Video != nil {
		return VideoMessage
	} else if m.Voice != nil {
		return VoiceMessage
	} else if m.Contact != nil {
		return ContactMessage
	} else if m.Location != nil {
		return LocationMessage
	} else if m.NewChatMember != nil {
		return NewChatMember
	} else if m.LeftChatMember != nil {
		return LeftChatMember
	} else if m.NewChatTitle != nil {
		return NewChatTitle
	} else if m.NewChatPhoto != nil {
		return NewChatPhoto
	} else if m.DeleteChatPhoto {
		return DeletedChatPhoto
	} else if m.GroupChatCreated {
		return GroupChatCreated
	} else if m.SupergroupChatCreated {
		return SupergroupChatCreated
	} else if m.ChannelChatCreated {
		return ChannelChatCreated
	} else if m.MigrateToChatID != nil {
		return MigrationToSupergroup
	} else if m.MigrateFromChatID != nil {
		return MigrationFromGroup
	} else if m.Venue != nil {
		return VenueMessage
	} else if m.PinnedMessage != nil {
		return PinnedMessage
	}

	return UnknownMessage
}
// Type determines the type of the message.
// Note that, for all these types, messages can still be replies or
// forwarded.