@fvckerss/baileys 1.0.16 → 1.0.18
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/lib/Defaults/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { proto } from '../../WAProto/index.js';
|
|
|
2
2
|
import { makeLibSignalRepository } from '../Signal/libsignal.js';
|
|
3
3
|
import { Browsers } from '../Utils/browser-utils.js';
|
|
4
4
|
import logger from '../Utils/logger.js';
|
|
5
|
-
const version = [2, 3000,
|
|
5
|
+
const version = [2, 3000, 1033846690];
|
|
6
6
|
export const UNAUTHORIZED_CODES = [401, 403, 419];
|
|
7
7
|
export const BIZ_BOT_SUPPORT_PAYLOAD = '{"version":1,"is_ai_message":true,"should_upload_client_logs":false,"should_show_system_message":false,"ticket_id":"7004947587700716","citation_items":[],"ticket_locale":"us"}';
|
|
8
8
|
export const DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
@@ -4,8 +4,15 @@ import { generateMessageID, generateMessageIDV2, unixTimestampSeconds } from '..
|
|
|
4
4
|
import logger from '../Utils/logger.js';
|
|
5
5
|
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString, jidEncode, jidNormalizedUser } from '../WABinary/index.js';
|
|
6
6
|
import { makeBusinessSocket } from './business.js';
|
|
7
|
+
import { Dugong } from './dugong.js';
|
|
7
8
|
export const makeCommunitiesSocket = (config) => {
|
|
8
9
|
const sock = makeBusinessSocket(config);
|
|
10
|
+
const dugong = new Dugong(
|
|
11
|
+
sock.waUploadToServer,
|
|
12
|
+
sock.relayMessage.bind(sock),
|
|
13
|
+
config,
|
|
14
|
+
sock
|
|
15
|
+
);
|
|
9
16
|
const { authState, ev, query, upsertMessage } = sock;
|
|
10
17
|
const communityQuery = async (jid, type, content) => query({
|
|
11
18
|
tag: 'iq',
|
|
@@ -84,8 +91,10 @@ export const makeCommunitiesSocket = (config) => {
|
|
|
84
91
|
await sock.cleanDirtyBits('groups');
|
|
85
92
|
});
|
|
86
93
|
return {
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
...sock,
|
|
95
|
+
handleGroupStory: (content, jid, quoted, options) =>
|
|
96
|
+
dugong.handleGroupStory(content, jid, quoted, options),
|
|
97
|
+
communityMetadata,
|
|
89
98
|
communityCreate: async (subject, body) => {
|
|
90
99
|
const descriptionId = generateMessageID().substring(0, 12);
|
|
91
100
|
const result = await communityQuery('@g.us', 'set', [
|
|
@@ -550,7 +550,8 @@ const sanitizeMessagePayload = message => {
|
|
|
550
550
|
"buttonsMessage",
|
|
551
551
|
"templateMessage",
|
|
552
552
|
"interactiveMessage",
|
|
553
|
-
"viewOnceMessage"
|
|
553
|
+
"viewOnceMessage",
|
|
554
|
+
"groupStatusMessageV2"
|
|
554
555
|
]
|
|
555
556
|
|
|
556
557
|
const isProto = protoKeys.some(k => k in (message || {}))
|
|
@@ -18,6 +18,7 @@ export const Browsers = {
|
|
|
18
18
|
macOS: browser => ['Mac OS', browser, '14.4.1'],
|
|
19
19
|
baileys: browser => ['Baileys', browser, '6.5.0'],
|
|
20
20
|
windows: browser => ['Windows', browser, '10.0.22631'],
|
|
21
|
+
android: browser => [browser, 'Android', ''],
|
|
21
22
|
/** The appropriate browser based on your OS & release */
|
|
22
23
|
appropriate: browser => [PLATFORM_MAP[platform()] || 'Ubuntu', browser, release()]
|
|
23
24
|
};
|