whatsapp-web.js
A WhatsApp API client that connects through the WhatsApp Web browser app
It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.
@@ -332,15 +332,15 @@ client.initialize();diff --git a/docs/._Base.html b/docs/._Base.html new file mode 100644 index 0000000..df00656 Binary files /dev/null and b/docs/._Base.html differ diff --git a/docs/Base.html b/docs/Base.html index de0136e..f39f2ce 100644 --- a/docs/Base.html +++ b/docs/Base.html @@ -2,9 +2,9 @@
- + -Mutes this chat until a specified date
+| Name | +Type | +Optional | +Description | +
|---|---|---|---|
|
+ unmuteDate + |
+
+ Date + |
+
+ + |
+
+ Date at which the Chat will be unmuted + |
+
Send a message to this chat
un-archives this chat
Unmutes this chat
+Mutes the Chat until a specified date
+| Name | +Type | +Optional | +Description | +
|---|---|---|---|
|
+ chatId + |
+
+ string + |
+
+ + |
+
+ ID of the chat that will be muted + |
+
|
+ unmuteDate + |
+
+ Date + |
+
+ + |
+
+ Date when the chat will be unmuted + |
+
Force reset of connection state for the client
boolean
Unmutes the Chat
+| Name | +Type | +Optional | +Description | +
|---|---|---|---|
|
+ chatId + |
+
+ string + |
+
+ + |
+
+ ID of the chat that will be unmuted + |
+
Mutes this chat until a specified date
+| Name | +Type | +Optional | +Description | +
|---|---|---|---|
|
+ unmuteDate + |
+
+ + |
+
+ + |
+
+ Date at which the Chat will be unmuted + |
+
Promotes participants by IDs to admins
Unmutes this chat
+Source: structures/
Source: structures/
Media attached to a message
Creates a MessageMedia instance from a local file path
+| Name | +Type | +Optional | +Description | +
|---|---|---|---|
|
+ filePath + |
+
+ string + |
+
+ + |
+ + | +
Mutes this chat until a specified date
+| Name | +Type | +Optional | +Description | +
|---|---|---|---|
|
+ unmuteDate + |
+
+ + |
+
+ + |
+
+ Date at which the Chat will be unmuted + |
+
Send a message to this chat
Unmutes this chat
+A WhatsApp API client that connects through the WhatsApp Web browser app
It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.
@@ -332,15 +332,15 @@ client.initialize();'use strict';
+const fs = require('fs');
+const path = require('path');
+const mime = require('mime');
+
/**
* Media attached to a message
* @param {string} mimetype MIME type of the attachment
@@ -57,6 +61,19 @@ class MessageMedia {
*/
this.filename = filename;
}
+
+ /**
+ * Creates a MessageMedia instance from a local file path
+ * @param {string} filePath
+ * @returns {MessageMedia}
+ */
+ static fromFilePath(filePath) {
+ const b64data = fs.readFileSync(filePath, {encoding: 'base64'});
+ const mimetype = mime.getType(filePath);
+ const filename = path.basename(filePath);
+
+ return new MessageMedia(mimetype, b64data, filename);
+ }
}
module.exports = MessageMedia;
@@ -69,7 +86,7 @@ module.exports = MessageMedia;
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html
index 1d7b10a..73e4790 100644
--- a/docs/structures_PrivateChat.js.html
+++ b/docs/structures_PrivateChat.js.html
@@ -2,9 +2,9 @@
-
+
-