npm package: @nexoraa/baileys
Description: WhatsApp API Modification
Author: Kens Ransyah
Latest version: 1.0.0-rc3

# @nexoraa/baileys

**WhatsApp API Modification** - Advanced WhatsApp integration library with enhanced features and security.

## About

@nexoraa/baileys is a powerful WhatsApp API modification library developed by **@nexoraa/baileys** (Pengembang Utama / Main Developer). Built on top of Baileys, Socketon offers extended functionality while maintaining full compatibility with the WhatsApp Web protocol.

### Developer

**Kens Ransyah** adalah pengembang utama @nexoraa/baileys. Full-stack developer dengan keahlian di bidang WhatsApp API, Node.js, dan pengembangan bot otomatis. Aktif mengembangkan @nexoraa/baileys sejak 2024 dengan fokus pada keamanan, stabilitas, dan fitur lanjutan.

- GitHub: [Kens Ransyah](https://github.com/slightnich)
- Website: [Nexoraa](https://nexoraa.biz.id)

## Installation

```bash
npm install @nexoraa/baileys
```

## Requirements

- Node.js >= 20.0.0

## Quick Start

```javascript
const { makeWASocket, useMultiFileAuthState, DisconnectReason } = require('socketon');
const pino = require('pino');

async function start() {
    const { state, saveCreds } = await useMultiFileAuthState('./auth');
    
    const sock = makeWASocket({
        logger: pino({ level: 'silent' }),
        auth: state,
        printQRInTerminal: true
    });

    sock.ev.on('connection.update', async (update) => {
        const { connection, lastDisconnect } = update;
        if (connection === 'close') {
            const shouldReconnect = lastDisconnect?.error?.output?.statusCode !== DisconnectReason.loggedOut;
            if (shouldReconnect) start();
        } else if (connection === 'open') {
            console.log('Connected!');
        }
    });

    sock.ev.on('messages.upsert', async ({ messages }) => {
        const msg = messages[0];
        if (!msg.key.fromMe && msg.message) {
            console.log('Message:', msg);
        }
    });

    sock.ev.on('creds.update', saveCreds);
}

start();
```

## Features

### Messages
- Send text, image, video, audio, document
- Send stickers, locations, contacts
- Send buttons, list, template messages
- Reply, forward, delete, react to messages

### Groups
- Create, leave, delete groups
- Add/remove/promote/demote participants
- Update group subject & description
- Manage group settings

### Newsletter
- Create & manage newsletters
- Follow/unfollow newsletters
- Send & react to newsletter messages

### Authentication
- QR Code authentication
- Pairing Code authentication
- Multi-file auth state
- Session persistence

### Profile
- Update profile picture & name
- Privacy settings
- Block/unblock contacts

## API Reference

Full API documentation available at [docs/index.html](docs/index.html)

### Connection Methods
```javascript
sock.requestPairingCode(phoneNumber)  // Request pairing code
sock.logout()                          // Logout session
sock.onWhatsApp(...jids)               // Check if numbers are on WhatsApp
```

### Message Methods
```javascript
// Send text
await sock.sendMessage(jid, { text: 'Hello!' });

// Send image
await sock.sendMessage(jid, { 
    image: { url: './image.jpg' },
    caption: 'Caption'
});

// React to message
await sock.sendMessage(jid, { 
    react: { key: msg.key, text: 'emoji' }
});

// Reply to message
await sock.sendMessage(jid, { text: 'Reply' }, { quoted: msg });
```

### Group Methods
```javascript
sock.groupMetadata(jid)                           // Get group metadata
sock.groupCreate(subject, participants)           // Create group
sock.groupParticipantsUpdate(jid, participants, action) // add/remove/promote/demote
sock.groupInviteCode(jid)                         // Get invite code
sock.groupLeave(jid)                              // Leave group
```

### Newsletter Methods
```javascript
sock.newsletterCreate(name, description, reaction_codes)
sock.newsletterFollow(jid)
sock.newsletterUnfollow(jid)
sock.newsletterMetadata(type, key)
sock.newsletterReactMessage(jid, serverId, code)
```

## Events

```javascript
sock.ev.on('connection.update', callback)    // Connection state
sock.ev.on('messages.upsert', callback)      // New messages
sock.ev.on('messages.update', callback)      // Message updates
sock.ev.on('presence.update', callback)      // Presence updates
sock.ev.on('chats.upsert', callback)         // New chats
sock.ev.on('contacts.upsert', callback)      // New contacts
sock.ev.on('creds.update', callback)         // Credentials updated
```

## Terms of Service

**IMPORTANT:** By using Socketon, you agree to the following terms:

2. **Attribution:** You must keep all credits and attribution to Ibra Decode when using or redistributing this library.

3. **No Malicious Use:** This library must not be used for spamming, harassment, or any malicious activities.

4. **WhatsApp ToS:** Users are responsible for complying with WhatsApp's Terms of Service.

5. **No Warranty:** This library is provided "as is" without warranty of any kind.

6. **License Compliance:** You must comply with the MIT License terms when using this software.

## Support Development

Your donations help maintain and improve Socketon. Thank you for your support!

## Version

**1.0.0**

## License

MIT

## Links

- [Documentation](docs/index.html)

## Disclaimer

This library is for educational and legitimate purposes only. Please respect WhatsApp's Terms of Service when using this library.