
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
wa-multi-session-fb
Advanced tools
Connecting Your app with Whatsapp Messaging
Lightweight library for whatsapp. Not require Selenium or any other browser.
Stand above Baileys Library.
Install package using npm
npm install wa-multi-session@latest
Then import your code
Using JS Module
import * as whatsapp from "wa-multi-session";
or using CommonJS
const whatsapp = require("wa-multi-session");
Start New Session
// create session with ID : mysessionid
const session = await whatsapp.startSession("mysessionid");
// Then, scan QR on terminal
Get All Session ID
const sessions = whatsapp.getAllSession();
// returning all session ID that has been created
Get Session Data By ID
const session = whatsapp.getSession("mysessionid");
// returning session data
Load Session From Storage / Load Saved Session
whatsapp.loadSessionsFromStorage();
// Start saved session without scan again
Send Text Message
await whatsapp.sendTextMessage({
sessionId: "mysessionid", // session ID
to: "6281234567890", // always add country code (ex: 62)
text: "Hi There, This is Message from Server!", // message you want to send
});
Send Image
const image = fs.readFileSync("./myimage.png"); // return Buffer
const send = await whatsapp.sendImage({
sessionId: "session1",
to: "6281234567890",
text: "My Image Caption",
media: image, // can from URL too
});
Send Video
const video = fs.readFileSync("./myvideo.mp4"); // return Buffer
const send = await whatsapp.sendVideo({
sessionId: "session1",
to: "6281234567890",
text: "My Video Caption",
media: video, // can from URL too
});
Send Document File
const filename = "mydocument.docx";
const document = fs.readFileSync(filename); // return Buffer
const send = await whatsapp.sendDocument({
sessionId: "session1",
to: "6281234567890",
filename: filename,
media: document,
text: "Hei, Check this Document",
});
Send Voice Note
const filename = "myaudio.mp3";
const audio = fs.readFileSync(filename); // return Buffer
const send = await whatsapp.sendVoiceNote({
sessionId: "session1",
to: "6281234567890",
media: audio,
});
Read a Message
await whatsapp.readMessage({
sessionId: "session1",
key: msg.key,
});
Send Typing Effect
await whatsapp.sendTyping({
sessionId: "session1",
to: "6281234567890",
duration: 3000,
});
Add Listener/Callback When Receive a Message
whatsapp.onMessageReceived((msg) => {
console.log(`New Message Received On Session: ${msg.sessionId} >>>`, msg);
});
Add Listener/Callback When QR Printed
whatsapp.onQRUpdated(({ sessionId, qr }) => {
console.log(qr);
});
Add Listener/Callback When Session Connected
whatsapp.onConnected((sessionId) => {
console.log("session connected :" + sessionId);
});
whatsapp.onMessageReceived(async (msg) => {
if (msg.key.fromMe || msg.key.remoteJid.includes("status")) return;
await whatsapp.readMessage({
sessionId: msg.sessionId,
key: msg.key,
});
await whatsapp.sendTyping({
sessionId: msg.sessionId,
to: msg.key.remoteJid,
duration: 3000,
});
await whatsapp.sendTextMessage({
sessionId: msg.sessionId,
to: msg.key.remoteJid,
text: "Hello!",
answering: msg, // for quoting message
});
});
wa.onMessageReceived(async (msg) => {
if (msg.message?.imageMessage) {
// save image
msg.saveImage("./myimage.jpg");
}
if (msg.message?.videoMessage) {
// save video
msg.saveVideo("./myvideo.mp4");
}
if (msg.message?.documentMessage) {
// save document
msg.saveDocument("./mydocument"); // without extension
}
});
Set custom credentials directory
// default dir is "wa_credentials"
whatsapp.setCredentialsDir("my_custom_dir");
// or : credentials/mycreds
What's New:
If you have any feedback or support, please reach out to me at mimamch28@gmail.com
FAQs
Multi Session Whatsapp Library
The npm package wa-multi-session-fb receives a total of 0 weekly downloads. As such, wa-multi-session-fb popularity was classified as not popular.
We found that wa-multi-session-fb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.