From 7c5071d8d558d88c53f27564898931c35d632f23 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Sun, 20 Feb 2022 19:31:47 +0530 Subject: [PATCH] chore: move version to JSON file --- src/Defaults/baileys-version.json | 3 +++ src/Defaults/index.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 src/Defaults/baileys-version.json diff --git a/src/Defaults/baileys-version.json b/src/Defaults/baileys-version.json new file mode 100644 index 0000000..9f29d4e --- /dev/null +++ b/src/Defaults/baileys-version.json @@ -0,0 +1,3 @@ +{ + "version": [2, 2204, 13] +} \ No newline at end of file diff --git a/src/Defaults/index.ts b/src/Defaults/index.ts index 09003d9..ab7f737 100644 --- a/src/Defaults/index.ts +++ b/src/Defaults/index.ts @@ -1,6 +1,7 @@ import P from 'pino' import type { CommonSocketConfig, LegacySocketConfig, MediaType, SocketConfig } from '../Types' import { Browsers } from '../Utils' +import { version } from './baileys-version.json' export const UNAUTHORIZED_CODES = [401, 403, 419] @@ -18,7 +19,7 @@ export const NOISE_WA_HEADER = new Uint8Array([87, 65, 5, 2]) // last is "DICT_V export const URL_REGEX = /[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)?/gi const BASE_CONNECTION_CONFIG: CommonSocketConfig = { - version: [2, 2204, 13], + version: version as any, browser: Browsers.baileys('Chrome'), waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',