@queenanya/baileys 8.5.5 → 8.6.0-beta
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/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const S_WHATSAPP_NET = "@s.whatsapp.net";
|
|
2
|
+
export declare const C_US = "@c.us";
|
|
3
|
+
export declare const LID = "@lid";
|
|
2
4
|
export declare const OFFICIAL_BIZ_JID = "16505361212@c.us";
|
|
3
5
|
export declare const SERVER_JID = "server@c.us";
|
|
4
6
|
export declare const PSA_WID = "0@c.us";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBotJid = exports.jidNormalizedUser = exports.isJidBot = exports.isJidStatusBroadcast = exports.isJidGroup = exports.isJidNewsletter = exports.isJidBroadcast = exports.isLidUser = exports.isJidUser = exports.isJidMetaAi = exports.areJidsSameUser = exports.jidDecode = exports.jidEncode = exports.META_AI_JID = exports.STORIES_JID = exports.PSA_WID = exports.SERVER_JID = exports.OFFICIAL_BIZ_JID = exports.S_WHATSAPP_NET = void 0;
|
|
3
|
+
exports.getBotJid = exports.jidNormalizedUser = exports.isJidBot = exports.isJidStatusBroadcast = exports.isJidGroup = exports.isJidNewsletter = exports.isJidBroadcast = exports.isLidUser = exports.isJidUser = exports.isJidMetaAi = exports.areJidsSameUser = exports.jidDecode = exports.jidEncode = exports.META_AI_JID = exports.STORIES_JID = exports.PSA_WID = exports.SERVER_JID = exports.OFFICIAL_BIZ_JID = exports.LID = exports.C_US = exports.S_WHATSAPP_NET = void 0;
|
|
4
4
|
exports.S_WHATSAPP_NET = '@s.whatsapp.net';
|
|
5
|
+
exports.C_US = '@c.us';
|
|
6
|
+
exports.LID = '@lid';
|
|
5
7
|
exports.OFFICIAL_BIZ_JID = '16505361212@c.us';
|
|
6
8
|
exports.SERVER_JID = 'server@c.us';
|
|
7
9
|
exports.PSA_WID = '0@c.us';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** update the profile picture for yourself or a group as Full */
|
|
2
|
-
export declare const updateProfilePictureFull: (jid: any, content: any, sock: any) => Promise<
|
|
3
|
-
export declare const updateProfilePictureFull2: (jid: any, content: any, sock: any) => Promise<
|
|
2
|
+
export declare const updateProfilePictureFull: (jid: any, content: any, sock: any) => Promise<any>;
|
|
3
|
+
export declare const updateProfilePictureFull2: (jid: any, content: any, sock: any) => Promise<any>;
|
|
4
4
|
export declare const sendStatusMentionsF: (jid: any, content: any, sock: any) => Promise<import("..").proto.WebMessageInfo>;
|
|
5
5
|
export declare const sendStatusMentionsFV2: (jid: any, content: any, sock: any) => Promise<import("..").proto.WebMessageInfo>;
|
|
6
6
|
export declare const sendStatusMentions: (jid: any, content: any, sock: any) => Promise<import("..").proto.WebMessageInfo>;
|
package/lib/WAMedia/media-set.js
CHANGED
|
@@ -7,13 +7,23 @@ const Utils_1 = require("../Utils");
|
|
|
7
7
|
const media_messages_1 = require("./media-messages");
|
|
8
8
|
/** update the profile picture for yourself or a group as Full */
|
|
9
9
|
const updateProfilePictureFull = async (jid, content, sock) => {
|
|
10
|
+
let JidTO;
|
|
11
|
+
if (jid.endsWith(WABinary_1.S_WHATSAPP_NET)) {
|
|
12
|
+
JidTO = WABinary_1.S_WHATSAPP_NET;
|
|
13
|
+
}
|
|
14
|
+
else if (jid.endsWith(WABinary_1.C_US)) {
|
|
15
|
+
JidTO = WABinary_1.C_US;
|
|
16
|
+
}
|
|
17
|
+
else if (jid.endsWith(WABinary_1.LID)) {
|
|
18
|
+
JidTO = WABinary_1.LID;
|
|
19
|
+
}
|
|
10
20
|
const { query } = sock;
|
|
11
21
|
const { img } = await (0, media_messages_1.generateProfilePictureFP)(content);
|
|
12
|
-
await query({
|
|
22
|
+
const media = await query({
|
|
13
23
|
tag: 'iq',
|
|
14
24
|
attrs: {
|
|
15
25
|
target: jid,
|
|
16
|
-
to:
|
|
26
|
+
to: JidTO,
|
|
17
27
|
type: 'set',
|
|
18
28
|
xmlns: 'w:profile:picture'
|
|
19
29
|
},
|
|
@@ -25,16 +35,27 @@ const updateProfilePictureFull = async (jid, content, sock) => {
|
|
|
25
35
|
}
|
|
26
36
|
]
|
|
27
37
|
});
|
|
38
|
+
return media;
|
|
28
39
|
};
|
|
29
40
|
exports.updateProfilePictureFull = updateProfilePictureFull;
|
|
30
41
|
const updateProfilePictureFull2 = async (jid, content, sock) => {
|
|
42
|
+
let JidTO;
|
|
43
|
+
if (jid.endsWith(WABinary_1.S_WHATSAPP_NET)) {
|
|
44
|
+
JidTO = WABinary_1.S_WHATSAPP_NET;
|
|
45
|
+
}
|
|
46
|
+
else if (jid.endsWith(WABinary_1.C_US)) {
|
|
47
|
+
JidTO = WABinary_1.C_US;
|
|
48
|
+
}
|
|
49
|
+
else if (jid.endsWith(WABinary_1.LID)) {
|
|
50
|
+
JidTO = WABinary_1.LID;
|
|
51
|
+
}
|
|
31
52
|
const { query } = sock;
|
|
32
53
|
const { preview } = await (0, media_messages_1.generatePP)(content);
|
|
33
|
-
await query({
|
|
54
|
+
const media = await query({
|
|
34
55
|
tag: 'iq',
|
|
35
56
|
attrs: {
|
|
36
57
|
target: jid,
|
|
37
|
-
to:
|
|
58
|
+
to: JidTO,
|
|
38
59
|
type: 'set',
|
|
39
60
|
xmlns: 'w:profile:picture'
|
|
40
61
|
},
|
|
@@ -46,6 +67,7 @@ const updateProfilePictureFull2 = async (jid, content, sock) => {
|
|
|
46
67
|
}
|
|
47
68
|
]
|
|
48
69
|
});
|
|
70
|
+
return media;
|
|
49
71
|
};
|
|
50
72
|
exports.updateProfilePictureFull2 = updateProfilePictureFull2;
|
|
51
73
|
// send mention msg in group chat or private chat
|