def __init__(self, seed_tuple, store, exclude): # The `capture` criteria means to capture all messages. super(MessageSaver, self).__init__(seed_tuple, capture=[[lambda msg: not telepot.is_event(msg)]]) self._store = store self._exclude = exclude
def __init__(self, seed_tuple, store, info, feedback, consent, exclude): # The `capture` criteria means to capture all messages. super(MessageSaver, self).__init__(seed_tuple, capture=[[lambda msg: not telepot.is_event(msg)]]) self._store = store self._info = info self._consent = consent self._exclude = exclude self._feedback = feedback self._time = datetime.now()
def _is_newcomer(self, msg): if telepot.is_event(msg): return None chat_id = msg['chat']['id'] if chat_id == self._owner_id: # Sender is owner return None # No delegate spawned if chat_id in self._seen: # Sender has been seen before return None # No delegate spawned self._seen.add(chat_id) return [] # non-hashable ==> delegates are independent, no seed association is made.