@queenanya/baileys 8.5.6 → 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,4 @@
1
- ## 8.5.6 (2025-08-30)
1
+ # 8.6.0-beta (2025-08-30)
2
2
 
3
3
 
4
4
 
@@ -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';
@@ -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
22
  const media = await query({
13
23
  tag: 'iq',
14
24
  attrs: {
15
25
  target: jid,
16
- to: WABinary_1.S_WHATSAPP_NET,
26
+ to: JidTO,
17
27
  type: 'set',
18
28
  xmlns: 'w:profile:picture'
19
29
  },
@@ -29,13 +39,23 @@ const updateProfilePictureFull = async (jid, content, sock) => {
29
39
  };
30
40
  exports.updateProfilePictureFull = updateProfilePictureFull;
31
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
+ }
32
52
  const { query } = sock;
33
53
  const { preview } = await (0, media_messages_1.generatePP)(content);
34
54
  const media = await query({
35
55
  tag: 'iq',
36
56
  attrs: {
37
57
  target: jid,
38
- to: WABinary_1.S_WHATSAPP_NET,
58
+ to: JidTO,
39
59
  type: 'set',
40
60
  xmlns: 'w:profile:picture'
41
61
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@queenanya/baileys",
3
- "version": "8.5.6",
3
+ "version": "8.6.0-beta",
4
4
  "description": "Custom Baileys WhatsApp API",
5
5
  "keywords": [
6
6
  "baileys",