How to use the deltachat.Contact 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 / bot.py View on Github external
def get_contact(self, ref):
        """ return Contact object (create one if needed) for the specified 'ref'.

        ref can be a Contact, email address string or contact id.
        """
        if isinstance(ref, str):
            return self.account.create_contact(ref)
        elif isinstance(ref, int):
            return self.account.get_contact_by_id(ref)
        elif isinstance(ref, Contact):
            return ref