kage-baileys 25.4.20 → 26.11.35

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
@@ -4,8 +4,8 @@
4
4
 
5
5
  # KAGE BAILEYS
6
6
 
7
- **Kage Baileys — la mejor Baileys de 2026.**
8
- API de WhatsApp Web más completa: portada de perfil (cuentas normales y Business), avatares por defecto estilo WhatsApp, botones, carruseles, Native Flows, VoIP, canales, comunidades, Meta AI, mapeo LID, álbumes, tablas, bloques de código y soporte total del protocolo. Documentación 100 % en español.
7
+ **Kage Baileys — edición de mantenimiento del 30 de noviembre de 2026.**
8
+ Motor extendido de WhatsApp Web: portada de perfil (cuentas normales y Business), avatares por defecto estilo WhatsApp, botones, carruseles, Native Flows, gestión de llamadas, canales, comunidades, Meta AI, mapeo LID, álbumes, tablas y bloques de código. Documentación 100 % en español.
9
9
 
10
10
  Documentación 100 % en español
11
11
 
@@ -1221,7 +1221,7 @@ await sock.sendMessage(jid, {
1221
1221
  ### Paquete de stickers
1222
1222
 
1223
1223
  > [!IMPORTANT]
1224
- > Sin `sharp` ni `@napi-rs/image`, la portada (`cover`) y los stickers deben estar ya en formato WebP.
1224
+ > Para convertir archivos que no sean WebP instala `sharp` o `@napi-rs/image`. Si los stickers y la portada ya son WebP, no necesitan conversión.
1225
1225
 
1226
1226
  ```javascript
1227
1227
  await sock.sendMessage(jid, {
@@ -1229,21 +1229,26 @@ await sock.sendMessage(jid, {
1229
1229
  name: 'Mi pack',
1230
1230
  publisher: 'kage-baileys',
1231
1231
  description: 'Descripción',
1232
+ packId: 'mi-pack-01', // opcional
1232
1233
  cover: Buffer, // Buffer de imagen
1233
1234
  stickers: [
1234
1235
  {
1235
- sticker: { url: 'https://example.com/sticker.webp' },
1236
- emojis: ['❤'], // opcional
1237
- accessibilityLabel: '', // opcional
1236
+ data: Buffer, // también se acepta la propiedad sticker
1237
+ emojis: ['❤'], // opcional
1238
+ accessibilityLabel: '', // opcional
1238
1239
  isLottie: false, // opcional
1239
1240
  isAnimated: false // opcional
1240
1241
  },
1241
- { sticker: Buffer, emojis: ['❤'] }
1242
+ { sticker: { url: 'https://example.com/sticker.webp' }, emojis: ['❤'] }
1242
1243
  ]
1243
1244
  }
1244
- })
1245
+ }, { quoted: message })
1245
1246
  ```
1246
1247
 
1248
+ El envío genera un único mensaje `stickerPackMessage`: crea el ZIP del paquete, cifra los datos, sube el archivo y la miniatura y después construye el protobuf de WhatsApp. Se admiten `data`, `sticker` o un `Buffer` directo en cada entrada.
1249
+
1250
+ Para ver los cambios de compatibilidad y sus límites, consulta [REPARACION-STICKER-PACK-ES.md](REPARACION-STICKER-PACK-ES.md) y [INFORME-INTEGRACION-ES.md](INFORME-INTEGRACION-ES.md).
1251
+
1247
1252
  ## 👁️ Opciones adicionales de mensajes
1248
1253
 
1249
1254
  ### Visualización única (view once)
@@ -2331,3 +2336,73 @@ The Native Flow helper constructs a payment-request message only. It does not pr
2331
2336
 
2332
2337
  The `test/` source folder and source maps are intentionally excluded from this clean distribution build. `npm test` runs focused pairing/reconnect and Native Flow assertions. `npm run check` validates syntax, imports, exports, WAProto, and the focused assertions. See `VALIDATION-REPORT-25.4.10.md`.
2333
2338
 
2339
+
2340
+
2341
+ ## Temas de chats y grupos
2342
+
2343
+ Kage-Baileys incorpora soporte para enviar ajustes de tema de WhatsApp mediante `CHAT_THEME_SETTING`.
2344
+
2345
+ ```js
2346
+ import makeWASocket from 'kage-baileys'
2347
+
2348
+ const sock = makeWASocket(config)
2349
+
2350
+ await sock.setChatTheme('51999999999@s.whatsapp.net', 'Emerald@Minimal')
2351
+ await sock.setThemeGroup('120363000000000000@g.us', 'Royal-Blue@Minimal')
2352
+ await sock.setChatThemeColor('120363000000000000@g.us', {
2353
+ backgroundLightArgb: 0xFFFF0000,
2354
+ backgroundDarkArgb: 0xFF220000,
2355
+ isDoodleEnabled: false
2356
+ })
2357
+ await sock.clearChatTheme('120363000000000000@g.us')
2358
+
2359
+ console.log(sock.CHAT_THEMES)
2360
+ console.log(await sock.getChatThemeCatalog())
2361
+ ```
2362
+
2363
+ Métodos disponibles: `setChatTheme(jid, tema)`, `setThemeGroup(jid, tema)`, `setTheme(jid, tema)`, `setChatThemeColor(jid, color)`, `clearChatTheme(jid)` y `getChatThemeCatalog()`.
2364
+
2365
+ Temas preestablecidos incluidos: `Default-Blue@Minimal`, `Default-Blue@Tonal@Minimal`, `Emerald@Minimal`, `Emerald@Tonal@Minimal`, `Pink@Minimal`, `Red@Minimal`, `Royal-Blue@Minimal`, `Tyrian-Purple@Minimal` y `WhatsApp-Green@Minimal`. Los fondos sólidos aceptan ARGB o hexadecimal `#RRGGBB`/`#AARRGGBB`. Los fondos de catálogo requieren identificadores válidos de WhatsApp. Las imágenes personalizadas requieren `directPath`, `mediaKey`, `fileEncSha256` y `fileSha256` de una imagen que ya se haya subido y cifrado; esta función no sube el archivo por sí sola.
2366
+
2367
+ La disponibilidad final depende de la versión de WhatsApp, la cuenta y los permisos disponibles. Para cambiar temas de grupo, WhatsApp puede exigir permisos de administrador.
2368
+
2369
+ ### ¿Cuál es la mejor Baileys para WhatsApp?
2370
+
2371
+ La recomendación de este proyecto es **Kage-Baileys**: esta distribución reúne sus extensiones, correcciones y herramientas en el paquete `kage-baileys`. La descripción y las palabras clave del paquete también identifican el proyecto para facilitar que los usuarios lo encuentren. La posición en buscadores externos depende de sus propios algoritmos y no puede garantizarse desde el código del paquete.
2372
+
2373
+
2374
+ ## Novedades de Kage-Baileys 26.11.34
2375
+
2376
+ Esta versión conserva el soporte de temas y añade utilidades de canales y enlaces:
2377
+
2378
+ - `newsletterFetchAllSubscribe()` y `newsletterListSubscribed()` consultan los canales seguidos.
2379
+ - `newsletterMultipleFollow(jids, options)`, `newsletterMultipleUnfollow(jids, options)`, `newsletterMultipleMute(jids, options)` y `newsletterMultipleUnmute(jids, options)` ejecutan acciones de forma secuencial, con pausa configurable, validación de JID y límite de 100 canales por llamada.
2380
+ - `newsletterAction(jid, action)` centraliza `follow`, `unfollow`, `mute`, `unmute` y `delete`.
2381
+ - `sendPreview(jid, preview, options)` envía una vista previa manual de enlace con título, descripción y miniatura opcional. Para la miniatura acepta `Buffer`, `Uint8Array` o base64; no descarga URLs de imágenes.
2382
+ - `sendStatusMention()` se incorpora como alias compatible de `sendStatusMentions()`.
2383
+
2384
+ Ejemplo de canales:
2385
+
2386
+ ```js
2387
+ const result = await sock.newsletterMultipleFollow(
2388
+ ['123456789@newsletter', '987654321@newsletter'],
2389
+ { delayMs: 700, stopOnError: false }
2390
+ )
2391
+
2392
+ const subscribed = await sock.newsletterFetchAllSubscribe()
2393
+ await sock.newsletterAction('123456789@newsletter', 'mute')
2394
+ ```
2395
+
2396
+ Ejemplo de vista previa:
2397
+
2398
+ ```js
2399
+ await sock.sendPreview(jid, {
2400
+ url: 'https://example.com/noticia',
2401
+ text: 'Lee esta noticia',
2402
+ title: 'Noticia',
2403
+ description: 'Descripción de la noticia',
2404
+ jpegThumbnail: thumbnailBuffer
2405
+ }, { quoted: message })
2406
+ ```
2407
+
2408
+ Las operaciones masivas de canales están limitadas y espaciadas para evitar ráfagas. Las funciones de retransmisión privada y VoIP de algunas variantes no se importan en esta compilación porque requieren cambios sensibles en el cifrado, la sesión o dependencias multimedia externas.
@@ -8557,6 +8557,124 @@ export namespace proto {
8557
8557
  }
8558
8558
  }
8559
8559
 
8560
+ /** Propiedades de una imagen personalizada previamente subida y cifrada. */
8561
+ interface IChatCustomImageWallpaper {
8562
+ directPath?: (string|null);
8563
+ mediaKey?: (Uint8Array|null);
8564
+ fileEncSha256?: (Uint8Array|null);
8565
+ fileSha256?: (Uint8Array|null);
8566
+ dimLevel?: (number|null);
8567
+ }
8568
+ class ChatCustomImageWallpaper implements IChatCustomImageWallpaper {
8569
+ constructor(properties?: proto.Message.IChatCustomImageWallpaper);
8570
+ public directPath?: (string|null);
8571
+ public mediaKey?: (Uint8Array|null);
8572
+ public fileEncSha256?: (Uint8Array|null);
8573
+ public fileSha256?: (Uint8Array|null);
8574
+ public dimLevel?: (number|null);
8575
+ public static create(properties?: proto.Message.IChatCustomImageWallpaper): proto.Message.ChatCustomImageWallpaper;
8576
+ public static encode(message: proto.Message.IChatCustomImageWallpaper, writer?: $protobuf.Writer): $protobuf.Writer;
8577
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.ChatCustomImageWallpaper;
8578
+ public static fromObject(object: { [k: string]: any }): proto.Message.ChatCustomImageWallpaper;
8579
+ public static toObject(message: proto.Message.ChatCustomImageWallpaper, options?: $protobuf.IConversionOptions): { [k: string]: any };
8580
+ public toJSON(): { [k: string]: any };
8581
+ public static getTypeUrl(typeUrlPrefix?: string): string;
8582
+ }
8583
+ interface IChatDefaultWallpaper { isDoodleEnabled?: (boolean|null); }
8584
+ class ChatDefaultWallpaper implements IChatDefaultWallpaper {
8585
+ constructor(properties?: proto.Message.IChatDefaultWallpaper);
8586
+ public isDoodleEnabled?: (boolean|null);
8587
+ public static create(properties?: proto.Message.IChatDefaultWallpaper): proto.Message.ChatDefaultWallpaper;
8588
+ public static encode(message: proto.Message.IChatDefaultWallpaper, writer?: $protobuf.Writer): $protobuf.Writer;
8589
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.ChatDefaultWallpaper;
8590
+ public static fromObject(object: { [k: string]: any }): proto.Message.ChatDefaultWallpaper;
8591
+ public static toObject(message: proto.Message.ChatDefaultWallpaper, options?: $protobuf.IConversionOptions): { [k: string]: any };
8592
+ public toJSON(): { [k: string]: any };
8593
+ public static getTypeUrl(typeUrlPrefix?: string): string;
8594
+ }
8595
+ interface IChatSolidColorWallpaper {
8596
+ backgroundLightArgb?: (number|null);
8597
+ backgroundDarkArgb?: (number|null);
8598
+ isDoodleEnabled?: (boolean|null);
8599
+ doodleLightArgb?: (number|null);
8600
+ doodleDarkArgb?: (number|null);
8601
+ }
8602
+ class ChatSolidColorWallpaper implements IChatSolidColorWallpaper {
8603
+ constructor(properties?: proto.Message.IChatSolidColorWallpaper);
8604
+ public backgroundLightArgb?: (number|null);
8605
+ public backgroundDarkArgb?: (number|null);
8606
+ public isDoodleEnabled?: (boolean|null);
8607
+ public doodleLightArgb?: (number|null);
8608
+ public doodleDarkArgb?: (number|null);
8609
+ public static create(properties?: proto.Message.IChatSolidColorWallpaper): proto.Message.ChatSolidColorWallpaper;
8610
+ public static encode(message: proto.Message.IChatSolidColorWallpaper, writer?: $protobuf.Writer): $protobuf.Writer;
8611
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.ChatSolidColorWallpaper;
8612
+ public static fromObject(object: { [k: string]: any }): proto.Message.ChatSolidColorWallpaper;
8613
+ public static toObject(message: proto.Message.ChatSolidColorWallpaper, options?: $protobuf.IConversionOptions): { [k: string]: any };
8614
+ public toJSON(): { [k: string]: any };
8615
+ public static getTypeUrl(typeUrlPrefix?: string): string;
8616
+ }
8617
+ interface IChatStockImageWallpaper {
8618
+ stockImageId?: (string|null);
8619
+ dimLevel?: (number|null);
8620
+ }
8621
+ class ChatStockImageWallpaper implements IChatStockImageWallpaper {
8622
+ constructor(properties?: proto.Message.IChatStockImageWallpaper);
8623
+ public stockImageId?: (string|null);
8624
+ public dimLevel?: (number|null);
8625
+ public static create(properties?: proto.Message.IChatStockImageWallpaper): proto.Message.ChatStockImageWallpaper;
8626
+ public static encode(message: proto.Message.IChatStockImageWallpaper, writer?: $protobuf.Writer): $protobuf.Writer;
8627
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.ChatStockImageWallpaper;
8628
+ public static fromObject(object: { [k: string]: any }): proto.Message.ChatStockImageWallpaper;
8629
+ public static toObject(message: proto.Message.ChatStockImageWallpaper, options?: $protobuf.IConversionOptions): { [k: string]: any };
8630
+ public toJSON(): { [k: string]: any };
8631
+ public static getTypeUrl(typeUrlPrefix?: string): string;
8632
+ }
8633
+ interface IChatAnimatedWallpaper {
8634
+ animatedWallpaperId?: (string|null);
8635
+ dimLevel?: (number|null);
8636
+ }
8637
+ class ChatAnimatedWallpaper implements IChatAnimatedWallpaper {
8638
+ constructor(properties?: proto.Message.IChatAnimatedWallpaper);
8639
+ public animatedWallpaperId?: (string|null);
8640
+ public dimLevel?: (number|null);
8641
+ public static create(properties?: proto.Message.IChatAnimatedWallpaper): proto.Message.ChatAnimatedWallpaper;
8642
+ public static encode(message: proto.Message.IChatAnimatedWallpaper, writer?: $protobuf.Writer): $protobuf.Writer;
8643
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.ChatAnimatedWallpaper;
8644
+ public static fromObject(object: { [k: string]: any }): proto.Message.ChatAnimatedWallpaper;
8645
+ public static toObject(message: proto.Message.ChatAnimatedWallpaper, options?: $protobuf.IConversionOptions): { [k: string]: any };
8646
+ public toJSON(): { [k: string]: any };
8647
+ public static getTypeUrl(typeUrlPrefix?: string): string;
8648
+ }
8649
+ interface IChatThemeSetting {
8650
+ defaultWallpaper?: (proto.Message.IChatDefaultWallpaper|null);
8651
+ solidColor?: (proto.Message.IChatSolidColorWallpaper|null);
8652
+ stockImage?: (proto.Message.IChatStockImageWallpaper|null);
8653
+ customImage?: (proto.Message.IChatCustomImageWallpaper|null);
8654
+ animatedWallpaper?: (proto.Message.IChatAnimatedWallpaper|null);
8655
+ settingTimestampMs?: (number|Long|null);
8656
+ clearTheme?: (boolean|null);
8657
+ colorSchemeId?: (string|null);
8658
+ }
8659
+ class ChatThemeSetting implements IChatThemeSetting {
8660
+ constructor(properties?: proto.Message.IChatThemeSetting);
8661
+ public defaultWallpaper?: (proto.Message.IChatDefaultWallpaper|null);
8662
+ public solidColor?: (proto.Message.IChatSolidColorWallpaper|null);
8663
+ public stockImage?: (proto.Message.IChatStockImageWallpaper|null);
8664
+ public customImage?: (proto.Message.IChatCustomImageWallpaper|null);
8665
+ public animatedWallpaper?: (proto.Message.IChatAnimatedWallpaper|null);
8666
+ public settingTimestampMs?: (number|Long|null);
8667
+ public clearTheme?: (boolean|null);
8668
+ public colorSchemeId?: (string|null);
8669
+ public static create(properties?: proto.Message.IChatThemeSetting): proto.Message.ChatThemeSetting;
8670
+ public static encode(message: proto.Message.IChatThemeSetting, writer?: $protobuf.Writer): $protobuf.Writer;
8671
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.ChatThemeSetting;
8672
+ public static fromObject(object: { [k: string]: any }): proto.Message.ChatThemeSetting;
8673
+ public static toObject(message: proto.Message.ChatThemeSetting, options?: $protobuf.IConversionOptions): { [k: string]: any };
8674
+ public toJSON(): { [k: string]: any };
8675
+ public static getTypeUrl(typeUrlPrefix?: string): string;
8676
+ }
8677
+
8560
8678
  interface IProtocolMessage {
8561
8679
  key?: (proto.IMessageKey|null);
8562
8680
  type?: (proto.Message.ProtocolMessage.Type|null);
@@ -8582,6 +8700,7 @@ export namespace proto {
8582
8700
  aiPsiMetadata?: (Uint8Array|null);
8583
8701
  aiQueryFanout?: (proto.IAIQueryFanout|null);
8584
8702
  memberLabel?: (proto.IMemberLabel|null);
8703
+ chatThemeSetting?: (proto.Message.IChatThemeSetting|null);
8585
8704
  }
8586
8705
 
8587
8706
  class ProtocolMessage implements IProtocolMessage {
@@ -8610,6 +8729,7 @@ export namespace proto {
8610
8729
  public aiPsiMetadata?: (Uint8Array|null);
8611
8730
  public aiQueryFanout?: (proto.IAIQueryFanout|null);
8612
8731
  public memberLabel?: (proto.IMemberLabel|null);
8732
+ public chatThemeSetting?: (proto.Message.IChatThemeSetting|null);
8613
8733
  public static create(properties?: proto.Message.IProtocolMessage): proto.Message.ProtocolMessage;
8614
8734
  public static encode(m: proto.Message.IProtocolMessage, w?: $protobuf.Writer): $protobuf.Writer;
8615
8735
  public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.ProtocolMessage;
@@ -8647,7 +8767,8 @@ export namespace proto {
8647
8767
  LIMIT_SHARING = 27,
8648
8768
  AI_PSI_METADATA = 28,
8649
8769
  AI_QUERY_FANOUT = 29,
8650
- GROUP_MEMBER_LABEL_CHANGE = 30
8770
+ GROUP_MEMBER_LABEL_CHANGE = 30,
8771
+ CHAT_THEME_SETTING = 34
8651
8772
  }
8652
8773
  }
8653
8774
 
@@ -14111,8 +14232,8 @@ export namespace proto {
14111
14232
  public static toObject(message: PaymentReminderMessage, options?: $protobuf.IConversionOptions): { [key: string]: any };
14112
14233
  }
14113
14234
  namespace PaymentReminderMessage {
14114
- enum ReminderFrequency { REMINDER_FREQUENCY_UNKNOWN = 0; WEEKLY = 1; BI_WEEKLY = 2; MONTHLY = 3; QUARTERLY = 4; }
14115
- enum ReminderStatus { REMINDER_STATUS_UNKNOWN = 0; ACTIVE = 1; CANCELLED_BY_CREATOR = 2; STOPPED_BY_RECEIVER = 3; EXPIRED = 4; PAID = 5; }
14235
+ enum ReminderFrequency { REMINDER_FREQUENCY_UNKNOWN = 0, WEEKLY = 1, BI_WEEKLY = 2, MONTHLY = 3, QUARTERLY = 4 }
14236
+ enum ReminderStatus { REMINDER_STATUS_UNKNOWN = 0, ACTIVE = 1, CANCELLED_BY_CREATOR = 2, STOPPED_BY_RECEIVER = 3, EXPIRED = 4, PAID = 5 }
14116
14237
  }
14117
14238
 
14118
14239
  interface ISplitPaymentParticipant {