@vinzsocket/baileys 3.2.12 → 3.2.13
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 +5 -5
- package/lib/Socket/dugong.d.ts +17 -0
- package/lib/Socket/dugong.js +119 -35
- package/lib/Socket/groups.d.ts +156 -262
- package/lib/Socket/messages-send.d.ts +5 -6
- package/lib/Socket/messages-send.js +27 -22
- package/package.json +1 -1
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
|
[](https://github.com/VinzSocket/Baileys)
|
|
8
|
-

|
|
9
9
|

|
|
10
10
|

|
|
11
11
|

|
|
@@ -1218,7 +1218,7 @@ await conn.sendMessage(groupJid, {
|
|
|
1218
1218
|
})
|
|
1219
1219
|
```
|
|
1220
1220
|
|
|
1221
|
-
> ⚠️ **Penting:** sejak v3.2.
|
|
1221
|
+
> ⚠️ **Penting:** sejak v3.2.13, 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.13](#-changelog-ringkas). Jika Anda memakai versi ≥ 3.2.13, 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.
|
|
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.13 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.
|
|
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.13. 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.
|
|
2873
|
+
### v3.2.13 (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
|
|
package/lib/Socket/dugong.d.ts
CHANGED
|
@@ -26,6 +26,16 @@ export interface ExtendedMessageUtils {
|
|
|
26
26
|
buildInteractiveAdditionalNodes?: (jid: string, m: any) => any[];
|
|
27
27
|
/** Optional — canvas-rendered story card generator, lihat Utils/story-card.js. */
|
|
28
28
|
renderStoryCard?: (options: StoryCardOptions) => Promise<Buffer>;
|
|
29
|
+
/** Diperlukan oleh sendStatusWhatsApp(): auth state (buat ambil JID sendiri). */
|
|
30
|
+
authState?: any;
|
|
31
|
+
/** Diperlukan oleh sendStatusWhatsApp(): resolve member grup buat statusJidList. */
|
|
32
|
+
groupMetadata?: (jid: string) => Promise<any>;
|
|
33
|
+
logger?: any;
|
|
34
|
+
linkPreviewImageThumbnailWidth?: number;
|
|
35
|
+
generateHighQualityLinkPreview?: boolean;
|
|
36
|
+
httpRequestOptions?: any;
|
|
37
|
+
mediaCache?: any;
|
|
38
|
+
getUrlInfo?: (text: string, opts?: any) => Promise<any>;
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
export interface StickerMessage {
|
|
@@ -251,6 +261,13 @@ export declare class ExtendedMessageBuilder {
|
|
|
251
261
|
handlePollResult(content: { pollResultMessage: PollResultMessage }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<any>;
|
|
252
262
|
|
|
253
263
|
handleGroupStory(content: { groupStatusMessage: GroupStatusMessage }, jid: string): Promise<any>;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Kirim WhatsApp Status (story) sungguhan ke `status@broadcast`, mendukung
|
|
267
|
+
* semua tipe media (text/image/video/gif/audio) sekaligus statusJidList
|
|
268
|
+
* dan status-mention follow-up ke tiap jids.
|
|
269
|
+
*/
|
|
270
|
+
sendStatusWhatsApp(content: GroupStatusMessage, jids?: string[]): Promise<any>;
|
|
254
271
|
}
|
|
255
272
|
|
|
256
273
|
export default ExtendedMessageBuilder;
|
package/lib/Socket/dugong.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { randomBytes } from 'crypto';
|
|
6
6
|
import { proto } from '../../WAProto/index.js';
|
|
7
7
|
import { normalizeMentions } from '../Utils/mention.js';
|
|
8
|
+
import { delay } from '../Utils/generics.js';
|
|
9
|
+
import { isJidGroup, isPnUser, jidNormalizedUser, STORIES_JID } from '../WABinary/index.js';
|
|
8
10
|
|
|
9
11
|
// ─── NF V7 Button Builders ────────────────────────────────────────────────────
|
|
10
12
|
|
|
@@ -482,41 +484,6 @@ export class ExtendedMessageBuilder {
|
|
|
482
484
|
innerMessage = await this.bail.generateWAMessageContent(s, { upload: this.waUploadToServer });
|
|
483
485
|
}
|
|
484
486
|
|
|
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
|
-
|
|
520
487
|
// Wrap dengan messageContextInfo + messageSecret — WAJIB supaya konten bisa ditampilkan
|
|
521
488
|
const wrapped = {
|
|
522
489
|
groupStatusMessageV2: {
|
|
@@ -540,6 +507,123 @@ export class ExtendedMessageBuilder {
|
|
|
540
507
|
additionalNodes
|
|
541
508
|
});
|
|
542
509
|
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Kirim WhatsApp Status (story) beneran ke `status@broadcast`, lengkap dengan
|
|
513
|
+
* statusJidList (siapa aja yang boleh lihat) dan status-mention follow-up
|
|
514
|
+
* (biar penerima yang di-mention dapet notif). Mendukung SEMUA tipe media
|
|
515
|
+
* (text/image/video/gif via video+gifPlayback/audio) — dipilih otomatis dari
|
|
516
|
+
* field yang ada di `content`, sama seperti bawaan generateWAMessage().
|
|
517
|
+
*
|
|
518
|
+
* jids: campuran nomor pribadi & JID grup — kalau grup, semua member-nya
|
|
519
|
+
* otomatis ditambahkan ke daftar penerima status (statusJidList) dan
|
|
520
|
+
* masing-masing dikirimi status-mention.
|
|
521
|
+
*/
|
|
522
|
+
async sendStatusWhatsApp(content, jids = []) {
|
|
523
|
+
const { authState, groupMetadata, logger, linkPreviewImageThumbnailWidth, generateHighQualityLinkPreview, httpRequestOptions, mediaCache, getUrlInfo } = this.utils;
|
|
524
|
+
const userJid = jidNormalizedUser(authState.creds.me.id);
|
|
525
|
+
const allUsers = new Set([userJid]);
|
|
526
|
+
for (const id of jids) {
|
|
527
|
+
if (isJidGroup(id)) {
|
|
528
|
+
try {
|
|
529
|
+
const metadata = await groupMetadata(id);
|
|
530
|
+
metadata.participants.forEach(p => allUsers.add(jidNormalizedUser(p.id)));
|
|
531
|
+
}
|
|
532
|
+
catch (error) {
|
|
533
|
+
logger?.error(`Error getting metadata for group ${id}: ${error}`);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
else if (isPnUser(id)) {
|
|
537
|
+
allUsers.add(jidNormalizedUser(id));
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
const uniqueUsers = Array.from(allUsers);
|
|
541
|
+
const getRandomHexColor = () => '#' + Math.floor(Math.random() * 16777215).toString(16).padStart(6, '0');
|
|
542
|
+
const isMedia = !!(content.image || content.video || content.audio);
|
|
543
|
+
const isAudio = !!content.audio;
|
|
544
|
+
const messageContent = { ...content };
|
|
545
|
+
if (isMedia && !isAudio) {
|
|
546
|
+
if (messageContent.text) {
|
|
547
|
+
messageContent.caption = messageContent.text;
|
|
548
|
+
delete messageContent.text;
|
|
549
|
+
}
|
|
550
|
+
delete messageContent.ptt;
|
|
551
|
+
delete messageContent.font;
|
|
552
|
+
delete messageContent.backgroundColor;
|
|
553
|
+
delete messageContent.textColor;
|
|
554
|
+
}
|
|
555
|
+
if (isAudio) {
|
|
556
|
+
delete messageContent.text;
|
|
557
|
+
delete messageContent.caption;
|
|
558
|
+
delete messageContent.font;
|
|
559
|
+
delete messageContent.textColor;
|
|
560
|
+
}
|
|
561
|
+
const font = !isMedia ? (content.font ?? Math.floor(Math.random() * 9)) : undefined;
|
|
562
|
+
const textColor = !isMedia ? (content.textColor || getRandomHexColor()) : undefined;
|
|
563
|
+
const backgroundColor = (!isMedia || isAudio) ? (content.backgroundColor || getRandomHexColor()) : undefined;
|
|
564
|
+
const ptt = isAudio ? (typeof content.ptt === 'boolean' ? content.ptt : true) : undefined;
|
|
565
|
+
const msg = await this.utils.generateWAMessage(STORIES_JID, messageContent, {
|
|
566
|
+
logger,
|
|
567
|
+
userJid,
|
|
568
|
+
getUrlInfo: (text) => getUrlInfo(text, {
|
|
569
|
+
thumbnailWidth: linkPreviewImageThumbnailWidth,
|
|
570
|
+
fetchOpts: { timeout: 3000, ...(httpRequestOptions || {}) },
|
|
571
|
+
logger,
|
|
572
|
+
uploadImage: generateHighQualityLinkPreview ? this.waUploadToServer : undefined
|
|
573
|
+
}),
|
|
574
|
+
upload: this.waUploadToServer,
|
|
575
|
+
mediaCache,
|
|
576
|
+
options: httpRequestOptions,
|
|
577
|
+
font,
|
|
578
|
+
textColor,
|
|
579
|
+
backgroundColor,
|
|
580
|
+
ptt
|
|
581
|
+
});
|
|
582
|
+
await this.relayMessage(STORIES_JID, msg.message, {
|
|
583
|
+
messageId: msg.key.id,
|
|
584
|
+
statusJidList: uniqueUsers,
|
|
585
|
+
additionalNodes: [
|
|
586
|
+
{
|
|
587
|
+
tag: 'meta',
|
|
588
|
+
attrs: {},
|
|
589
|
+
content: [
|
|
590
|
+
{
|
|
591
|
+
tag: 'mentioned_users',
|
|
592
|
+
attrs: {},
|
|
593
|
+
content: jids.map(jid => ({ tag: 'to', attrs: { jid: jidNormalizedUser(jid) } }))
|
|
594
|
+
}
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
]
|
|
598
|
+
});
|
|
599
|
+
for (const id of jids) {
|
|
600
|
+
try {
|
|
601
|
+
const normalizedId = jidNormalizedUser(id);
|
|
602
|
+
const isPrivate = isPnUser(normalizedId);
|
|
603
|
+
const type = isPrivate ? 'statusMentionMessage' : 'groupStatusMentionMessage';
|
|
604
|
+
const protocolMessage = {
|
|
605
|
+
[type]: { message: { protocolMessage: { key: msg.key, type: 25 } } },
|
|
606
|
+
messageContextInfo: { messageSecret: randomBytes(32) }
|
|
607
|
+
};
|
|
608
|
+
const statusMsg = await this.utils.generateWAMessageFromContent(normalizedId, protocolMessage, {
|
|
609
|
+
userJid: jidNormalizedUser(authState?.creds?.me?.id || '')
|
|
610
|
+
});
|
|
611
|
+
await this.relayMessage(normalizedId, statusMsg.message, {
|
|
612
|
+
additionalNodes: [
|
|
613
|
+
{
|
|
614
|
+
tag: 'meta',
|
|
615
|
+
attrs: isPrivate ? { is_status_mention: 'true' } : { is_group_status_mention: 'true' }
|
|
616
|
+
}
|
|
617
|
+
]
|
|
618
|
+
});
|
|
619
|
+
await delay(2000);
|
|
620
|
+
}
|
|
621
|
+
catch (error) {
|
|
622
|
+
logger?.error(`Error sending to ${id}: ${error}`);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
return msg;
|
|
626
|
+
}
|
|
543
627
|
}
|
|
544
628
|
|
|
545
629
|
export default ExtendedMessageBuilder;
|
package/lib/Socket/groups.d.ts
CHANGED
|
@@ -1,267 +1,161 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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;
|
|
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;
|
|
63
51
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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;
|
|
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>;
|
|
109
58
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
nativeFlowMessage?: {
|
|
113
|
-
messageParamsJson?: string;
|
|
114
|
-
buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
|
|
115
|
-
[key: string]: any;
|
|
59
|
+
receiptMutex: {
|
|
60
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
116
61
|
};
|
|
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;
|
|
62
|
+
appStatePatchMutex: {
|
|
63
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
240
64
|
};
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
handlePayment(content: { requestPaymentMessage: PaymentMessage }, quoted?: proto.IWebMessageInfo | null): Promise<{
|
|
247
|
-
requestPaymentMessage: proto.Message.RequestPaymentMessage;
|
|
248
|
-
}>;
|
|
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;
|
|
65
|
+
notificationMutex: {
|
|
66
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
67
|
+
};
|
|
68
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
69
|
+
[_: string]: string;
|
|
256
70
|
}>;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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
|
|
@@ -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
|
|
8
|
+
import { ExtendedMessageBuilder } from './dugong.js';
|
|
9
9
|
export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
10
10
|
userDevicesCache: import("../Types/index.js").PossiblyExtendedCacheStore | NodeCache<JidWithDevice[]>;
|
|
11
11
|
devicesMutex: {
|
|
@@ -21,6 +21,10 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
21
21
|
getMediaHost: () => string;
|
|
22
22
|
waUploadToServer: import("../Types/index.js").WAMediaUploadFunction;
|
|
23
23
|
extendedMessages: ExtendedMessageBuilder;
|
|
24
|
+
/** Kirim WhatsApp Status (story) beneran ke status@broadcast — semua tipe media, plus statusJidList & status-mention follow-up. */
|
|
25
|
+
sendStatusMention: (content: import("./dugong.js").GroupStatusMessage, jids?: string[]) => Promise<WAMessage>;
|
|
26
|
+
/** Send WA Group Chat: kirim konten story-styled (semua type, lihat handleGroupStory) langsung ke chat sebuah grup. `jid` wajib group JID. */
|
|
27
|
+
swgc: (jid: string, content: import("./dugong.js").GroupStatusMessage, options?: { quoted?: proto.IWebMessageInfo | null }) => Promise<any>;
|
|
24
28
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
25
29
|
[_: string]: string;
|
|
26
30
|
}>;
|
|
@@ -36,11 +40,6 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
36
40
|
updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
|
|
37
41
|
updateMediaMessage: (message: WAMessage) => Promise<WAMessage>;
|
|
38
42
|
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>;
|
|
44
43
|
newsletterCreate: (name: string, description?: string) => Promise<import("../Types/index.js").NewsletterMetadata>;
|
|
45
44
|
newsletterUpdate: (jid: string, updates: import("../Types/index.js").NewsletterUpdate) => Promise<unknown>;
|
|
46
45
|
newsletterSubscribers: (jid: string) => Promise<{
|
|
@@ -985,7 +985,16 @@ export const makeMessagesSocket = (config) => {
|
|
|
985
985
|
generateWAMessage,
|
|
986
986
|
generateWAMessageFromContent,
|
|
987
987
|
prepareWAMessageMedia,
|
|
988
|
-
renderStoryCard
|
|
988
|
+
renderStoryCard,
|
|
989
|
+
// Ditambahkan untuk sendStatusWhatsApp() — status/story ke status@broadcast.
|
|
990
|
+
authState,
|
|
991
|
+
groupMetadata,
|
|
992
|
+
logger,
|
|
993
|
+
linkPreviewImageThumbnailWidth,
|
|
994
|
+
generateHighQualityLinkPreview,
|
|
995
|
+
httpRequestOptions,
|
|
996
|
+
mediaCache: config.mediaCache,
|
|
997
|
+
getUrlInfo
|
|
989
998
|
}, waUploadToServer, relayMessage);
|
|
990
999
|
const waitForMsgMediaUpdate = bindWaitForEvent(ev, 'messages.media-update');
|
|
991
1000
|
registerSocketEndHandler(() => {
|
|
@@ -1012,6 +1021,22 @@ export const makeMessagesSocket = (config) => {
|
|
|
1012
1021
|
getMediaHost: () => mediaHost,
|
|
1013
1022
|
waUploadToServer,
|
|
1014
1023
|
extendedMessages,
|
|
1024
|
+
// Kirim WhatsApp Status (story) beneran ke status@broadcast — semua tipe
|
|
1025
|
+
// media (text/image/video/gif/audio), plus statusJidList & status-mention
|
|
1026
|
+
// follow-up otomatis ke tiap jid yang di-mention.
|
|
1027
|
+
sendStatusMention: async (content, jids = []) => {
|
|
1028
|
+
return await extendedMessages.sendStatusWhatsApp(content, jids);
|
|
1029
|
+
},
|
|
1030
|
+
// Send WA Group Chat: kirim konten story-styled (text/image/card/gif/
|
|
1031
|
+
// video/audio/sticker/document — semua type didukung, lihat
|
|
1032
|
+
// handleGroupStory di dugong.js) langsung ke chat sebuah grup.
|
|
1033
|
+
swgc: async (jid, content, options = {}) => {
|
|
1034
|
+
if (!isJidGroup(jid)) {
|
|
1035
|
+
throw new Boom('JID must be a group', { statusCode: 400 });
|
|
1036
|
+
}
|
|
1037
|
+
const storyContent = { groupStatusMessage: content };
|
|
1038
|
+
return await extendedMessages.handleGroupStory(storyContent, jid, options.quoted || null);
|
|
1039
|
+
},
|
|
1015
1040
|
fetchPrivacySettings,
|
|
1016
1041
|
sendPeerDataOperationMessage,
|
|
1017
1042
|
createParticipantNodes,
|
|
@@ -1201,26 +1226,6 @@ export const makeMessagesSocket = (config) => {
|
|
|
1201
1226
|
}
|
|
1202
1227
|
return fullMsg;
|
|
1203
1228
|
}
|
|
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);
|
|
1223
1229
|
}
|
|
1224
1230
|
};
|
|
1225
|
-
};
|
|
1226
|
-
//# sourceMappingURL=messages-send.js.map
|
|
1231
|
+
};
|