Skip to content

Commit

Permalink
......
Browse files Browse the repository at this point in the history
  • Loading branch information
keyurboss committed Oct 28, 2024
1 parent a127945 commit c93f0bb
Show file tree
Hide file tree
Showing 5 changed files with 1,558 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tmp
/out-tsc
install-state.gz
firebase.config.json

.yarn/cache
# dependencies
node_modules

Expand Down
6 changes: 3 additions & 3 deletions apps/server/whatsapp-common/src/assets/general.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"readPath": "ag/whatsappmsg",
"statusPath": "serverStatus/ag",
"readPath": "radhe_enterprise/whatsappmsg",
"statusPath": "serverStatus/radhe_enterprise",
"storeCredCollectionName": "whatsappCred",
"serverName": "ag"
"serverName": "radhe_enterprise"
}
9 changes: 5 additions & 4 deletions apps/server/whatsapp-common/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* eslint-disable no-console */
// eslint-disable-next-line unused-imports/no-unused-imports
import 'qrcode-terminal';
import { Boom } from '@hapi/boom';
import makeWASocket, {
Browsers,
DisconnectReason,
} from '@whiskeysockets/baileys';
import pin from 'pino';
import 'qrcode-terminal';

import { DataSnapshot } from '@firebase/database-types/index.d';
import { BehaviorSubject, Subject } from 'rxjs';
Expand All @@ -30,7 +29,8 @@ async function connectToWhatsApp() {
);
const sock = makeWASocket({
auth: state,
logger: pin({ level: 'info' }),
// logger: pin({ level: 'info' }),
// logger: pin({ level: 'info' }),
// logger: pin({ level: 'debug' }),
// can provide additional config here
printQRInTerminal: true,
Expand All @@ -39,7 +39,8 @@ async function connectToWhatsApp() {
syncFullHistory: false,
});
sock.ev.on('creds.update', saveCreds);
sock.ev.on('connection.update', (update) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
sock.ev.on('connection.update', (update: any) => {
const { connection, lastDisconnect } = update;
if (connection === 'close') {
ServerConfigBehavior.value.whatsappLoggedIn = false;
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "7.8.0",
"@typescript-eslint/parser": "7.8.0",
"@vercel/ncc": "^0.38.1",
"autoprefixer": "^10.4.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
Expand Down Expand Up @@ -73,6 +74,7 @@
"@angular/platform-browser": "17.3.8",
"@angular/platform-browser-dynamic": "17.3.8",
"@angular/router": "17.3.8",
"@hapi/boom": "^10.0.1",
"@nestjs/common": "10.0.2",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "10.0.2",
Expand All @@ -81,14 +83,18 @@
"@ngneat/falso": "^6.4.0",
"@nx/angular": "19.0.2",
"@rps/angular-nav-bars": "^1.0.3",
"@whiskeysockets/baileys": "^6.7.2",
"axios": "1.6.8",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"eslint-plugin-unused-imports": "^2.0.0",
"firebase-admin": "^12.1.0",
"joi": "^17.9.2",
"jsonwebtoken": "^9.0.0",
"mongodb": "^6.0.0",
"mongodb-memory-server": "^8.15.1",
"pino": "^9.0.0",
"qrcode-terminal": "^0.12.0",
"redis": "^4.6.8",
"reflect-metadata": "^0.1.13",
"rxjs": "~7.8.1",
Expand Down
Loading

0 comments on commit c93f0bb

Please sign in to comment.