Пример #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 amanobot.is_event(msg)]
                                   ])
     self._store = store
     self._exclude = exclude
Пример #2
0
    def _is_newcomer(self, msg):
        if amanobot.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.