
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
@shizodevs/baileys
Advanced tools
The original repository was initially removed by its creator and subsequently taken over by WhiskeySockets. Building upon this foundation, I have implemented several enhancements and introduced new features that were not present in the original repository. These improvements aim to elevate functionality and empower the open source codes and versatile experience.
Install in package.json:
"dependencies": {
"@shizodevs/baileys": "*"
}
or install in terminal:
npm install @shizodevs/baileys
Then import the default function in your code:
// type esm
import makeWASocket from '@shizodevs/baileys'
// type cjs
const { default: makeWASocket } = require("@shizodevs/baileys")
Here are some of the features and improvements I have added:
Support for Sending Messages to Channels: You can now easily send messages to channels.
Support for Button Messages and Interactive Messages: Added the ability to send messages with buttons and interactive messages.
AI Message Icon: Added customizable AI icon settings for messages
Profile Picture Settings: Allows users to upload profile pictures in their original size without cropping, ensuring better quality and visual presentation.
Custom Pairing Code: Users can now create and customize pairing codes as they wish, enhancing convenience and security when connecting devices.
Libsignal Fixes: Cleaned up logs for a cleaner and more informative output.
More features and improvements will be added in the future.
const metadata = await sock.newsletterMetadata("invite", "xxxxx")
// or
const metadata = await sock.newsletterMetadata("jid", "abcd@newsletter")
console.log(metadata)
await sock.newsletterUpdateDescription("abcd@newsletter", "New Description")
await sock.newsletterUpdateName("abcd@newsletter", "New Name")
await sock.newsletterUpdatePicture("abcd@newsletter", buffer)
await sock.newsletterRemovePicture("abcd@newsletter")
await sock.newsletterUnmute("abcd@newsletter")
await sock.newsletterMute("abcd@newsletter")
const metadata = await sock.newsletterCreate("Newsletter Name", "Newsletter Description")
console.log(metadata)
await sock.newsletterDelete("abcd@newsletter")
await sock.newsletterFollow("abcd@newsletter")
await sock.newsletterUnfollow("abcd@newsletter")
// jid, id message & emoticon
// way to get the ID is to copy the message url from channel
// Example: [ https://whatsapp.com/channel/xxxxx/175 ]
// The last number of the URL is the ID
const id = "175"
await sock.newsletterReactMessage("abcd@newsletter", id, "🥳")
const buttons = [
{ buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
{ buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]
const buttonMessage = {
text: "Hi it's button message",
footer: 'Hello World',
buttons,
headerType: 1,
viewOnce: true
}
await sock.sendMessage(id, buttonMessage, { quoted: null })
const buttons = [
{ buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
{ buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]
const buttonMessage = {
image: { url: "https://example.com/abcd.jpg" }, // image: buffer or path
caption: "Hi it's button message with image",
footer: 'Hello World',
buttons,
headerType: 1,
viewOnce: true
}
await sock.sendMessage(id, buttonMessage, { quoted: null })
const buttons = [
{ buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
{ buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]
const buttonMessage = {
video: { url: "https://example.com/abcd.mp4" }, // video: buffer or path
caption: "Hi it's button message with video",
footer: 'Hello World',
buttons,
headerType: 1,
viewOnce: true
}
await sock.sendMessage(id, buttonMessage, { quoted: null })
const interactiveButtons = [
{
name: "quick_reply",
buttonParamsJson: JSON.stringify({
display_text: "Quick Reply",
id: "ID"
})
},
{
name: "cta_url",
buttonParamsJson: JSON.stringify({
display_text: "Tap Here!",
url: "https://www.example.com/"
})
},
{
name: "cta_copy",
buttonParamsJson: JSON.stringify({
display_text: "Copy Code",
id: "12345",
copy_code: "12345"
})
}
]
const interactiveMessage = {
text: "Hello World!",
title: "this is the title",
footer: "this is the footer",
interactiveButtons
}
await sock.sendMessage(id, interactiveMessage, { quoted: null })
const interactiveButtons = [
{
name: "quick_reply",
buttonParamsJson: JSON.stringify({
display_text: "Quick Reply",
id: "ID"
})
},
{
name: "cta_url",
buttonParamsJson: JSON.stringify({
display_text: "Tap Here!",
url: "https://www.example.com/"
})
},
{
name: "cta_copy",
buttonParamsJson: JSON.stringify({
display_text: "Copy Code",
id: "12345",
copy_code: "12345"
})
}
]
const interactiveMessage = {
image: { url: "https://example.com/abcd.jpg" }, // image: buffer or path
caption: "this is the caption",
title: "this is the title",
footer: "this is the footer",
interactiveButtons
}
await sock.sendMessage(id, interactiveMessage, { quoted: null })
const interactiveButtons = [
{
name: "quick_reply",
buttonParamsJson: JSON.stringify({
display_text: "Quick Reply",
id: "ID"
})
},
{
name: "cta_url",
buttonParamsJson: JSON.stringify({
display_text: "Tap Here!",
url: "https://www.example.com/"
})
},
{
name: "cta_copy",
buttonParamsJson: JSON.stringify({
display_text: "Copy Code",
id: "12345",
copy_code: "12345"
})
}
]
const interactiveMessage = {
video: { url: "https://example.com/abcd.mp4" }, // video: buffer or path
caption: "this is the caption",
title: "this is the title",
footer: "this is the footer",
interactiveButtons
}
await sock.sendMessage(id, interactiveMessage, { quoted: null })
// just add "ai: true" function to sendMessage
await sock.sendMessage(id, { text: "Hello Wold", ai: true })
if(usePairingCode && !sock.authState.creds.registered) {
const phoneNumber = await question('Please enter your mobile phone number:\n')
const custom = "SH1Z0D3V" // must be 8 digits, can be letters or numbers
const code = await sock.requestPairingCode(phoneNumber, custom)
console.log(`Pairing code: ${code?.match(/.{1,4}/g)?.join('-') || code}`)
}
If you encounter any issues while using this repository or any part of it, please feel free to open a new issue here.
Everything other than the modifications mentioned above remains the same as the original repository. You can check out the original repository at WhiskeySockets
FAQs
WhatsApp API
The npm package @shizodevs/baileys receives a total of 1 weekly downloads. As such, @shizodevs/baileys popularity was classified as not popular.
We found that @shizodevs/baileys demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.