diff --git a/README.md b/README.md
index 232449f..ec4dcca 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ Currently in developing mode, Continous updated may encounter. :sweat_smile:
| Group Joined or Removed | `msg.paylod` : Group Name. `msg.type` : joined / Removed from group. `msg.notification` : Complete notification. `msg.chat` : Complete Group Details.
-2. **Whatsapp In** : Node to recive all messages send to connected number.
+2. **Chats In** : Node to recive all messages send to connected number.
- Simply deploy the node and wait for green (connected) status.
- After succesfully connection, Node is able to recive all messages.
@@ -44,25 +44,25 @@ Currently in developing mode, Continous updated may encounter. :sweat_smile:
|--------|-------------|
| `msg.paylod` | Recived message |
| `msg.from` | Sender Number |
- | `msg.message` | Complete message object.
*Some extra details for advace users* |
+ | `msg.chatID` | Chat ID of Group chat / Personal chat |
+ | `msg.message` | Complete message object.
*Some extra details for advance users* |
-3. **Whatsapp Out** : As simple as mention on name, node will send `msg.payload` recived at input to the number mentioned in node.
+3. **Chats Out** : As simple as mention on name, node will send `msg.payload` recived at input to the number mentioned in node.
*Don't forget to mention international dialing code befor your number. Number must be in format like `+11 99999 99999` without any space.*
4. **Group Message** : Whatsapp Group Node to send message in a Group.
+
+ The node will send recived `msg.payload` to a group chat.
- *Chat IDs are numbers given to each chats including group chats in whatsapp*
-
-For every message recived from Whatsapp-IN-Node, Chat ID can be seen at `msg.chatID`, Copy the Chat ID of a group chat and paste it in Group-Message-Node to send group message in whatsapp.
-
## Issues & Updates
----
+
Issues and Suggestions are welcome [here.](https://github.com/raweee/node-red-contrib-whatsapp-link/issues)
* `Ver-0.1.21` : Group Message Node added.
+* `Ver-0.1.23` : Nodes are formatted correctly and names are updated.
* Working on QR Code to directlly avilable in run time on Whatsapp-Admin-Node.
## Future Nodes
diff --git a/whatsappAdmin.html b/admin.html
similarity index 81%
rename from whatsappAdmin.html
rename to admin.html
index eb3eebc..94e5c98 100644
--- a/whatsappAdmin.html
+++ b/admin.html
@@ -1,5 +1,5 @@
-
-
-
-
diff --git a/whatsapp-in.js b/chats-in.js
similarity index 86%
rename from whatsapp-in.js
rename to chats-in.js
index 090ecd7..6b9a5b2 100644
--- a/whatsapp-in.js
+++ b/chats-in.js
@@ -1,13 +1,9 @@
module.exports = function(RED) {
-
-
function WhatsappIn(config) {
RED.nodes.createNode(this,config);
var node = this;
var whatsappLinkNode = RED.nodes.getNode(config.whatsappLink);
node.waClient = whatsappLinkNode.client;
-
-
function SetStatus(WAStatus, color){
node.status({fill:color,shape:"dot",text:WAStatus});
};
@@ -25,10 +21,6 @@ module.exports = function(RED) {
//whatsapp Status Parameters----
node.waClient.on('qr', (qr) => {
SetStatus("QR Code Generated", "yellow");
- // QRCode.toDataURL(qr, function(err, url){
- // msg = {payload : url};
- // node.send(msg);
- // });
});
node.waClient.on('auth_failure', () => {
@@ -48,5 +40,5 @@ module.exports = function(RED) {
});
}
- RED.nodes.registerType("whatsapp-in", WhatsappIn);
+ RED.nodes.registerType("chats-in", WhatsappIn);
}
diff --git a/whatsapp-out.html b/chats-out.html
similarity index 72%
rename from whatsapp-out.html
rename to chats-out.html
index d3c644a..66fdfc4 100644
--- a/whatsapp-out.html
+++ b/chats-out.html
@@ -1,44 +1,45 @@
-
-
+
+
+
+
+
diff --git a/whatsapp-Gout.js b/group-out.js
similarity index 80%
rename from whatsapp-Gout.js
rename to group-out.js
index 6df2f7a..ee588b7 100644
--- a/whatsapp-Gout.js
+++ b/group-out.js
@@ -4,7 +4,6 @@ module.exports = function(RED) {
var node = this;
node.gID = config.gID;
node.gID = node.gID.replace(/\D/g, '');
- //node.number = this.number.includes('@c.us') ? this.number : `${this.number}@c.us`;
node.gID = `${node.gID}@g.us`;
var whatsappLinkNode = RED.nodes.getNode(config.whatsappLink);
node.waClient = whatsappLinkNode.client;
@@ -17,10 +16,6 @@ module.exports = function(RED) {
node.log(`Error Sending Msg: ${e}`);
};
});
-
-
-
-
function SetStatus(WAStatus, color){
node.status({fill:color,shape:"dot",text:WAStatus});
};
@@ -28,10 +23,6 @@ module.exports = function(RED) {
//whatsapp Status Parameters----
node.waClient.on('qr', (qr) => {
SetStatus("QR Code Generated", "yellow");
- // QRCode.toDataURL(qr, function(err, url){
- // msg = {payload : url};
- // node.send(msg);
- // });
});
node.waClient.on('auth_failure', () => {
@@ -51,5 +42,5 @@ module.exports = function(RED) {
});
}
- RED.nodes.registerType("whatsapp-Gout", WhatsappGroupOut);
+ RED.nodes.registerType("group-out", WhatsappGroupOut);
}
diff --git a/icons/whatsappLink.svg b/icons/whatsappLink.svg
new file mode 100644
index 0000000..b679403
--- /dev/null
+++ b/icons/whatsappLink.svg
@@ -0,0 +1,10 @@
+
+
diff --git a/package.json b/package.json
index 6e6df6b..2684bfc 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,7 @@
{
"name": "node-red-contrib-whatsapp-link",
- "version": "0.1.21",
+ "version": "0.1.23",
"description": "Whatsapp connection with Node-Red | No third party APIs",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
"repository": {
"type": "git",
"url": "git+https://github.com/raweee/node-red-contrib-whatsapp-link.git"
@@ -15,18 +12,20 @@
"keywords": [
"node-red",
"whatsapp",
- "message"
+ "message",
+ "whatsapp Group",
+ "whatsapp Chat"
],
"author": "Ravi Mishra",
"license": "ISC",
"node-red": {
"version": ">=2.0",
"nodes": {
- "whatsapp admin": "whatsappAdmin.js",
- "whatsapp in": "whatsapp-in.js",
- "whatsapp Out": "whatsapp-out.js",
- "whatsapp Link": "whatsappLink.js",
- "Group Out": "whatsapp-Gout.js"
+ "whatsapp admin": "admin.js",
+ "whatsapp chats-in": "chats-in.js",
+ "whatsapp chats-out": "chats-out.js",
+ "whatsapp group-out": "group-out.js",
+ "whatsapp Link": "whatsappLink.js"
}
},
"dependencies": {
diff --git a/whatsapp-Gout.html b/whatsapp-Gout.html
deleted file mode 100644
index 5fe7f06..0000000
--- a/whatsapp-Gout.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
diff --git a/whatsappLink.html b/whatsappLink.html
index 0a587cc..142836f 100644
--- a/whatsappLink.html
+++ b/whatsappLink.html
@@ -13,11 +13,11 @@
\ No newline at end of file
diff --git a/whatsappLink.js b/whatsappLink.js
index 6349a5b..f6e44f6 100644
--- a/whatsappLink.js
+++ b/whatsappLink.js
@@ -11,8 +11,7 @@ module.exports = function(RED) {
authStrategy : new LocalAuth(),
puppeteer : {headless : true }
});
- // WAnode.log(`Client is generated`);
-
+
let WAConnect = function(){
try {
client.initialize();