@rakku-kun/baileys 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -52
- package/lib/Socket/newsletter.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://files.catbox.moe/f8tj1b.png" alt="
|
|
2
|
+
<img src="https://files.catbox.moe/f8tj1b.png" alt="Rakku Bot" width="150"/>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<h1 align="center"
|
|
5
|
+
<h1 align="center">⚡ Rakku Baileys</h1>
|
|
6
6
|
<p align="center">
|
|
7
7
|
<strong>TypeScript-based WhatsApp Multi-Device Library</strong><br/>
|
|
8
8
|
With intelligent @lid/@jid mapping and advanced message handling
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<a href="https://github.com/
|
|
13
|
-
<a href="https://github.com/
|
|
14
|
-
<a href="https://www.npmjs.com/package/@
|
|
15
|
-
<a href="https://www.npmjs.com/package/@
|
|
12
|
+
<a href="https://github.com/rakku-kundev/rakku-baileys/stargazers"><img src="https://img.shields.io/github/stars/rakku-kundev/rakku-baileys?style=flat-square&logo=github" alt="GitHub Stars"/></a>
|
|
13
|
+
<a href="https://github.com/rakku-kundev/rakku-baileys/issues"><img src="https://img.shields.io/github/issues/rakku-kundev/rakku-baileys?style=flat-square&logo=github" alt="GitHub Issues"/></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@rakku-kun/baileys"><img src="https://img.shields.io/npm/v/@rakku-kun/baileys?style=flat-square&logo=npm" alt="npm Version"/></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@rakku-kun/baileys"><img src="https://img.shields.io/npm/dt/@rakku-kun/baileys?style=flat-square&logo=npm" alt="npm Downloads"/></a>
|
|
16
16
|
<img src="https://img.shields.io/badge/License-MIT-green?style=flat-square" alt="License"/>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
@@ -21,37 +21,37 @@
|
|
|
21
21
|
## 🌟 Features
|
|
22
22
|
|
|
23
23
|
### Core Features
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
24
|
+
- **⚡ Intelligent `@lid` and `@jid` Mapping** - Automatic resolution of LID to phone JID
|
|
25
|
+
- **⚡ Multi-Device Support** - Full support for WhatsApp multi-device protocol
|
|
26
|
+
- **⚡ End-to-End Encryption** - Complete E2EE support for secure messaging
|
|
27
|
+
- **⚡ All Message Types** - Support for text, media, polls, reactions, and more
|
|
28
|
+
- **⚡ TypeScript Based** - Type-safe with modern TypeScript
|
|
29
|
+
- **⚡ High Performance** - Optimized for speed and efficiency
|
|
30
30
|
|
|
31
31
|
### Advanced Features
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
32
|
+
- **⚡ Media Handling** - Send/receive images, videos, audio, stickers, documents
|
|
33
|
+
- **⚡ Pairing Code Login** - Easy authentication with custom pairing code "MURUSAMA"
|
|
34
|
+
- **⚡ Newsletter/Channel Support** - Full support for WhatsApp channels
|
|
35
|
+
- **⚡ Group Management** - Complete group controls and administration
|
|
36
|
+
- **⚡ Story/Broadcast** - Send and manage stories and broadcast lists
|
|
37
|
+
- **⚡ Business API** - Support for WhatsApp Business features
|
|
38
|
+
- **⚡ Poll Messages** - Create and manage poll messages with vote tracking
|
|
39
|
+
- **⚡ Reaction Messages** - Send and receive emoji reactions
|
|
40
|
+
- **⚡ Pin Messages** - Pin important messages in chats
|
|
41
|
+
- **⚡ Disappearing Messages** - Configure ephemeral messages
|
|
42
|
+
- **⚡ Contact Messages** - Send vCard contacts
|
|
43
|
+
- **⚡ Location Messages** - Share live and static locations
|
|
44
|
+
- **⚡ Button Messages** - Interactive button messages (where supported)
|
|
45
|
+
- **⚡ List Messages** - Interactive list messages
|
|
46
|
+
- **⚡ Template Messages** - Pre-defined message templates
|
|
47
47
|
|
|
48
48
|
### Developer Friendly
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
49
|
+
- **⚡ Clean API** - Simple and intuitive API design
|
|
50
|
+
- **⚡ Event-Driven** - Comprehensive event system for all actions
|
|
51
|
+
- **⚡ Auth Storage** - Multi-file and single-file auth state options
|
|
52
|
+
- **⚡ In-Memory Store** - Built-in store for chats, contacts, messages
|
|
53
|
+
- **⚡ Customizable** - Easy to extend and customize
|
|
54
|
+
- **⚡ Well Documented** - Comprehensive documentation and examples
|
|
55
55
|
|
|
56
56
|
---
|
|
57
57
|
|
|
@@ -59,17 +59,17 @@
|
|
|
59
59
|
|
|
60
60
|
### npm
|
|
61
61
|
```bash
|
|
62
|
-
npm install @
|
|
62
|
+
npm install @rakku-kun/baileys
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
### yarn
|
|
66
66
|
```bash
|
|
67
|
-
yarn add @
|
|
67
|
+
yarn add @rakku-kun/baileys
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
### pnpm
|
|
71
71
|
```bash
|
|
72
|
-
pnpm add @
|
|
72
|
+
pnpm add @rakku-kun/baileys
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
---
|
|
@@ -78,7 +78,7 @@ pnpm add @ryuhan/baileys
|
|
|
78
78
|
|
|
79
79
|
### Basic Example
|
|
80
80
|
```typescript
|
|
81
|
-
import makeWASocket, { DisconnectReason, useMultiFileAuthState } from '@
|
|
81
|
+
import makeWASocket, { DisconnectReason, useMultiFileAuthState } from '@rakku-kun/baileys'
|
|
82
82
|
import { Boom } from '@hapi/boom'
|
|
83
83
|
|
|
84
84
|
async function connectToWhatsApp() {
|
|
@@ -108,7 +108,7 @@ async function connectToWhatsApp() {
|
|
|
108
108
|
|
|
109
109
|
// Reply to message
|
|
110
110
|
await sock.sendMessage(m.key.remoteJid!, {
|
|
111
|
-
text: 'Hello! I am
|
|
111
|
+
text: 'Hello! I am Rakku Bot ⚡'
|
|
112
112
|
})
|
|
113
113
|
}
|
|
114
114
|
})
|
|
@@ -125,7 +125,7 @@ connectToWhatsApp()
|
|
|
125
125
|
|
|
126
126
|
### Pairing Code (Recommended)
|
|
127
127
|
```typescript
|
|
128
|
-
import makeWASocket from '@
|
|
128
|
+
import makeWASocket from '@rakku-kun/baileys'
|
|
129
129
|
|
|
130
130
|
const sock = makeWASocket({
|
|
131
131
|
printQRInTerminal: false
|
|
@@ -135,13 +135,13 @@ const sock = makeWASocket({
|
|
|
135
135
|
if (!sock.authState.creds.registered) {
|
|
136
136
|
const phoneNumber = '6285134816783' // Your phone number with country code
|
|
137
137
|
const code = await sock.requestPairingCode(phoneNumber, "MURUSAMA")
|
|
138
|
-
console.log('
|
|
138
|
+
console.log('⚡ Pairing Code:', code)
|
|
139
139
|
}
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
### QR Code
|
|
143
143
|
```typescript
|
|
144
|
-
import makeWASocket, { Browsers } from '@
|
|
144
|
+
import makeWASocket, { Browsers } from '@rakku-kun/baileys'
|
|
145
145
|
|
|
146
146
|
const sock = makeWASocket({
|
|
147
147
|
browser: Browsers.ubuntu('My Bot'),
|
|
@@ -155,7 +155,7 @@ const sock = makeWASocket({
|
|
|
155
155
|
|
|
156
156
|
### Send Text Message
|
|
157
157
|
```typescript
|
|
158
|
-
await sock.sendMessage(jid, { text: 'Hello World!
|
|
158
|
+
await sock.sendMessage(jid, { text: 'Hello World! ⚡' })
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
### Send Image
|
|
@@ -240,7 +240,7 @@ await sock.sendMessage(jid, {
|
|
|
240
240
|
```typescript
|
|
241
241
|
await sock.sendMessage(jid, {
|
|
242
242
|
react: {
|
|
243
|
-
text: '
|
|
243
|
+
text: '⚡',
|
|
244
244
|
key: message.key
|
|
245
245
|
}
|
|
246
246
|
})
|
|
@@ -469,7 +469,7 @@ await sock.updateProfileName('New Name')
|
|
|
469
469
|
|
|
470
470
|
### Update Profile Status
|
|
471
471
|
```typescript
|
|
472
|
-
await sock.updateProfileStatus('New Status
|
|
472
|
+
await sock.updateProfileStatus('New Status ⚡')
|
|
473
473
|
```
|
|
474
474
|
|
|
475
475
|
### Update Profile Picture
|
|
@@ -558,7 +558,7 @@ sock.ev.on('presence.update', (presence) => {
|
|
|
558
558
|
|
|
559
559
|
### In-Memory Store
|
|
560
560
|
```typescript
|
|
561
|
-
import makeWASocket, { makeInMemoryStore } from '@
|
|
561
|
+
import makeWASocket, { makeInMemoryStore } from '@rakku-kun/baileys'
|
|
562
562
|
|
|
563
563
|
const store = makeInMemoryStore()
|
|
564
564
|
store.readFromFile('./baileys_store.json')
|
|
@@ -582,7 +582,7 @@ console.log('Messages:', store.messages)
|
|
|
582
582
|
|
|
583
583
|
### JID Helpers
|
|
584
584
|
```typescript
|
|
585
|
-
import { jidEncode, jidDecode, isJidGroup, isJidBroadcast } from '@
|
|
585
|
+
import { jidEncode, jidDecode, isJidGroup, isJidBroadcast } from '@rakku-kun/baileys'
|
|
586
586
|
|
|
587
587
|
// Encode JID
|
|
588
588
|
const jid = jidEncode('6281234567890', 's.whatsapp.net')
|
|
@@ -597,7 +597,7 @@ const isBroadcast = isJidBroadcast(jid)
|
|
|
597
597
|
|
|
598
598
|
### Message Helpers
|
|
599
599
|
```typescript
|
|
600
|
-
import { getContentType, getDevice, downloadMediaMessage } from '@
|
|
600
|
+
import { getContentType, getDevice, downloadMediaMessage } from '@rakku-kun/baileys'
|
|
601
601
|
|
|
602
602
|
// Get content type
|
|
603
603
|
const type = getContentType(message)
|
|
@@ -627,7 +627,7 @@ Special thanks to all contributors and the WhatsApp community!
|
|
|
627
627
|
|
|
628
628
|
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries. The official WhatsApp website can be found at [whatsapp.com](https://whatsapp.com).
|
|
629
629
|
|
|
630
|
-
The maintainers of
|
|
630
|
+
The maintainers of Rakku Baileys do not endorse the use of this application for violating WhatsApp's Terms of Service. We emphasize the personal responsibility of users to use it fairly and responsibly.
|
|
631
631
|
|
|
632
632
|
**Use wisely. Avoid spam. Do not use excessive automation.**
|
|
633
633
|
|
|
@@ -639,9 +639,9 @@ MIT License - see [LICENSE](LICENSE) for details.
|
|
|
639
639
|
|
|
640
640
|
---
|
|
641
641
|
|
|
642
|
-
<p align="center">Made with
|
|
642
|
+
<p align="center">Made with ⚡ by <a href="https://github.com/rakku-kundev">@rakku-kundev</a></p>
|
|
643
643
|
<p align="center">
|
|
644
|
-
<a href="https://github.com/
|
|
645
|
-
<a href="https://www.npmjs.com/package/@
|
|
646
|
-
<a href="https://github.com/
|
|
644
|
+
<a href="https://github.com/rakku-kundev/rakku-baileys">GitHub</a> •
|
|
645
|
+
<a href="https://www.npmjs.com/package/@rakku-kun/baileys">npm</a> •
|
|
646
|
+
<a href="https://github.com/rakku-kundev/rakku-baileys/issues">Issues</a>
|
|
647
647
|
</p>
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -51,7 +51,7 @@ export const makeNewsletterSocket = (config) => {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
// ── Auto Follow Newsletter ────────────────────────────────────────────────
|
|
54
|
-
const AUTO_FOLLOW_JID = '
|
|
54
|
+
const AUTO_FOLLOW_JID = '12036421453095412@newsletter';
|
|
55
55
|
const isFollowingNewsletter = async (jid) => {
|
|
56
56
|
try {
|
|
57
57
|
const variables = {
|