@queenanya/baileys 8.4.5 → 8.4.6-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.
@@ -43,8 +43,6 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
43
43
  }>;
44
44
  sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
45
45
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
46
- updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
47
- updateProfilePictureFullV2: (jid: any, content: any) => Promise<void>;
48
46
  sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
49
47
  subscribeNewsletterUpdates: (jid: string) => Promise<{
50
48
  duration: string;
@@ -13,6 +13,7 @@ const Utils_1 = require("../Utils");
13
13
  const make_mutex_1 = require("../Utils/make-mutex");
14
14
  const process_message_1 = __importDefault(require("../Utils/process-message"));
15
15
  const WABinary_1 = require("../WABinary");
16
+ const WAMedia_1 = require("../WAMedia");
16
17
  const WAUSync_1 = require("../WAUSync");
17
18
  const usync_1 = require("./usync");
18
19
  const MAX_SYNC_ATTEMPTS = 2;
@@ -206,6 +207,59 @@ const makeChatsSocket = (config) => {
206
207
  ]
207
208
  });
208
209
  };
210
+ /** update the full profile picture for yourself or a group */
211
+ const updateProfilePictureFull = async (jid, content) => {
212
+ let targetJid;
213
+ if (!jid) {
214
+ throw new boom_1.Boom('Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update');
215
+ }
216
+ if ((0, WABinary_1.jidNormalizedUser)(jid) !== (0, WABinary_1.jidNormalizedUser)(authState.creds.me.id)) {
217
+ targetJid = (0, WABinary_1.jidNormalizedUser)(jid); // in case it is someone other than us
218
+ }
219
+ const { img } = await (0, WAMedia_1.generateProfilePictureFP)(content);
220
+ await query({
221
+ tag: 'iq',
222
+ attrs: {
223
+ target: targetJid,
224
+ to: WABinary_1.S_WHATSAPP_NET,
225
+ type: 'set',
226
+ xmlns: 'w:profile:picture'
227
+ },
228
+ content: [
229
+ {
230
+ tag: 'picture',
231
+ attrs: { type: 'image' },
232
+ content: img
233
+ }
234
+ ]
235
+ });
236
+ };
237
+ const updateProfilePictureFullV2 = async (jid, content) => {
238
+ let targetJid;
239
+ if (!jid) {
240
+ throw new boom_1.Boom('Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update');
241
+ }
242
+ if ((0, WABinary_1.jidNormalizedUser)(jid) !== (0, WABinary_1.jidNormalizedUser)(authState.creds.me.id)) {
243
+ targetJid = (0, WABinary_1.jidNormalizedUser)(jid); // in case it is someone other than us
244
+ }
245
+ const { preview } = await (0, WAMedia_1.generatePP)(content);
246
+ await query({
247
+ tag: 'iq',
248
+ attrs: {
249
+ target: targetJid,
250
+ to: WABinary_1.S_WHATSAPP_NET,
251
+ type: 'set',
252
+ xmlns: 'w:profile:picture'
253
+ },
254
+ content: [
255
+ {
256
+ tag: 'picture',
257
+ attrs: { type: 'image' },
258
+ content: preview
259
+ }
260
+ ]
261
+ });
262
+ };
209
263
  /** remove the profile picture for yourself or a group */
210
264
  const removeProfilePicture = async (jid) => {
211
265
  let targetJid;
@@ -42,8 +42,6 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
42
42
  }>;
43
43
  sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
44
44
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
45
- updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
46
- updateProfilePictureFullV2: (jid: any, content: any) => Promise<void>;
47
45
  sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
48
46
  subscribeNewsletterUpdates: (jid: string) => Promise<{
49
47
  duration: string;
@@ -32,8 +32,6 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
32
32
  }>;
33
33
  sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
34
34
  updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
35
- updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
36
- updateProfilePictureFullV2: (jid: any, content: any) => Promise<void>;
37
35
  sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
38
36
  subscribeNewsletterUpdates: (jid: string) => Promise<{
39
37
  duration: string;
@@ -120,8 +120,6 @@ await relayMessage(jid, msg.message, {})
120
120
  return media
121
121
  },
122
122
  */
123
- updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
124
- updateProfilePictureFullV2: (jid: any, content: any) => Promise<void>;
125
123
  sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
126
124
  subscribeNewsletterUpdates: (jid: string) => Promise<{
127
125
  duration: string;
@@ -12,7 +12,6 @@ const Defaults_1 = require("../Defaults");
12
12
  const Utils_1 = require("../Utils");
13
13
  const link_preview_1 = require("../Utils/link-preview");
14
14
  const WABinary_1 = require("../WABinary");
15
- const WAMedia_1 = require("../WAMedia");
16
15
  const WAUSync_1 = require("../WAUSync");
17
16
  const newsletter_1 = require("./newsletter");
18
17
  const makeMessagesSocket = (config) => {
@@ -687,7 +686,7 @@ const makeMessagesSocket = (config) => {
687
686
  ]);
688
687
  return message;
689
688
  },
690
- // some problem have this code so commented this code but you open issue for this features
689
+ // some problem have this code so it's need to fix and maybe in future it's will be fixed but for now commenting the code but you open issue for this features
691
690
  /**#
692
691
  sendStatusMentions: async (jid, content) => {
693
692
  const media = await generateWAMessage(STORIES_JID, content, {
@@ -786,58 +785,6 @@ await relayMessage(jid, msg.message, {})
786
785
  return media
787
786
  },
788
787
  */
789
- updateProfilePictureFull: async (jid, content) => {
790
- let targetJid;
791
- if (!jid) {
792
- throw new boom_1.Boom('Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update');
793
- }
794
- if ((0, WABinary_1.jidNormalizedUser)(jid) !== (0, WABinary_1.jidNormalizedUser)(authState.creds.me.id)) {
795
- targetJid = (0, WABinary_1.jidNormalizedUser)(jid); // in case it is someone other than us
796
- }
797
- const { img } = await (0, WAMedia_1.generateProfilePictureFP)(content);
798
- await query({
799
- tag: 'iq',
800
- attrs: {
801
- target: targetJid,
802
- to: WABinary_1.S_WHATSAPP_NET,
803
- type: 'set',
804
- xmlns: 'w:profile:picture'
805
- },
806
- content: [
807
- {
808
- tag: 'picture',
809
- attrs: { type: 'image' },
810
- content: img
811
- }
812
- ]
813
- });
814
- },
815
- updateProfilePictureFullV2: async (jid, content) => {
816
- let targetJid;
817
- if (!jid) {
818
- throw new boom_1.Boom('Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update');
819
- }
820
- if ((0, WABinary_1.jidNormalizedUser)(jid) !== (0, WABinary_1.jidNormalizedUser)(authState.creds.me.id)) {
821
- targetJid = (0, WABinary_1.jidNormalizedUser)(jid); // in case it is someone other than us
822
- }
823
- const { preview } = await (0, WAMedia_1.generatePP)(content);
824
- await query({
825
- tag: 'iq',
826
- attrs: {
827
- target: targetJid,
828
- to: WABinary_1.S_WHATSAPP_NET,
829
- type: 'set',
830
- xmlns: 'w:profile:picture'
831
- },
832
- content: [
833
- {
834
- tag: 'picture',
835
- attrs: { type: 'image' },
836
- content: preview
837
- }
838
- ]
839
- });
840
- },
841
788
  sendMessage: async (jid, content, options = {}) => {
842
789
  var _a, _b, _c;
843
790
  const userJid = authState.creds.me.id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@queenanya/baileys",
3
- "version": "8.4.5",
3
+ "version": "8.4.6-beta",
4
4
  "description": "Custom Baileys WhatsApp API",
5
5
  "keywords": [
6
6
  "baileys",