Message send notiy added
This commit is contained in:
parent
cfe2ed0e9d
commit
65484961e2
@ -16,6 +16,10 @@ module.exports = function(RED) {
|
||||
node.number = `${node.number}@c.us`;
|
||||
try {
|
||||
node.waClient.sendMessage(node.number, message.payload);
|
||||
SetStatus("Message Send.", "green");
|
||||
setTimeout(()=>{
|
||||
SetStatus('Connected','green');
|
||||
}, 3000)
|
||||
}
|
||||
catch(e) {
|
||||
node.log(`Error Sending Msg: ${e}`);
|
||||
|
||||
12
group-out.js
12
group-out.js
@ -6,12 +6,21 @@ module.exports = function(RED) {
|
||||
var whatsappLinkNode = RED.nodes.getNode(config.whatsappLink);
|
||||
node.waClient = whatsappLinkNode.client;
|
||||
|
||||
SetStatus("Message Send.", "green");
|
||||
setTimeout(()=>{
|
||||
SetStatus('Connected','green');
|
||||
}, 3000)
|
||||
|
||||
node.on('input', (message)=> {
|
||||
if(node.gID){
|
||||
try {
|
||||
node.gID = node.gID.replace(/\D/g, '');
|
||||
node.gID = `${node.gID}@g.us`;
|
||||
node.waClient.sendMessage(node.gID, message.payload);
|
||||
SetStatus("Message Send.", "green");
|
||||
setTimeout(()=>{
|
||||
SetStatus('Connected','green');
|
||||
}, 3000)
|
||||
}
|
||||
catch(e) {
|
||||
node.log(`Error Sending Msg: ${e}`);
|
||||
@ -24,9 +33,6 @@ module.exports = function(RED) {
|
||||
}, 5000)
|
||||
};
|
||||
});
|
||||
function SetStatus(WAStatus, color){
|
||||
node.status({fill:color,shape:"dot",text:WAStatus});
|
||||
};
|
||||
|
||||
//whatsapp Status Parameters----
|
||||
node.waClient.on('qr', (qr) => {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "node-red-contrib-whatsapp-link",
|
||||
"version": "0.1.25",
|
||||
"description": "Whatsapp connection with Node-Red | No third party APIs",
|
||||
"version": "0.1.26",
|
||||
"description": "Node to send and recive whatsapp chats and group messages. | No third party APIs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/raweee/node-red-contrib-whatsapp-link.git"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user