diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..6cdebaf --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -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}} diff --git a/README.md b/README.md index 3ff6871..ec8e491 100644 --- a/README.md +++ b/README.md @@ -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.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.37` : Changes for correction of send message with images and use Chromium profiles in Puppeteer. ## Future Nodes Currently working on more Whatsapp Node and will be avilable soon - diff --git a/chats-out.js b/chats-out.js index 0abbcef..40277c0 100644 --- a/chats-out.js +++ b/chats-out.js @@ -77,7 +77,7 @@ module.exports = function(RED) { var whatsappImageBase64 = whatsappImage.split(',')[1] || whatsappImage; try { if (node.waClient.clientType === "waWebClient"){ - numb = await webNubmerSeteing(node.number) + numb = await webNubmerSeteing(numb) var myMessage = new MessageMedia('image/png', whatsappImageBase64, null, null); node.waClient.sendMessage(numb, myMessage, {caption : whatsappCaption || "Image from Node-Red"}); } diff --git a/package-lock.json b/package-lock.json index 1cd6ea8..fcb40ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-red-contrib-whatsapp-link", - "version": "0.1.32-A", + "version": "0.1.37-A", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "node-red-contrib-whatsapp-link", - "version": "0.1.32-A", + "version": "0.1.37-A", "license": "ISC", "dependencies": { "@adiwajshing/baileys": "latest", diff --git a/package.json b/package.json index 7e0fd64..4e69808 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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", "repository": { "type": "git", diff --git a/whatsappLink.js b/whatsappLink.js index fbcb557..ff07576 100644 --- a/whatsappLink.js +++ b/whatsappLink.js @@ -29,7 +29,7 @@ module.exports = function(RED) { }), puppeteer : { 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); -} \ No newline at end of file +}