How to use the deltachat.account_hookimpl function in deltachat

To help you get started, we’ve selected a few deltachat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deltachat / deltabot / src / deltabot / pytestplugin.py View on Github external
    @account_hookimpl
    def ac_incoming_message(self, message):
        if message.chat == self.bot_chat:
            self._replies.put(message)
github deltachat / deltabot / src / deltabot / bot.py View on Github external
    @account_hookimpl
    def ac_message_delivered(self, message):
        self.logger.info("message id={} chat={} delivered to smtp".format(
            message.id, message.chat.id))
github deltachat / deltabot / src / deltabot / bot.py View on Github external
    @account_hookimpl
    def ac_incoming_message(self, message):
        # we always accept incoming messages to remove the need  for
        # bot authors to having to deal with deaddrop/contact requests.
        message.accept_sender_contact()
        self.logger.info("incoming message from {} id={} chat={} text={!r}".format(
            message.get_sender_contact().addr,
            message.id, message.chat.id, message.text[:50]))

        # message is now in fresh state, schedule a check
        self._checks.put(CheckAll(self.bot))