How to use the wechaty.Contact function in wechaty

To help you get started, we’ve selected a few wechaty 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 hczhcz / wechaty-telegram / wechaty-telegram.js View on Github external
_wxContact(userId) {
        return wechaty.Contact.find({
            alias: '#' + userId,
        }).then((contact) => {
            if (contact) {
                return contact;
            }

            if (this._buffers.contact[userId]) {
                // data in the buffer may be out of date
                return this._buffers.contact[userId];
            }

            return new errors.TelegramError('contact not found');
        });
    }