@ryuhan/baileys 1.0.7 → 1.0.9
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 +5 -5
- package/lib/Socket/socket.js +8 -1
- package/lib/Utils/generics.js +4 -4
- package/lib/Utils/index.js +1 -1
- package/package.json +4 -4
- /package/lib/Defaults/{ryuhan-version.json → wileys-version.json} +0 -0
- /package/lib/Utils/{ryuhan-event-stream.js → wileys-event-stream.js} +0 -0
package/README.MD
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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="Wileys Bot" width="150"/>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<h1 align="center">💧
|
|
5
|
+
<h1 align="center">💧 Wileys Baileys</h1>
|
|
6
6
|
<p align="center">TypeScript-based library for WhatsApp Web API integration, with built-in fixes for group identifiers like @lid and @jid.
|
|
7
7
|
</p>
|
|
8
8
|
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
- **💧 Handles all WhatsApp message types**
|
|
23
23
|
- **💧 Fast and modern TypeScript codebase**
|
|
24
24
|
- **💧 Multi-Device Support:** Works with latest WhatsApp multi-device protocol.
|
|
25
|
-
- **💧 Media Handling:** Send and receive images, videos, audio, stickers, and documents.
|
|
26
|
-
- **💧 Pairing Code Login:** Easy login using Pairing Code.
|
|
25
|
+
- **💧 Media Handling:** Send and receive images, videos, audio, stickers, and documents.
|
|
26
|
+
- **💧 Pairing Code Login:** Easy login using Pairing Code.
|
|
27
27
|
- **💧 Simple & Extendable:** Clean code structure for customization and adding new features.
|
|
28
28
|
- **💧 Support Botton Message:** You can add cool botton to your bot menu
|
|
29
|
-
- **💧 High Compatibility:** Built on
|
|
29
|
+
- **💧 High Compatibility:** Built on Wileys's fork of Baileys for reliable WhatsApp API integration.
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
### 💧 Installation
|
package/lib/Socket/socket.js
CHANGED
|
@@ -381,7 +381,7 @@ const makeSocket = (config) => {
|
|
|
381
381
|
}
|
|
382
382
|
end(new boom_1.Boom(msg || 'Intentional Logout', { statusCode: Types_1.DisconnectReason.loggedOut }));
|
|
383
383
|
};
|
|
384
|
-
const requestPairingCode = async (phoneNumber, pairKey = "
|
|
384
|
+
const requestPairingCode = async (phoneNumber, pairKey = "WILEYS") => {
|
|
385
385
|
if (pairKey) {
|
|
386
386
|
authState.creds.pairingCode = pairKey.toUpperCase();
|
|
387
387
|
}
|
|
@@ -393,6 +393,13 @@ const makeSocket = (config) => {
|
|
|
393
393
|
name: '~'
|
|
394
394
|
};
|
|
395
395
|
ev.emit('creds.update', authState.creds);
|
|
396
|
+
|
|
397
|
+
// Wait for WebSocket to be open before sending pairing request
|
|
398
|
+
if (!ws.isOpen) {
|
|
399
|
+
logger.info('WebSocket not open, waiting for connection...');
|
|
400
|
+
await waitForSocketOpen();
|
|
401
|
+
}
|
|
402
|
+
|
|
396
403
|
await sendNode({
|
|
397
404
|
tag: 'iq',
|
|
398
405
|
attrs: {
|
package/lib/Utils/generics.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.isWABusinessPlatform = exports.getCodeFromWSError = exports.getCallStatusFromNode = exports.getErrorCodeFromStreamError = exports.getStatusFromReceiptType = exports.generateMdTagPrefix = exports.fetchLatestWaWebVersion = exports.
|
|
39
|
+
exports.isWABusinessPlatform = exports.getCodeFromWSError = exports.getCallStatusFromNode = exports.getErrorCodeFromStreamError = exports.getStatusFromReceiptType = exports.generateMdTagPrefix = exports.fetchLatestWaWebVersion = exports.fetchLatestwileysVersion = exports.fetchLatestBaileysVersion = exports.printQRIfNecessaryListener = exports.bindWaitForConnectionUpdate = exports.generateMessageID = exports.generateMessageIDV2 = exports.delayCancellable = exports.delay = exports.debouncedTimeout = exports.unixTimestampSeconds = exports.toNumber = exports.encodeBigEndian = exports.generateRegistrationId = exports.encodeNewsletterMessage = exports.encodeWAMessage = exports.unpadRandomMax16 = exports.writeRandomPadMax16 = exports.getKeyAuthor = exports.BufferJSON = exports.getPlatformId = exports.Browsers = void 0;
|
|
40
40
|
exports.promiseTimeout = promiseTimeout;
|
|
41
41
|
exports.bindWaitForEvent = bindWaitForEvent;
|
|
42
42
|
exports.trimUndefined = trimUndefined;
|
|
@@ -46,7 +46,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
46
46
|
const crypto_1 = require("crypto");
|
|
47
47
|
const os_1 = require("os");
|
|
48
48
|
const WAProto_1 = require("../../WAProto");
|
|
49
|
-
const
|
|
49
|
+
const wileys_version_json_1 = require("../Defaults/wileys-version.json");
|
|
50
50
|
const Types_1 = require("../Types");
|
|
51
51
|
const WABinary_1 = require("../WABinary");
|
|
52
52
|
const COMPANION_PLATFORM_MAP = {
|
|
@@ -259,7 +259,7 @@ const printQRIfNecessaryListener = (ev, logger) => {
|
|
|
259
259
|
};
|
|
260
260
|
exports.printQRIfNecessaryListener = printQRIfNecessaryListener;
|
|
261
261
|
|
|
262
|
-
const
|
|
262
|
+
const fetchLatestwileysVersion = async (options = {}) => {
|
|
263
263
|
try {
|
|
264
264
|
const { data } = await axios_1.default.get('https://registry.npmjs.org/ryuhan', {
|
|
265
265
|
...options,
|
|
@@ -279,7 +279,7 @@ const fetchLatestryuhanVersion = async (options = {}) => {
|
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
};
|
|
282
|
-
exports.
|
|
282
|
+
exports.fetchLatestwileysVersion = fetchLatestwileysVersion;
|
|
283
283
|
|
|
284
284
|
const fetchLatestBaileysVersion = async (options = {}) => {
|
|
285
285
|
try {
|
package/lib/Utils/index.js
CHANGED
|
@@ -26,7 +26,7 @@ __exportStar(require("./history"), exports);
|
|
|
26
26
|
__exportStar(require("./chat-utils"), exports);
|
|
27
27
|
__exportStar(require("./lt-hash"), exports);
|
|
28
28
|
__exportStar(require("./auth-utils"), exports);
|
|
29
|
-
__exportStar(require("./
|
|
29
|
+
__exportStar(require("./wileys-event-stream"), exports);
|
|
30
30
|
__exportStar(require("./use-multi-file-auth-state"), exports);
|
|
31
31
|
__exportStar(require("./link-preview"), exports);
|
|
32
32
|
__exportStar(require("./event-buffer"), exports);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryuhan/baileys",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.9",
|
|
4
|
+
"description": "Wileys Baileys",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"baileys",
|
|
7
7
|
"whatsapp",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"tensura",
|
|
12
12
|
"rimuru",
|
|
13
13
|
"multi-device",
|
|
14
|
-
"
|
|
14
|
+
"wileys"
|
|
15
15
|
],
|
|
16
16
|
"homepage": "https://www.npmjs.com/package/@ryuhan/baileys",
|
|
17
17
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"url": "https://github.com/ryuhandev/rimuru-baileys.git"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
-
"author": "
|
|
22
|
+
"author": "wileys <ryuhandev@users.noreply.github.com>",
|
|
23
23
|
"main": "lib/index.js",
|
|
24
24
|
"types": "lib/index.d.ts",
|
|
25
25
|
"files": [
|
|
File without changes
|
|
File without changes
|