feat: send messages with attachments

close #3
This commit is contained in:
Pedro Lopez
2020-02-03 23:40:49 -04:00
parent e717915f94
commit a098d61b03
7 changed files with 161 additions and 26 deletions

View File

@@ -0,0 +1,31 @@
'use strict';
/**
* Media attached to a message
* @param {string} mimetype MIME type of the attachment
* @param {string} data Base64-encoded data of the file
* @param {?string} filename Document file name
*/
class MessageMedia {
constructor(mimetype, data, filename) {
/**
* MIME type of the attachment
* @type {string}
*/
this.mimetype = mimetype;
/**
* Base64 encoded data that represents the file
* @type {string}
*/
this.data = data;
/**
* Name of the file (for documents)
* @type {?string}
*/
this.filename = filename;
}
}
module.exports = MessageMedia;