Chats-out Updated
This commit is contained in:
parent
1ff3f43b66
commit
79331bbedc
11
README.md
11
README.md
@ -21,8 +21,8 @@ Currently in developing mode, Continous updated may encounter. :sweat_smile:
|
||||
| Inputs | Description |
|
||||
|--------|-------------- |
|
||||
| test | Checks the current status of whatsapp and output the same in `msg.payload`|
|
||||
| destroy| Close the client and destroy the connection.|
|
||||
| restart | Restart the whatsapp client |
|
||||
| destroy| Close the client and destroy the whatsapp connection.|
|
||||
| restart | Restart the whatsapp connection. |
|
||||
| logout | Simply log you out and close the session. |
|
||||
---
|
||||
|
||||
@ -36,15 +36,14 @@ Currently in developing mode, Continous updated may encounter. :sweat_smile:
|
||||
|
||||
|
||||
2. **Whatsapp In** : Node to recive all messages send to connected number.
|
||||
- Simply deploy the node and wait for connected (green) status.
|
||||
- Simply deploy the node and wait for green (connected) status.
|
||||
- After succesfully connection, Node is able to recive all messages.
|
||||
- Messages can be read at `msg.payload` and `msg.body`.
|
||||
- Sender number can be read at `msg.from`.
|
||||
- Please look complete `{msg}` to get all details about recived message.
|
||||
|
||||
| TEST |
|
||||
| -----|
|
||||
| Try to send `!nodered` to connected whatsapp number and get a `Hi` in reply from Node-Red.
|
||||
|
||||
*Try to send `!nodered` to connected whatsapp number and get a `Hi` in reply from Node-Red.*
|
||||
|
||||
3. **Whatsapp Out** : As simple as mention on name, node will send `msg.payload` recived at input to the number mentioned in node.
|
||||
|
||||
|
||||
@ -31,11 +31,8 @@ module.exports = function(RED) {
|
||||
SetStatus('Not Connected','red');
|
||||
});
|
||||
|
||||
node.waClient.on('loading_screen', (percentage, topic) => {
|
||||
node.waClient.on('loading_screen', () => {
|
||||
SetStatus('Connecting...','yellow');
|
||||
msg.payload = percentage;
|
||||
msg.topic = topic;
|
||||
node.send(msg);
|
||||
});
|
||||
|
||||
node.waClient.on('ready', () => {
|
||||
|
||||
@ -35,6 +35,23 @@ module.exports = function(RED) {
|
||||
};
|
||||
});
|
||||
|
||||
//Group Add/leave status-----
|
||||
node.waClient.on('group_join', (msg)=>{
|
||||
node.send(msg);
|
||||
console.log(msg);
|
||||
msg.reply('!Node-Red joined');
|
||||
});
|
||||
|
||||
node.waClient.on('group_leave', (msg)=>{
|
||||
node.send(msg);
|
||||
msg.reply('!Node-Red leave');
|
||||
});
|
||||
|
||||
node.waClient.on('group_update', (msg)=>{
|
||||
node.send(msg);
|
||||
});
|
||||
|
||||
|
||||
//whatsapp Status Parameters----
|
||||
node.waClient.on('qr', (qr) => {
|
||||
SetStatus("QR Code Generated", "yellow");
|
||||
|
||||
@ -20,6 +20,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
catch(e) {
|
||||
WAnode.log(`Error : ${e}`);
|
||||
WARestart();
|
||||
};
|
||||
|
||||
client.on("qr", (qr)=>{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user