Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-whatsapp-bot-api

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-whatsapp-bot-api - npm Package Compare versions

Comparing version 1.4.4 to 1.4.5

2

dist/types/index.d.ts

@@ -309,5 +309,5 @@ // Generated by dts-bundle-generator v8.0.1

export interface IListenerMessage {
contact: IContact;
message_id: string;
metadata: IMetadata;
from: string;
timestamp: number;

@@ -314,0 +314,0 @@ type: AllMessageType;

@@ -12,3 +12,3 @@ "use strict";

*/
function messageHandler(self, message, metadata) {
function messageHandler(self, message, metadata, contact) {
self.logger.info(`Handling message: ${JSON.stringify({ message, metadata })}`);

@@ -27,10 +27,10 @@ const isReplyMessage = repliedToMessage(message);

// Handle text messages
const { timestamp, from, id, text } = message;
const { timestamp, id: message_id, text } = message;
self.logger.info(`Received text message: ${text.body}`);
const textMessage = {
metadata,
contact,
timestamp: +timestamp,
text,
from,
metadata,
message_id: id,
message_id,
type: message_1.AllMessageTypes.TEXT,

@@ -37,0 +37,0 @@ messaging_product: change_1.AllMessagingProductTypes.WHATSAPP,

@@ -83,3 +83,3 @@ "use strict";

messages.forEach((message) => {
(0, messageHandler_1.messageHandler)(self, message, metadata);
(0, messageHandler_1.messageHandler)(self, message, metadata, contacts[0]);
});

@@ -86,0 +86,0 @@ }

{
"name": "node-whatsapp-bot-api",
"version": "1.4.4",
"version": "1.4.5",
"description": "WhatsApp Bot that can be used as middleware to emit events to listeners. Listeners can react to incoming messages. Additionally, the WhatsApp bot can send messages if a WhatsApp Cloud API token is provided.",

@@ -12,4 +12,4 @@ "main": "dist/index.js",

"start": "node ./dist/index-bundle.js",
"build": "tsc --project ./tsconfig.json && dts-bundle-generator -o dist/types/index.d.ts ./src/index.ts",
"build:watch": "tsc --watch --project ./tsconfig.json",
"build": "rm -rf ./dist && tsc --project ./tsconfig.json && dts-bundle-generator -o dist/types/index.d.ts ./src/index.ts",
"build:watch": "rm -rf ./dist && tsc --watch --project ./tsconfig.json",
"bundle-types": "dts-bundle-generator -o dist/types/index.d.ts ./src/index.ts",

@@ -16,0 +16,0 @@ "test": "jest --verbose",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc