def per_chat_id_except(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 *not* 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'] not in s
                          else None)
: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 *not* in ``s``
        and chat type is in ``types``.