def get_non_text_messages_grouped(groups):
    """Filters and structures messages for each group and non-text message type.

    Args:
        groups (list of lists of MyMessage objects): Messages grouped.

    Returns:
        A list of message types grouped:
        [
            {
                "groups": [list of numbers of specific messages in each group],
                "type": string type of these messages.
            }
        ]
    """
    return [
        {"groups": [len(list(filter(lambda m: m.has_audio, group))) for group in groups],
         "type": "audio"},
        {"groups": [len(list(filter(lambda m: m.has_voice, group))) for group in groups],
         "type": "voice"},
        {"groups": [len(list(filter(lambda m: m.has_photo, group))) for group in groups],
         "type": "photo"},
        {"groups": [len(list(filter(lambda m: m.has_video, group))) for group in groups],
         "type": "video"},
        {"groups": [len(list(filter(lambda m: m.has_sticker, group))) for group in groups],
         "type": "sticker"},
        {"groups": [len(list(filter(lambda m: m.is_link, group))) for group in groups],
         "type": "link"}
    ]