:param s:
        a list or set of chat id

    :param types:
        ``all`` or a list of chat types (``private``, ``group``, ``channel``)

    :return:
        a seeder function that returns the chat id only if the chat id is in ``s``
        and chat type is in ``types``.

def per_chat_id_in(s, types='all'):
    """
    :param s:
        a list or set of chat id

    :param types:
        ``all`` or a list of chat types (``private``, ``group``, ``channel``)

    :return:
        a seeder function that returns the chat id only if the chat id is in ``s``
        and chat type is in ``types``.
    """
    return _wrap_none(lambda msg:
                          msg['chat']['id']
                          if (types == 'all' or msg['chat']['type'] in types) and msg['chat']['id'] in s
                          else None)