This commit is contained in:
Pedro Lopez
2020-02-26 00:40:51 -04:00
3 changed files with 73 additions and 14 deletions

View File

@@ -50,6 +50,12 @@ class Chat extends Base {
*/
this.timestamp = data.t;
/**
* Indicates if the Chat is archived
* @type {boolean}
*/
this.archived = data.archive;
return super._patch(data);
}
@@ -82,6 +88,21 @@ class Chat extends Base {
return window.WWebJS.sendDeleteChat(chatId);
}, this.id._serialized);
}
/**
* Archives this chat
*/
async archive() {
return this.client.archiveChat(this.id._serialized);
}
/**
* un-archives this chat
*/
async unarchive() {
return this.client.unarchiveChat(this.id._serialized);
}
}
module.exports = Chat;