Chats -In and Out Update
This commit is contained in:
parent
d76ffd696a
commit
3e5fe7984d
52
README.md
52
README.md
@ -61,53 +61,7 @@ Admin Node generate QR Code just below the node for easy connection with whatsap
|
||||
| `msg.chatID` | Chat ID of Group chat / Personal chat |
|
||||
| `msg.message` | Complete message object. <br />*Some extra details for advance users* |
|
||||
|
||||
Other Events options --
|
||||
|
||||
| waWebClient | Description |
|
||||
|-------------|-------------|
|
||||
| `message`
|
||||
| `message_create`
|
||||
| `auth_failure`
|
||||
| `authenticated`
|
||||
| `change_battery`
|
||||
| `change_state`
|
||||
| `disconnected`
|
||||
| `group_join`
|
||||
| `group_leave`
|
||||
| `group_update`
|
||||
| `incoming_call`
|
||||
| `media_uploaded`
|
||||
| `message_ack`
|
||||
| `message_reaction`
|
||||
| `message_revoke_everyone`
|
||||
| `message_revoke_me`
|
||||
| `qr`
|
||||
| `ready`
|
||||
|
||||
| waSocketClient | Description |
|
||||
|-------------|----------------|
|
||||
| `messages.upsert`
|
||||
| `connection.update`
|
||||
| `creds.update`
|
||||
| `messaging-history.set`
|
||||
| `chats.upsert`
|
||||
| `chats.update`
|
||||
| `chats.delete`
|
||||
| `presence.update`
|
||||
| `contacts.upsert`
|
||||
| `contacts.update`
|
||||
| `messages.delete`
|
||||
| `messages.update`
|
||||
| `messages.media-update`
|
||||
| `messages.reaction`
|
||||
| `message-receipt.update`
|
||||
| `groups.upsert`
|
||||
| `groups.update`
|
||||
| `group-participants.update`
|
||||
| `blocklist.set`
|
||||
| `blocklist.update`
|
||||
| `call`
|
||||
|
||||
Their are many other events options avilable along with `message` event in Chats-In Node. For details refer documentation for Chats-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.
|
||||
@ -311,10 +265,6 @@ You may direct import these test button with bellow code.
|
||||
}
|
||||
]
|
||||
```
|
||||
### Screen Shots of Buttons and Image Messages.
|
||||
|
||||

|
||||
|
||||
|
||||
5. **Reply Node** : In Beta mode.
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ Node to recive all messages send to connected number.
|
||||
| `msg.chatID` | Chat ID of Group chat / Personal chat |
|
||||
| `msg.message` | Complete message object. <br />*Some extra details for advance users* |
|
||||
|
||||
Other Events options --
|
||||
Other Events options for waWebClient --
|
||||
|
||||
| waWebClient | Description |
|
||||
|-------------|-------------|
|
||||
@ -149,6 +149,8 @@ Node to recive all messages send to connected number.
|
||||
| `qr`
|
||||
| `ready`
|
||||
|
||||
Other Events options for waSocketClient --
|
||||
|
||||
| waSocketClient | Description |
|
||||
|-------------|----------------|
|
||||
| `messages.upsert`
|
||||
|
||||
@ -29,11 +29,8 @@ module.exports = function(RED) {
|
||||
try {
|
||||
numb = webNubmerSeteing(numb);
|
||||
if(typeof inputMessage === "object"){
|
||||
// inputMessage = new Buttons(inputMessage.text, inputMessage.buttons, "text" ,inputMessage.footer)
|
||||
let myBtn = new Buttons('Button body',[{body:'bt1'},{body:'bt2'},{body:'bt3'}],'title','footer');
|
||||
console.log(myBtn)
|
||||
inputMessage = new Buttons(inputMessage.text, inputMessage.buttons, "text" ,inputMessage.footer);
|
||||
node.waClient.sendMessage(numb, inputMessage);
|
||||
inputMessage = myBtn
|
||||
}
|
||||
node.waClient.sendMessage(numb, inputMessage);
|
||||
}
|
||||
@ -51,7 +48,7 @@ module.exports = function(RED) {
|
||||
const msgStatus = await client.sendMessage(numb, inputMessage);
|
||||
}
|
||||
catch(e) {
|
||||
node.error(`Error Sending Msg: ${e}`);
|
||||
node.error(`Error Sending Msg:: ${e}`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -101,7 +98,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
|
||||
} else if (message.toNumber){
|
||||
var numbers = typeof message.toNumber === 'number' ? Array.of(message.toNumber) : message.toNumber;
|
||||
var numbers = message.toNumber instanceof Array ? message.toNumber : Array.of(message.toNumber);
|
||||
for (number of numbers) {
|
||||
if(message.image){
|
||||
whatsappMultiMediaMessage(number, message.image, message.payload)
|
||||
|
||||
@ -102,7 +102,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
|
||||
} else if (message.toNumber){
|
||||
var numbers = typeof message.toNumber === 'number' ? Array.of(message.toNumber) : message.toNumber;
|
||||
var numbers = message.toNumber instanceof Array ? message.toNumber : Array.of(message.toNumber);
|
||||
for (number of numbers) {
|
||||
if(message.image){
|
||||
whatsappMultiMediaMessage(number, message.image, message.payload)
|
||||
|
||||
@ -32,7 +32,8 @@
|
||||
"dependencies": {
|
||||
"@adiwajshing/baileys": "latest",
|
||||
"whatsapp-web.js": "latest",
|
||||
"qrcode": "^1.5.1"
|
||||
"qrcode": "^1.5.1",
|
||||
"pino": "latest"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
|
||||
@ -175,10 +175,10 @@ Participants : ${chat.groupMetadata.size}`
|
||||
lastDisconnect.error.output &&
|
||||
lastDisconnect.error.output.statusCode === 401
|
||||
) {
|
||||
connectSocketClient()
|
||||
FS.rmSync(whatsappLinkDirSocket, {recursive : true, force: true})
|
||||
connectSocketClient()
|
||||
} else {
|
||||
WAnode.log('Node Refressed')
|
||||
WAnode.error(lastDisconnect?.error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user