Merge pull request #25 from odv1983/main

Corrections to send image and create new chromium profiles
This commit is contained in:
Ravi Mishra 2023-03-23 00:02:37 +05:30 committed by GitHub
commit a8d39d598e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 6 deletions

33
.github/workflows/npm-publish.yml vendored Normal file
View File

@ -0,0 +1,33 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Node.js Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm test
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

View File

@ -162,6 +162,7 @@ Issues and Suggestions are welcome [here.](https://github.com/raweee/node-red-co
* `Ver-0.1.33` : Button and list support added, Minnor bugs fixed. * `Ver-0.1.33` : Button and list support added, Minnor bugs fixed.
* `Ver-0.1.34` : Multiple Events reading options are added in Chats-In Node. * `Ver-0.1.34` : Multiple Events reading options are added in Chats-In Node.
* `Ver-0.1.36` : Check box added to show status as `Online/Offline` in Whatsapp-Link Node, to get push notifications. Ping-Interval added to keep whatsapp alive for long time. Multiple examples added. * `Ver-0.1.36` : Check box added to show status as `Online/Offline` in Whatsapp-Link Node, to get push notifications. Ping-Interval added to keep whatsapp alive for long time. Multiple examples added.
* `Ver-0.1.37` : Changes for correction of send message with images and use Chromium profiles in Puppeteer.
## Future Nodes ## Future Nodes
Currently working on more Whatsapp Node and will be avilable soon - Currently working on more Whatsapp Node and will be avilable soon -

View File

@ -77,7 +77,7 @@ module.exports = function(RED) {
var whatsappImageBase64 = whatsappImage.split(',')[1] || whatsappImage; var whatsappImageBase64 = whatsappImage.split(',')[1] || whatsappImage;
try { try {
if (node.waClient.clientType === "waWebClient"){ if (node.waClient.clientType === "waWebClient"){
numb = await webNubmerSeteing(node.number) numb = await webNubmerSeteing(numb)
var myMessage = new MessageMedia('image/png', whatsappImageBase64, null, null); var myMessage = new MessageMedia('image/png', whatsappImageBase64, null, null);
node.waClient.sendMessage(numb, myMessage, {caption : whatsappCaption || "Image from Node-Red"}); node.waClient.sendMessage(numb, myMessage, {caption : whatsappCaption || "Image from Node-Red"});
} }

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "node-red-contrib-whatsapp-link", "name": "node-red-contrib-whatsapp-link",
"version": "0.1.32-A", "version": "0.1.37-A",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "node-red-contrib-whatsapp-link", "name": "node-red-contrib-whatsapp-link",
"version": "0.1.32-A", "version": "0.1.37-A",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@adiwajshing/baileys": "latest", "@adiwajshing/baileys": "latest",

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-whatsapp-link", "name": "node-red-contrib-whatsapp-link",
"version": "0.1.36A", "version": "0.1.37-A",
"description": "Node to send and receive whatsapp messages in groups and chats. | No third party APIs", "description": "Node to send and receive whatsapp messages in groups and chats. | No third party APIs",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -29,7 +29,7 @@ module.exports = function(RED) {
}), }),
puppeteer : { puppeteer : {
headless : true, headless : true,
args : ['--no-sandbox', '--disable-setuid-sandbox'] args : ['--no-sandbox', '--disable-setuid-sandbox', '--user-data-dir=' + node.id]
} }
}); });
@ -263,4 +263,4 @@ Participants : ${chat.groupMetadata.size}`
} }
RED.nodes.registerType("whatsappLink",RemoteClientNode); RED.nodes.registerType("whatsappLink",RemoteClientNode);
} }