Skip to content

Commit be1b6fc

Browse files
committed
update v3.0.1 fix logout issue
1 parent a574d98 commit be1b6fc

File tree

8 files changed

+211
-442
lines changed

8 files changed

+211
-442
lines changed

package-lock.json

+197-428
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wa-multi-session",
3-
"version": "2.1.0",
3+
"version": "3.0.1",
44
"description": "Multi Session Whatsapp Library",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -15,8 +15,9 @@
1515
"author": "mimamch",
1616
"license": "ISC",
1717
"dependencies": {
18-
"@adiwajshing/baileys": "^4.3.0",
18+
"@adiwajshing/keyed-db": "^0.2.4",
1919
"@hapi/boom": "^10.0.1",
20+
"@whiskeysockets/baileys": "^6.2.1",
2021
"pino": "^8.11.0",
2122
"qrcode-terminal": "^0.12.0"
2223
},

readme.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Connecting Your app with Whatsapp Messaging
44

55
Lightweight library for whatsapp. Not require Selenium or any other browser.
66

7-
Stand above [Baileys](https://github.com/adiwajshing/Baileys) Library.
7+
Stand above [Baileys](https://github.com/WhiskeySockets/Baileys) Library.
88

99
## Installation
1010

@@ -195,9 +195,10 @@ whatsapp.setCredentialsDir("my_custom_dir");
195195
// or : credentials/mycreds
196196
```
197197

198-
## Change Log v2.0.0
198+
## Change Log v3.0.0 June 2023
199199

200-
- Disable auto load session from storage
200+
- Fix Logout Issue
201+
- Switching into [@whiskeysockets/baileys](https://github.com/WhiskeySockets/Baileys)
201202

202203
## Authors
203204

src/Messaging/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { proto, WASocket } from "@adiwajshing/baileys";
1+
import { proto, WASocket } from "@whiskeysockets/baileys";
22
import { Messages } from "../Defaults";
33
import { getSession } from "../Socket";
44
import {

src/Socket/index.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import makeWASocket, {
44
fetchLatestBaileysVersion,
55
useMultiFileAuthState,
66
WASocket,
7-
} from "@adiwajshing/baileys";
7+
} from "@whiskeysockets/baileys";
88
import pino from "pino";
99
import path from "path";
1010
import { Boom } from "@hapi/boom";
@@ -17,7 +17,6 @@ import {
1717
saveVideoHandler,
1818
} from "../Utils/save-media";
1919

20-
const msgRetryCounterMap = {};
2120
const sessions: Map<string, WASocket> = new Map();
2221

2322
const callback: Map<string, Function> = new Map();
@@ -27,7 +26,7 @@ const retryCount: Map<string, number> = new Map();
2726
export const startSession = async (
2827
sessionId = "mysession",
2928
options: StartSessionParams = { printQR: false }
30-
) => {
29+
): Promise<WASocket> => {
3130
if (isSessionExistAndRunning(sessionId))
3231
throw new Error(Messages.sessionAlreadyExist(sessionId));
3332
const logger = pino({ level: "silent" });
@@ -42,7 +41,6 @@ export const startSession = async (
4241
printQRInTerminal: options.printQR,
4342
auth: state,
4443
logger,
45-
msgRetryCounterMap,
4644
markOnlineOnConnect: false,
4745
browser: Browsers.ubuntu("Chrome"),
4846
});
@@ -90,7 +88,7 @@ export const startSession = async (
9088
}
9189
if (events["messages.upsert"]) {
9290
const msg = events["messages.upsert"]
93-
.messages?.[0] as MessageReceived;
91+
.messages?.[0] as unknown as MessageReceived;
9492
msg.sessionId = sessionId;
9593
msg.saveImage = (path) => saveImageHandler(msg, path);
9694
msg.saveVideo = (path) => saveVideoHandler(msg, path);

src/Types/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { proto } from "@adiwajshing/baileys";
1+
import { proto } from "@whiskeysockets/baileys";
22

33
export interface SendMessageTypes {
44
to: string | number;

src/Utils/save-media.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { downloadMediaMessage } from "@adiwajshing/baileys";
1+
import { downloadMediaMessage } from "@whiskeysockets/baileys";
22
import { MessageReceived } from "../Types";
33
import ValidationError from "./error";
44
import fs from "fs/promises";

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
/* Emit */
4848
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
49-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
49+
"declarationMap": true /* Create sourcemaps for d.ts files. */,
5050
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
5151
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
5252
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */

0 commit comments

Comments
 (0)