Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
    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.
Exemplo n.º 4
0
    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.
Exemplo n.º 5
0
 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