Added Contact Model (#34)

This commit is contained in:
Aliyss Snow
2020-02-03 00:08:36 +01:00
committed by GitHub
parent b597e4a504
commit e2351db722
7 changed files with 134 additions and 0 deletions

35
src/structures/Contact.js Normal file
View File

@@ -0,0 +1,35 @@
'use strict';
const Base = require('./Base');
/**
* Represents a Contact on WhatsApp
* @extends {Base}
*/
class Contact extends Base {
constructor(client, data) {
super(client);
if(data) this._patch(data);
}
_patch(data) {
this.id = data.id;
this.isBusiness = data.isBusiness;
this.isEnterprise = data.isEnterprise;
this.labels = data.labels;
this.name = data.name;
this.pushname = data.pushname;
this.sectionHeader = data.sectionHeader;
this.shortName = data.shortName;
this.statusMute = data.statusMute;
this.type = data.type;
this.verifiedLevel = data.verifiedLevel;
this.verifiedName = data.verifiedName;
return super._patch(data);
}
}
module.exports = Contact;