
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@danitech/wa-web-api
Advanced tools
WhatsApp Web API - TypeScript/JavaScript. ditenagai oleh library: Baileys.
WhatsApp Web API ini ditenagai oleh library: Baileys
npm i @danitech/wa-web-api
yarn add @danitech/wa-web-api
{
"name": "whatsapp-bot",
"version": "0.0.0",
"private": true,
"main": "index.js",
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js"
},
"dependencies": {
"@danitech/wa-web-api": "latest"
},
"devDependencies": {
"nodemon": "~3.0.1"
}
}
{
"ignore": ["index.js"],
"ext": "js"
}
const wwa = require('@danitech/wa-web-api');
const fs = require('fs');
const chalk = require('chalk');
const config = require('./config/settings.js');
const client = require('./includes/client.js');
const {
makeWASocket
} = wwa;
const startServer = (config, client) => {
return makeWASocket(config, client);
};
startServer(config, client);
module.exports = {
pairing_mode: true,
session_folder_name: 'session',
browser: ["Chrome (Linux)"],
public_mode: true,
prefix: '.',
bot: {
name: 'Bot Name'
},
owner: {
name: 'Owner Name',
number: '628xxx'
}
};
const chalk = require('chalk');
const config = require('../config/settings.js');
module.exports = async ({
client,
messages
}) => {
try {
const body = messages.mtype === 'conversation' ? messages.message.conversation : messages.mtype === 'extendedTextMessage' ? messages.message.extendedTextMessage.text : '';
const budy = typeof messages.text === 'string' ? messages.text : '';
const command = body.startsWith(config.prefix) ? body.replace(config.prefix, '').trim().split(/ +/).shift().toLowerCase() : '';
const cleanCommand = command.replace(config.prefix, '');
const args = body.trim().split(/ +/).slice(1);
const query = q = args.join(' ');
const query1 = q1 = query.split('|')[0]
const query2 = q2 = query.split('|')[1]
const ownerNumbers = config.owner.number;
const senderNumber = messages.sender.replace(/\D/g, '');
const senderName = messages.pushName || 'Undefined';
const isOwner = ownerNumbers.includes(messages.sender);
if (!config.public_mode) {
if (!messages.key.fromMe) {
return;
};
};
if (messages.message) {
client.readMessages([messages.key]);
console.log(
chalk.bgMagenta(' [New Message] '),
chalk.cyanBright('Time: ') + chalk.greenBright(new Date()) + '\n',
chalk.cyanBright('Message: ') + chalk.greenBright(budy || messages.mtype) + '\n' +
chalk.cyanBright('From:'), chalk.greenBright(senderName), chalk.yellow('- ' + senderNumber) + '\n' +
chalk.cyanBright('Chat Type:'), chalk.greenBright(!messages.isGroup ? 'Private Chat' : 'Group Chat - ' + chalk.yellow(messages.chat))
);
};
if (!body.startsWith(config.prefix) || body === config.prefix) {
return;
};
switch (cleanCommand) {
case 'test': {
messages.reply('Ok, Success!');
break;
};
default: {
messages.reply(`Command: ${config.prefix}${cleanCommand}, tidak tersedia!`);
};
};
} catch (error) {
messages.reply('Terjadi kesalahan pada server.');
console.error(error);
};
};
Klik disini untuk mengunduh proyek.
FAQs
WhatsApp Web API - TypeScript/JavaScript. ditenagai oleh library: Baileys.
The npm package @danitech/wa-web-api receives a total of 22 weekly downloads. As such, @danitech/wa-web-api popularity was classified as not popular.
We found that @danitech/wa-web-api demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.