@vinzsocket/baileys 3.2.10 → 3.2.12

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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  **Fork WebSocket library WhatsApp Web Multi-Device — dasar dari ekosistem bot Harps-MD**
6
6
 
7
7
  [![GitHub](https://img.shields.io/badge/GitHub-VinzSocket/Baileys-blue?style=for-the-badge&logo=github)](https://github.com/VinzSocket/Baileys)
8
- ![Version](https://img.shields.io/badge/version-3.2.10-blue)
8
+ ![Version](https://img.shields.io/badge/version-3.2.12-blue)
9
9
  ![Node.js](https://img.shields.io/badge/Node.js-%3E%3D20-green)
10
10
  ![License](https://img.shields.io/badge/license-MIT-lightgrey)
11
11
  ![Type](https://img.shields.io/badge/type-ESM-yellow)
@@ -1218,7 +1218,7 @@ await conn.sendMessage(groupJid, {
1218
1218
  })
1219
1219
  ```
1220
1220
 
1221
- > ⚠️ **Penting:** sejak v3.2.10, setiap mode `handleGroupStory()` **wajib** menyertakan `additionalNodes` (node `<meta is_vsn2="1">`) di panggilan `relayMessage()`-nya. Tanpa ini, pesan tetap terkirim & ter-enkripsi normal (tidak ada error), tapi klien penerima tidak tahu payload tersebut harus dirender sebagai story grup — sehingga tidak pernah muncul sebagai ring status untuk anggota lain. Detail lengkap bug ini ada di [Changelog v3.2.10](#-changelog-ringkas). Jika Anda memakai versi ≥ 3.2.10, ini sudah otomatis tertangani.
1221
+ > ⚠️ **Penting:** sejak v3.2.12, setiap mode `handleGroupStory()` **wajib** menyertakan `additionalNodes` (node `<meta is_vsn2="1">`) di panggilan `relayMessage()`-nya. Tanpa ini, pesan tetap terkirim & ter-enkripsi normal (tidak ada error), tapi klien penerima tidak tahu payload tersebut harus dirender sebagai story grup — sehingga tidak pernah muncul sebagai ring status untuk anggota lain. Detail lengkap bug ini ada di [Changelog v3.2.12](#-changelog-ringkas). Jika Anda memakai versi ≥ 3.2.12, ini sudah otomatis tertangani.
1222
1222
 
1223
1223
  ### Story Card Generator (`renderStoryCard`)
1224
1224
 
@@ -2318,7 +2318,7 @@ Jika handler lama Anda memiliki logic khusus untuk mem-parsing `buttonsResponseM
2318
2318
 
2319
2319
  ### Q: Bot terkoneksi tapi tombol/list yang saya kirim tidak muncul di HP penerima?
2320
2320
 
2321
- **A:** Ini hampir selalu soal `additionalNodes` binary hint yang hilang. Jika Anda memakai `sock.sendMessage()` biasa, ini seharusnya sudah otomatis. Jika Anda memakai `relayMessage()` secara manual, pastikan menyertakan `buildInteractiveAdditionalNodes(jid, message)` — lihat bagian [`buildInteractiveAdditionalNodes`](#buildinteractiveadditionalnodes--kenapa-wajib-ada). Pastikan juga Anda sedang menjalankan versi ≥ 3.2.10 untuk `groupStatusMessage`, karena bug ini pernah terjadi khusus untuk Group Status V2 sebelum versi tersebut.
2321
+ **A:** Ini hampir selalu soal `additionalNodes` binary hint yang hilang. Jika Anda memakai `sock.sendMessage()` biasa, ini seharusnya sudah otomatis. Jika Anda memakai `relayMessage()` secara manual, pastikan menyertakan `buildInteractiveAdditionalNodes(jid, message)` — lihat bagian [`buildInteractiveAdditionalNodes`](#buildinteractiveadditionalnodes--kenapa-wajib-ada). Pastikan juga Anda sedang menjalankan versi ≥ 3.2.12 untuk `groupStatusMessage`, karena bug ini pernah terjadi khusus untuk Group Status V2 sebelum versi tersebut.
2322
2322
 
2323
2323
  ### Q: Error `ERR_REQUIRE_ESM` saat `require('@vinzsocket/baileys')`?
2324
2324
 
@@ -2348,7 +2348,7 @@ Modul ini sengaja **lazy-imported** (tidak jadi hard dependency) supaya konsumen
2348
2348
 
2349
2349
  ### Q: Apakah Harps-Baileys mendukung WhatsApp Flow (form registrasi multi-field native)?
2350
2350
 
2351
- **A:** Dukungan native multi-field Flow form (`flow_json` dengan banyak field terstruktur, validasi server-side, dsb — fitur "WhatsApp Flows" penuh) **belum diverifikasi tersedia** secara native di fork ini pada versi 3.2.10. Alternatif yang bisa dipakai sekarang adalah **form terpandu bertahap** (guided step-by-step): kirim serangkaian pertanyaan satu per satu memakai `interactiveMessage` biasa (teks/tombol/list) dan simpan progres jawaban di state percakapan bot Anda sendiri, alih-alih mengandalkan satu payload Flow form native. Jika kebutuhan Anda spesifik untuk Flow form penuh, pantau `CHANGELOG.md` untuk update fitur ini di rilis mendatang.
2351
+ **A:** Dukungan native multi-field Flow form (`flow_json` dengan banyak field terstruktur, validasi server-side, dsb — fitur "WhatsApp Flows" penuh) **belum diverifikasi tersedia** secara native di fork ini pada versi 3.2.12. Alternatif yang bisa dipakai sekarang adalah **form terpandu bertahap** (guided step-by-step): kirim serangkaian pertanyaan satu per satu memakai `interactiveMessage` biasa (teks/tombol/list) dan simpan progres jawaban di state percakapan bot Anda sendiri, alih-alih mengandalkan satu payload Flow form native. Jika kebutuhan Anda spesifik untuk Flow form penuh, pantau `CHANGELOG.md` untuk update fitur ini di rilis mendatang.
2352
2352
 
2353
2353
  ### Q: Pesan text saya yang mengandung URL tidak menampilkan link preview?
2354
2354
 
@@ -2870,7 +2870,7 @@ done
2870
2870
 
2871
2871
  Riwayat perubahan lengkap ada di [`CHANGELOG.md`](./CHANGELOG.md). Ringkasan rilis terbaru:
2872
2872
 
2873
- ### v3.2.10 (2026-07-06) — Bug Fix Kritis Group Status
2873
+ ### v3.2.12 (2026-07-06) — Bug Fix Kritis Group Status
2874
2874
 
2875
2875
  **Masalah:** status/story grup (`groupStatusMessage`) tidak pernah muncul sebagai ring status untuk anggota lain, walaupun `relayMessage()` berhasil tanpa error sama sekali.
2876
2876
 
@@ -482,6 +482,41 @@ export class ExtendedMessageBuilder {
482
482
  innerMessage = await this.bail.generateWAMessageContent(s, { upload: this.waUploadToServer });
483
483
  }
484
484
 
485
+ // PATCH (parity fix): WA client pakai contextInfo.isGroupStatus + statusSourceType
486
+ // pada pesan bagian dalam (mis. imageMessage.contextInfo) buat mutusin apakah
487
+ // pesan ini dirender sebagai STATUS RING grup atau cuma pesan biasa. Tanpa ini,
488
+ // relayMessage() tetap sukses (makanya kelihatan "berhasil" di reply bot) tapi
489
+ // WA client menampilkannya sebagai pesan biasa di dalam chat grup, bukan status —
490
+ // persis kayak yang sebelumnya kejadian di sini. Enum statusSourceType resmi WA:
491
+ // IMAGE=0, VIDEO=1, GIF=2, AUDIO=3, TEXT=4, MUSIC_STANDALONE=5.
492
+ const statusSourceTypeByType = {
493
+ imageMessage: 0,
494
+ videoMessage: s.gif ? 2 : 1,
495
+ audioMessage: 3,
496
+ extendedTextMessage: 4
497
+ };
498
+ const innerMsgKey = Object.keys(innerMessage).find(k => innerMessage[k] && typeof innerMessage[k] === 'object');
499
+ if (innerMsgKey) {
500
+ innerMessage[innerMsgKey].contextInfo = innerMessage[innerMsgKey].contextInfo || {};
501
+ innerMessage[innerMsgKey].contextInfo.isGroupStatus = true;
502
+ if (typeof innerMessage[innerMsgKey].contextInfo.statusSourceType !== 'number'
503
+ && typeof statusSourceTypeByType[innerMsgKey] === 'number') {
504
+ innerMessage[innerMsgKey].contextInfo.statusSourceType = statusSourceTypeByType[innerMsgKey];
505
+ }
506
+ // Opsional: { v2: true } — nambahin metadata "ring pink" (reshare-able, audience
507
+ // metadata, dst.) di atas Group Status biasa. Caller bisa override field spesifik
508
+ // lewat s.featureEligibilities / s.statusAttributions / s.statusAudienceMetadata.
509
+ if (s.v2 || s.richStatus) {
510
+ innerMessage[innerMsgKey].contextInfo.featureEligibilities = {
511
+ canBeReshared: true,
512
+ canReceiveMultiReact: false,
513
+ ...(s.featureEligibilities || {})
514
+ };
515
+ innerMessage[innerMsgKey].contextInfo.statusAttributions = s.statusAttributions || [{ type: 10 }];
516
+ innerMessage[innerMsgKey].contextInfo.statusAudienceMetadata = s.statusAudienceMetadata || { audienceType: 1 };
517
+ }
518
+ }
519
+
485
520
  // Wrap dengan messageContextInfo + messageSecret — WAJIB supaya konten bisa ditampilkan
486
521
  const wrapped = {
487
522
  groupStatusMessageV2: {
@@ -1,161 +1,267 @@
1
- import { Boom } from '@hapi/boom';
2
- import { proto } from '../../WAProto/index.js';
3
- import type { GroupMetadata, ParticipantAction, SocketConfig, WAMessageKey } from '../Types/index.js';
4
- import { type BinaryNode } from '../WABinary/index.js';
5
- export declare const makeGroupsSocket: (config: SocketConfig) => {
6
- groupMetadata: (jid: string) => Promise<GroupMetadata>;
7
- groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>;
8
- groupLeave: (id: string) => Promise<void>;
9
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
10
- groupRequestParticipantsList: (jid: string) => Promise<{
11
- [key: string]: string;
12
- }[]>;
13
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
14
- status: string;
15
- jid: string | undefined;
16
- }[]>;
17
- groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
18
- status: string;
19
- jid: string | undefined;
20
- content: BinaryNode;
21
- }[]>;
22
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
23
- groupInviteCode: (jid: string) => Promise<string | undefined>;
24
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
25
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
26
- /**
27
- * revoke a v4 invite for someone
28
- * @param groupJid group jid
29
- * @param invitedJid jid of person you invited
30
- * @returns true if successful
31
- */
32
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
33
- /**
34
- * accept a GroupInviteMessage
35
- * @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
36
- * @param inviteMessage the message to accept
37
- */
38
- groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
39
- groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
40
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
41
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
42
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
43
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
44
- groupFetchAllParticipating: () => Promise<{
45
- [_: string]: GroupMetadata;
46
- }>;
47
- serverProps: {
48
- privacyTokenOn1to1: boolean;
49
- profilePicPrivacyToken: boolean;
50
- lidTrustedTokenIssueToLid: boolean;
51
- };
52
- createCallLink: (type: "audio" | "video", event?: {
53
- startTime: number;
54
- }, timeoutMs?: number) => Promise<string | undefined>;
55
- getBotListV2: () => Promise<import("../Types/index.js").BotListInfo[]>;
56
- messageMutex: {
57
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
1
+ import type { proto } from '../../WAProto/index.js';
2
+
3
+ export type WAMediaUploadFunction = (stream: Buffer | NodeJS.ReadableStream, options?: {
4
+ fileEncSha256?: Buffer;
5
+ mediaType?: string;
6
+ newsletter?: boolean;
7
+ }) => Promise<{
8
+ url: string;
9
+ directPath: string;
10
+ }>;
11
+
12
+ export interface WAMessageContentGenerationOptions {
13
+ upload?: WAMediaUploadFunction;
14
+ mediaCache?: any;
15
+ options?: any;
16
+ logger?: any;
17
+ }
18
+
19
+ export interface ExtendedMessageUtils {
20
+ prepareWAMessageMedia: (media: any, options: WAMessageContentGenerationOptions) => Promise<any>;
21
+ generateWAMessageContent: (content: any, options: WAMessageContentGenerationOptions) => Promise<any>;
22
+ generateWAMessageFromContent: (jid: string, content: any, options?: any) => any;
23
+ generateWAMessage: (jid: string, content: any, options?: any) => Promise<any>;
24
+ generateMessageID: () => string;
25
+ /** Optional — kalau ada, dipakai buat kasih hint <biz>/<meta is_vsn2="1"/> node ke relayMessage(). */
26
+ buildInteractiveAdditionalNodes?: (jid: string, m: any) => any[];
27
+ /** Optional — canvas-rendered story card generator, lihat Utils/story-card.js. */
28
+ renderStoryCard?: (options: StoryCardOptions) => Promise<Buffer>;
29
+ }
30
+
31
+ export interface StickerMessage {
32
+ url: string;
33
+ fileSha256: Buffer | string;
34
+ fileEncSha256: Buffer | string;
35
+ mediaKey: Buffer | string;
36
+ mimetype: string;
37
+ directPath: string;
38
+ fileLength: number | string;
39
+ mediaKeyTimestamp: number | string;
40
+ isAnimated?: boolean;
41
+ stickerSentTs?: number | string;
42
+ isAvatar?: boolean;
43
+ isAiSticker?: boolean;
44
+ isLottie?: boolean;
45
+ }
46
+
47
+ export interface PaymentMessage {
48
+ amount: number;
49
+ currency?: string;
50
+ from?: string;
51
+ expiry?: number;
52
+ sticker?: { stickerMessage: StickerMessage };
53
+ note?: string;
54
+ background?: {
55
+ id?: string;
56
+ fileLength?: string;
57
+ width?: number;
58
+ height?: number;
59
+ mimetype?: string;
60
+ placeholderArgb?: number;
61
+ textArgb?: number;
62
+ subtextArgb?: number;
58
63
  };
59
- receiptMutex: {
60
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
64
+ }
65
+
66
+ export interface ProductMessage {
67
+ title: string;
68
+ description: string;
69
+ thumbnail: Buffer | { url: string };
70
+ productId: string;
71
+ retailerId: string;
72
+ url: string;
73
+ body?: string;
74
+ footer?: string;
75
+ buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
76
+ priceAmount1000?: number | null;
77
+ currencyCode?: string;
78
+ }
79
+
80
+ export interface ExternalAdReply {
81
+ title?: string;
82
+ body?: string;
83
+ mediaType?: number;
84
+ thumbnailUrl?: string;
85
+ mediaUrl?: string;
86
+ sourceUrl?: string;
87
+ showAdAttribution?: boolean;
88
+ renderLargerThumbnail?: boolean;
89
+ [key: string]: any;
90
+ }
91
+
92
+ export interface InteractiveMessage {
93
+ header?: string;
94
+ title: string;
95
+ footer?: string;
96
+ thumbnail?: string | Buffer | { url: string };
97
+ image?: string | Buffer | { url: string };
98
+ video?: string | Buffer | { url: string };
99
+ document?: string | Buffer | { url: string };
100
+ mimetype?: string;
101
+ fileName?: string;
102
+ jpegThumbnail?: string | Buffer | { url: string };
103
+ contextInfo?: {
104
+ mentionedJid?: string[];
105
+ forwardingScore?: number;
106
+ isForwarded?: boolean;
107
+ externalAdReply?: ExternalAdReply;
108
+ [key: string]: any;
61
109
  };
62
- appStatePatchMutex: {
63
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
110
+ externalAdReply?: ExternalAdReply;
111
+ buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
112
+ nativeFlowMessage?: {
113
+ messageParamsJson?: string;
114
+ buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
115
+ [key: string]: any;
64
116
  };
65
- notificationMutex: {
66
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
117
+ }
118
+
119
+ export interface AlbumItem {
120
+ image?: string | Buffer | { url: string; caption?: string };
121
+ video?: string | Buffer | { url: string; caption?: string };
122
+ }
123
+
124
+ export interface EventMessageLocation {
125
+ degreesLatitude: number;
126
+ degreesLongitude: number;
127
+ name: string;
128
+ }
129
+
130
+ export interface EventMessage {
131
+ isCanceled?: boolean;
132
+ name: string;
133
+ description: string;
134
+ location?: EventMessageLocation;
135
+ joinLink?: string;
136
+ startTime?: string | number;
137
+ endTime?: string | number;
138
+ extraGuestsAllowed?: boolean;
139
+ }
140
+
141
+ export interface PollVote {
142
+ optionName: string;
143
+ optionVoteCount: string | number;
144
+ }
145
+
146
+ export interface PollResultMessage {
147
+ name: string;
148
+ pollVotes: PollVote[];
149
+ }
150
+
151
+ export interface StoryCardOptions {
152
+ title?: string;
153
+ body?: string;
154
+ footer?: string;
155
+ gradient?: 'sunset' | 'purple' | 'ocean' | 'forest' | 'midnight' | 'fire';
156
+ colors?: [string, string];
157
+ direction?: 'vertical' | 'diagonal';
158
+ width?: number;
159
+ height?: number;
160
+ }
161
+
162
+ export interface GroupStatusMessage {
163
+ /** Mode 3 (advanced): pre-built inner WAMessage — di-wrap langsung dengan messageSecret. */
164
+ message?: any;
165
+ /** Mode 1: raw relay / forward story langsung, bypass semua processing lain. */
166
+ raw?: any;
167
+
168
+ /** Teks story. Kalau kosong dan gak ada media lain, fallback text-mode dengan string kosong. */
169
+ text?: string;
170
+ /** Dipakai sebagai caption untuk media, atau fallback text kalau `text` kosong. */
171
+ caption?: string;
172
+
173
+ image?: string | Buffer | { url: string };
174
+ video?: string | Buffer | { url: string };
175
+ /** Shorthand: dikirim sebagai video looping (`gifPlayback: true` otomatis di-set). */
176
+ gif?: string | Buffer | { url: string };
177
+ audio?: string | Buffer | { url: string };
178
+ sticker?: string | Buffer | { url: string };
179
+ document?: string | Buffer | { url: string };
180
+ /** Canvas-rendered story card (gradient + title/body/footer), lihat Utils/story-card.js. */
181
+ card?: StoryCardOptions;
182
+
183
+ /** Teks & audio (ptt) saja — ARGB hex (mis. 0xFF128C7E). */
184
+ backgroundColor?: number;
185
+ /** Teks saja. */
186
+ textArgb?: number;
187
+ /** Teks saja, 0-5. */
188
+ font?: number;
189
+
190
+ /** Video & gif. */
191
+ gifPlayback?: boolean;
192
+ /** Video/audio — durasi dalam detik. */
193
+ seconds?: number;
194
+
195
+ /** Audio: voice note (true, default) atau musik biasa (false). */
196
+ ptt?: boolean;
197
+ /** Audio/document. */
198
+ mimetype?: string;
199
+ /** Document. */
200
+ fileName?: string;
201
+
202
+ /** Didukung di semua mode (text/image/card/gif/video/audio/sticker/document). */
203
+ mentions?: string[];
204
+
205
+ /** Aktifkan metadata Group Status "V2" (ring pink) — reshare-able, audience metadata, dst. */
206
+ v2?: boolean;
207
+ /** Alias dari `v2`. */
208
+ richStatus?: boolean;
209
+ /** Override untuk field featureEligibilities saat v2/richStatus aktif. */
210
+ featureEligibilities?: { canBeReshared?: boolean; canReceiveMultiReact?: boolean; [key: string]: any };
211
+ /** Override untuk field statusAttributions saat v2/richStatus aktif. */
212
+ statusAttributions?: Array<{ type: number; [key: string]: any }>;
213
+ /** Override untuk field statusAudienceMetadata saat v2/richStatus aktif. */
214
+ statusAudienceMetadata?: { audienceType?: number; [key: string]: any };
215
+
216
+ [key: string]: any;
217
+ }
218
+
219
+ export interface ExtendedMessageContent {
220
+ requestPaymentMessage?: PaymentMessage;
221
+ productMessage?: ProductMessage;
222
+ interactiveMessage?: InteractiveMessage;
223
+ albumMessage?: AlbumItem[];
224
+ eventMessage?: EventMessage;
225
+ pollResultMessage?: PollResultMessage;
226
+ groupStatusMessage?: GroupStatusMessage;
227
+ sender?: string;
228
+ }
229
+
230
+ export type ExtendedMessageType = 'PAYMENT' | 'PRODUCT' | 'INTERACTIVE' | 'ALBUM' | 'EVENT' | 'POLL_RESULT' | 'GROUP_STORY';
231
+
232
+ export declare class ExtendedMessageBuilder {
233
+ utils: ExtendedMessageUtils;
234
+ relayMessage: (jid: string, content: any, options?: any) => Promise<any>;
235
+ waUploadToServer: WAMediaUploadFunction;
236
+ bail: {
237
+ generateWAMessageContent: ExtendedMessageUtils['generateWAMessageContent'];
238
+ generateMessageID: () => string;
239
+ getContentType: (msg: any) => string;
67
240
  };
68
- fetchPrivacySettings: (force?: boolean) => Promise<{
69
- [_: string]: string;
241
+
242
+ constructor(utils: ExtendedMessageUtils, waUploadToServer: WAMediaUploadFunction, relayMessageFn: (jid: string, content: any, options?: any) => Promise<any>);
243
+
244
+ detectType(content: ExtendedMessageContent): ExtendedMessageType | null;
245
+
246
+ handlePayment(content: { requestPaymentMessage: PaymentMessage }, quoted?: proto.IWebMessageInfo | null): Promise<{
247
+ requestPaymentMessage: proto.Message.RequestPaymentMessage;
70
248
  }>;
71
- upsertMessage: (msg: import("../Types/index.js").WAMessage, type: import("../Types/index.js").MessageUpsertType) => Promise<void>;
72
- appPatch: (patchCreate: import("../Types/index.js").WAPatchCreate) => Promise<void>;
73
- sendPresenceUpdate: (type: import("../Types/index.js").WAPresence, toJid?: string) => Promise<void>;
74
- presenceSubscribe: (toJid: string) => Promise<void>;
75
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
76
- fetchBlocklist: () => Promise<(string | undefined)[]>;
77
- fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
78
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
79
- updateProfilePicture: (jid: string, content: import("../Types/index.js").WAMediaUpload, dimensions?: {
80
- width: number;
81
- height: number;
82
- }) => Promise<void>;
83
- removeProfilePicture: (jid: string) => Promise<void>;
84
- updateProfileStatus: (status: string) => Promise<void>;
85
- updateProfileName: (name: string) => Promise<void>;
86
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
87
- updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
88
- updateCallPrivacy: (value: import("../Types/index.js").WAPrivacyCallValue) => Promise<void>;
89
- updateMessagesPrivacy: (value: import("../Types/index.js").WAPrivacyMessagesValue) => Promise<void>;
90
- updateLastSeenPrivacy: (value: import("../Types/index.js").WAPrivacyValue) => Promise<void>;
91
- updateOnlinePrivacy: (value: import("../Types/index.js").WAPrivacyOnlineValue) => Promise<void>;
92
- updateProfilePicturePrivacy: (value: import("../Types/index.js").WAPrivacyValue) => Promise<void>;
93
- updateStatusPrivacy: (value: import("../Types/index.js").WAPrivacyValue) => Promise<void>;
94
- updateReadReceiptsPrivacy: (value: import("../Types/index.js").WAReadReceiptsValue) => Promise<void>;
95
- updateGroupsAddPrivacy: (value: import("../Types/index.js").WAPrivacyGroupAddValue) => Promise<void>;
96
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
97
- getBusinessProfile: (jid: string) => Promise<import("../Types/index.js").WABusinessProfile | void>;
98
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
99
- chatModify: (mod: import("../Types/index.js").ChatModification, jid: string) => Promise<void>;
100
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
101
- addOrEditContact: (jid: string, contact: proto.SyncActionValue.IContactAction) => Promise<void>;
102
- removeContact: (jid: string) => Promise<void>;
103
- placeholderResendCache: import("../Types/index.js").CacheStore;
104
- addLabel: (jid: string, labels: import("../Types/Label.js").LabelActionBody) => Promise<void>;
105
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
106
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
107
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
108
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
109
- star: (jid: string, messages: {
110
- id: string;
111
- fromMe?: boolean;
112
- }[], star: boolean) => Promise<void>;
113
- addOrEditQuickReply: (quickReply: import("../Types/Bussines.js").QuickReplyAction) => Promise<void>;
114
- removeQuickReply: (timestamp: string) => Promise<void>;
115
- type: "md";
116
- ws: import("./Client/websocket.js").WebSocketClient;
117
- ev: import("../Types/index.js").BaileysEventEmitter & {
118
- process(handler: (events: Partial<import("../Types/index.js").BaileysEventMap>) => void | Promise<void>): () => void;
119
- buffer(): void;
120
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
121
- flush(): boolean;
122
- isBuffering(): boolean;
123
- destroy(): void;
124
- };
125
- authState: {
126
- creds: import("../Types/index.js").AuthenticationCreds;
127
- keys: import("../Types/index.js").SignalKeyStoreWithTransaction;
128
- };
129
- signalRepository: import("../Types/index.js").SignalRepositoryWithLIDStore;
130
- user: import("../Types/index.js").Contact | undefined;
131
- generateMessageTag: () => string;
132
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
133
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
134
- waitForSocketOpen: () => Promise<void>;
135
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
136
- sendNode: (frame: BinaryNode) => Promise<void>;
137
- logout: (msg?: string) => Promise<void>;
138
- end: (error: Error | undefined) => Promise<void>;
139
- registerSocketEndHandler: (handler: (error: Error | undefined) => void | Promise<void>) => void;
140
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
141
- uploadPreKeys: (count?: number) => Promise<void>;
142
- uploadPreKeysToServerIfRequired: () => Promise<void>;
143
- digestKeyBundle: () => Promise<void>;
144
- rotateSignedPreKey: () => Promise<void>;
145
- requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
146
- updateServerTimeOffset: ({ attrs }: BinaryNode) => void;
147
- sendUnifiedSession: () => Promise<void>;
148
- wamBuffer: import("../index.js").BinaryInfo;
149
- waitForConnectionUpdate: (check: (u: Partial<import("../Types/index.js").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
150
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
151
- executeUSyncQuery: (usyncQuery: import("../index.js").USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
152
- onWhatsApp: (...phoneNumber: string[]) => Promise<{
153
- jid: string;
154
- exists: boolean;
155
- }[] | undefined>;
156
- fetchAccountReachoutTimelock: () => Promise<import("../Types/index.js").ReachoutTimelockState>;
157
- fetchNewChatMessageCap: () => Promise<import("../Types/index.js").NewChatMessageCapInfo>;
158
- };
159
- export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;
160
- export type GroupsSocket = ReturnType<typeof makeGroupsSocket>;
161
- //# sourceMappingURL=groups.d.ts.map
249
+
250
+ handleProduct(content: { productMessage: ProductMessage }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<{
251
+ viewOnceMessage: { message: { interactiveMessage: any } };
252
+ }>;
253
+
254
+ handleInteractive(content: { interactiveMessage: InteractiveMessage }, jid: string, quoted?: proto.IWebMessageInfo | null, options?: { mentions?: string[] }): Promise<{
255
+ interactiveMessage: any;
256
+ }>;
257
+
258
+ handleAlbum(content: { albumMessage: AlbumItem[] }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<any>;
259
+
260
+ handleEvent(content: { eventMessage: EventMessage }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<any>;
261
+
262
+ handlePollResult(content: { pollResultMessage: PollResultMessage }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<any>;
263
+
264
+ handleGroupStory(content: { groupStatusMessage: GroupStatusMessage }, jid: string): Promise<any>;
265
+ }
266
+
267
+ export default ExtendedMessageBuilder;
@@ -5,7 +5,7 @@ import type { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelay
5
5
  import { MessageRetryManager } from '../Utils/index.js';
6
6
  import { type BinaryNode, type JidWithDevice } from '../WABinary/index.js';
7
7
  import { USyncQuery } from '../WAUSync/index.js';
8
- import { ExtendedMessageBuilder } from './dugong.js';
8
+ import { ExtendedMessageBuilder, type GroupStatusMessage } from './dugong.js';
9
9
  export declare const makeMessagesSocket: (config: SocketConfig) => {
10
10
  userDevicesCache: import("../Types/index.js").PossiblyExtendedCacheStore | NodeCache<JidWithDevice[]>;
11
11
  devicesMutex: {
@@ -36,6 +36,11 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
36
36
  updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
37
37
  updateMediaMessage: (message: WAMessage) => Promise<WAMessage>;
38
38
  sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WAMessage | undefined>;
39
+ /**
40
+ * Shorthand buat kirim Group Status (story ke grup) — setara `sock.swgc()` di Ourin-Baileys.
41
+ * Support semua tipe media: text, image, video, gif, audio, sticker, document, card, message, raw.
42
+ */
43
+ swgc: (jid: string, content: GroupStatusMessage, options?: Record<string, any>) => Promise<any>;
39
44
  newsletterCreate: (name: string, description?: string) => Promise<import("../Types/index.js").NewsletterMetadata>;
40
45
  newsletterUpdate: (jid: string, updates: import("../Types/index.js").NewsletterUpdate) => Promise<unknown>;
41
46
  newsletterSubscribers: (jid: string) => Promise<{
@@ -1201,6 +1201,25 @@ export const makeMessagesSocket = (config) => {
1201
1201
  }
1202
1202
  return fullMsg;
1203
1203
  }
1204
+ },
1205
+ /**
1206
+ * Kirim Group Status (story ke grup) dengan sintaks pendek — kompatibel dengan
1207
+ * `sock.swgc()` di Ourin-Baileys, supaya plugin yang di-port dari Ourin-MD
1208
+ * (yang manggil `conn.swgc(jid, { image, caption })`, dst.) langsung jalan tanpa
1209
+ * perlu ditulis ulang jadi `sendMessage(jid, { groupStatusMessage: ... })`.
1210
+ *
1211
+ * Semua tipe media didukung, sama seperti extendedMessages.handleGroupStory():
1212
+ * text, image, video, gif, audio, sticker, document, card (canvas story-card),
1213
+ * message (raw WAMessage siap pakai), raw (relay langsung / forward story).
1214
+ *
1215
+ * @param jid JID grup tujuan (wajib grup)
1216
+ * @param content payload sama seperti isi `groupStatusMessage`, lihat GroupStatusMessage di dugong.d.ts
1217
+ */
1218
+ swgc: async (jid, content, options = {}) => {
1219
+ if (!isJidGroup(jid)) {
1220
+ throw new Boom('swgc() cuma bisa dipakai buat kirim Group Status ke JID grup', { statusCode: 400 });
1221
+ }
1222
+ return await extendedMessages.handleGroupStory({ groupStatusMessage: content }, jid);
1204
1223
  }
1205
1224
  };
1206
1225
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinzsocket/baileys",
3
3
  "type": "module",
4
- "version": "3.2.10",
4
+ "version": "3.2.12",
5
5
  "description": "A WebSockets library for interacting with WhatsApp Web",
6
6
  "keywords": [
7
7
  "whatsapp",