@yui-bails/yui-bails 1.3.0 → 1.4.2
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 +243 -1
- package/lib/Socket/connect-bot.d.ts +88 -0
- package/lib/Socket/connect-bot.d.ts.map +1 -1
- package/lib/Socket/connect-bot.js +1 -0
- package/lib/Socket/connect-bot.js.map +1 -1
- package/lib/Socket/index.d.ts +56 -12
- package/lib/Socket/index.d.ts.map +1 -1
- package/lib/Socket/index.js +37 -1
- package/lib/Socket/index.js.map +1 -1
- package/lib/Socket/messages-send.js +1 -1
- package/lib/Socket/messages-send.js.map +1 -1
- package/lib/Socket/session-manager.d.ts +44 -0
- package/lib/Socket/session-manager.d.ts.map +1 -1
- package/lib/Types/Message.d.ts +16 -0
- package/lib/Types/Message.d.ts.map +1 -1
- package/lib/Types/Socket.d.ts +7 -0
- package/lib/Types/Socket.d.ts.map +1 -1
- package/lib/Types/Socket.js.map +1 -1
- package/lib/Utils/banner.d.ts +4 -2
- package/lib/Utils/banner.d.ts.map +1 -1
- package/lib/Utils/banner.js +6 -4
- package/lib/Utils/banner.js.map +1 -1
- package/lib/Utils/channel.d.ts +9 -0
- package/lib/Utils/channel.d.ts.map +1 -0
- package/lib/Utils/channel.js +17 -0
- package/lib/Utils/channel.js.map +1 -0
- package/lib/Utils/group-fetch.d.ts +7 -2
- package/lib/Utils/group-fetch.d.ts.map +1 -1
- package/lib/Utils/group-fetch.js +12 -2
- package/lib/Utils/group-fetch.js.map +1 -1
- package/lib/Utils/helpers.d.ts +20 -1
- package/lib/Utils/helpers.d.ts.map +1 -1
- package/lib/Utils/helpers.js +32 -5
- package/lib/Utils/helpers.js.map +1 -1
- package/lib/Utils/html-format.d.ts +12 -0
- package/lib/Utils/html-format.d.ts.map +1 -0
- package/lib/Utils/html-format.js +344 -0
- package/lib/Utils/html-format.js.map +1 -0
- package/lib/Utils/index.d.ts +8 -0
- package/lib/Utils/index.d.ts.map +1 -1
- package/lib/Utils/index.js +8 -0
- package/lib/Utils/index.js.map +1 -1
- package/lib/Utils/messages.d.ts.map +1 -1
- package/lib/Utils/messages.js +31 -1
- package/lib/Utils/messages.js.map +1 -1
- package/lib/Utils/pretty-log.d.ts.map +1 -1
- package/lib/Utils/pretty-log.js +7 -3
- package/lib/Utils/pretty-log.js.map +1 -1
- package/lib/Utils/reconnect.d.ts +53 -0
- package/lib/Utils/reconnect.d.ts.map +1 -0
- package/lib/Utils/reconnect.js +82 -0
- package/lib/Utils/reconnect.js.map +1 -0
- package/lib/Utils/send-extras.d.ts +155 -0
- package/lib/Utils/send-extras.d.ts.map +1 -0
- package/lib/Utils/send-extras.js +253 -0
- package/lib/Utils/send-extras.js.map +1 -0
- package/lib/Utils/send-retry.d.ts +21 -0
- package/lib/Utils/send-retry.d.ts.map +1 -0
- package/lib/Utils/send-retry.js +28 -0
- package/lib/Utils/send-retry.js.map +1 -0
- package/lib/Utils/session-backup.d.ts +21 -0
- package/lib/Utils/session-backup.d.ts.map +1 -0
- package/lib/Utils/session-backup.js +61 -0
- package/lib/Utils/session-backup.js.map +1 -0
- package/lib/Utils/timed-poll.d.ts +71 -0
- package/lib/Utils/timed-poll.d.ts.map +1 -0
- package/lib/Utils/timed-poll.js +101 -0
- package/lib/Utils/timed-poll.js.map +1 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +21 -0
- package/lib/Utils/use-single-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-single-file-auth-state.js +134 -0
- package/lib/Utils/use-single-file-auth-state.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,12 +24,40 @@ Una bails profesional para tu bot de WhatsApp 👑
|
|
|
24
24
|
<a href="#-qué-trae-yui-bails"><img src="https://img.shields.io/badge/%F0%9F%A7%B9_CONSOLA-LIMPIA-9d4edd?style=for-the-badge&labelColor=0d1117" alt="consola" /></a>
|
|
25
25
|
</p>
|
|
26
26
|
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="https://www.npmjs.com/package/@yui-bails/yui-bails"><img src="https://img.shields.io/npm/v/@yui-bails/yui-bails?style=flat-square&logo=npm&label=npm&color=cb3837" alt="versión en npm" /></a>
|
|
29
|
+
<a href="https://www.npmjs.com/package/@yui-bails/yui-bails"><img src="https://img.shields.io/npm/dm/@yui-bails/yui-bails?style=flat-square&label=descargas%2Fmes" alt="descargas en npm" /></a>
|
|
30
|
+
</p>
|
|
31
|
+
|
|
27
32
|
<div align='center'>
|
|
28
33
|
|
|
29
34
|
**Yui-Bails**, creada por **AmilcarGit**, es una librería WebSockets en TypeScript para la API de WhatsApp Web **optimizada para volar**: menos latencia, botones que sí se pintan, y una consola sin basura.
|
|
30
35
|
|
|
31
36
|
</div>
|
|
32
37
|
|
|
38
|
+
## 📦 Instalación (npm)
|
|
39
|
+
|
|
40
|
+
Yui-Bails está publicada en npm como [`@yui-bails/yui-bails`](https://www.npmjs.com/package/@yui-bails/yui-bails). La insignia de arriba muestra siempre la última versión publicada.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# instalar (el alias "yui-bails:" te deja importar con el nombre corto)
|
|
44
|
+
npm install yui-bails@npm:@yui-bails/yui-bails
|
|
45
|
+
|
|
46
|
+
# actualizar a la última versión
|
|
47
|
+
npm install yui-bails@npm:@yui-bails/yui-bails@latest
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
import makeWASocket from 'yui-bails'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Con **Termux**, si ves `E401` o `EALLOWGIT`:
|
|
55
|
+
- Instalar y actualizar desde npm **no pide login**. El login (`npm login`) solo lo necesita quien **publica**.
|
|
56
|
+
- `npm install github:AmilcarGit/Yui-Bails` lo bloquea npm por defecto; usa el comando de arriba (npm) o agrega `--allow-git=all` si de verdad quieres la versión de GitHub.
|
|
57
|
+
- Para ver qué versión tienes instalada: `npm ls yui-bails`. Al arrancar, el banner también muestra la versión.
|
|
58
|
+
|
|
59
|
+
**Versión de GitHub** (últimos cambios, sin garantía de estabilidad): `npm install yui-bails@github:AmilcarGit/Yui-Bails --allow-git=all`. Puede traer funciones que aún no están en npm.
|
|
60
|
+
|
|
33
61
|
## ⚡ ¿Qué trae Yui-Bails?
|
|
34
62
|
|
|
35
63
|
| | Mejora | Detalle |
|
|
@@ -50,6 +78,8 @@ Una bails profesional para tu bot de WhatsApp 👑
|
|
|
50
78
|
| 📱 | **Multi-sesión** | Varios números de WhatsApp en un solo proceso con `makeSessionManager` ([detalles](#-multi-sesión-makesessionmanager)) |
|
|
51
79
|
| 🧭 | **Comandos con roles** | Prefijos, alias, dueño/admin, cooldown y anti-spam con `sock.commands` ([detalles](#-comandos-con-roles-y-cooldown)) |
|
|
52
80
|
| ⏰ | **Mensajes programados** | Una vez, cada cierto tiempo o con cron; se guardan en disco ([detalles](#-mensajes-programados-sockschedule)) |
|
|
81
|
+
| 📤 | **Envíos fáciles** | `sendContact`, `sendLocation`, `sendAlbum`, `sendEvent` y `sendLong` ([detalles](#-envíos-fáciles)) |
|
|
82
|
+
| 🧠 | **Quiz y más (experimental)** | `sendQuiz`, `sendImagePoll`, `sendScheduledCall`, `sendStatusMention` y `ask` ([detalles](#-quiz-y-novedades-experimentales)) |
|
|
53
83
|
|
|
54
84
|
## 🔘 Botones nativos incluidos
|
|
55
85
|
|
|
@@ -509,6 +539,218 @@ sock.schedule.cancel(id)
|
|
|
509
539
|
- El contenido debe ser JSON simple: para imágenes usa `{ image: { url } }`, no buffers.
|
|
510
540
|
- Si un envío falla se reintenta a los 30 s (3 intentos) y luego pasa a la siguiente vuelta.
|
|
511
541
|
|
|
542
|
+
## 📤 Envíos fáciles
|
|
543
|
+
|
|
544
|
+
Atajos para lo que más se pide. Todos pasan por `sock.sendMessage`, así que respetan la cola anti-ban, las menciones automáticas y las estadísticas.
|
|
545
|
+
|
|
546
|
+
```js
|
|
547
|
+
// contacto: un número, un objeto o varios
|
|
548
|
+
await sock.sendContact(jid, { name: 'Ana', number: '+51 900 000 001', organization: 'Yui' })
|
|
549
|
+
|
|
550
|
+
// ubicación
|
|
551
|
+
await sock.sendLocation(jid, { latitude: -12.04, longitude: -77.03, name: 'Lima', address: 'Perú' })
|
|
552
|
+
|
|
553
|
+
// álbum: de 2 a 10 fotos o videos juntos
|
|
554
|
+
await sock.sendAlbum(jid, [
|
|
555
|
+
{ image: { url: 'https://…/1.jpg' }, caption: 'Primera' },
|
|
556
|
+
{ video: { url: 'https://…/2.mp4' } }
|
|
557
|
+
])
|
|
558
|
+
|
|
559
|
+
// evento (fechas: Date, milisegundos o texto ISO)
|
|
560
|
+
await sock.sendEvent(jid, { name: 'Fiesta', start: '2026-12-24T20:00:00', location: 'Mi casa' })
|
|
561
|
+
|
|
562
|
+
// texto largo, partido en varios mensajes sin cortar palabras (solo el primero cita)
|
|
563
|
+
await sock.sendLong(jid, textoMuyLargo, { maxLength: 4000 }, { quoted: msg })
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
Si pasas datos inválidos (coordenadas fuera de rango, álbum con menos de 2 elementos, un evento que termina antes de empezar…) fallan con un error claro antes de enviar nada. El álbum y el evento dependen de que tu WhatsApp los muestre; pruébalos en tu teléfono antes de confiar en ellos.
|
|
567
|
+
|
|
568
|
+
### HTML → formato de WhatsApp (`sendHtml`)
|
|
569
|
+
|
|
570
|
+
WhatsApp **no tiene HTML**: solo su propio formato (`*negrita*`, `_cursiva_`, `~tachado~`, `` `código` ``, listas, citas). `sendHtml` convierte un HTML sencillo a ese formato y lo envía como texto normal, así se ve igual en todos los teléfonos.
|
|
571
|
+
|
|
572
|
+
```js
|
|
573
|
+
await sock.sendHtml(jid, `
|
|
574
|
+
<h1>Menú</h1>
|
|
575
|
+
<p>Hola <b>amigos</b>, mira <a href="https://github.com/AmilcarGit/Yui-Bails">Yui-Bails</a></p>
|
|
576
|
+
<ul><li>.ping</li><li>.menu</li></ul>
|
|
577
|
+
<pre>const x = 1</pre>
|
|
578
|
+
`)
|
|
579
|
+
|
|
580
|
+
// o solo convertir, sin enviar
|
|
581
|
+
import { htmlToWhatsApp } from '@yui-bails/yui-bails'
|
|
582
|
+
const texto = htmlToWhatsApp('<b>Hola</b> <i>mundo</i>') // "*Hola* _mundo_"
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
| HTML | Resultado |
|
|
586
|
+
|---|---|
|
|
587
|
+
| `<b>`, `<strong>` · `<i>`, `<em>` · `<s>`, `<del>` | `*…*` · `_…_` · `~…~` |
|
|
588
|
+
| `<code>`, `<kbd>` · `<pre>` | `` `…` `` · bloque ```` ``` ```` |
|
|
589
|
+
| `<h1>`…`<h6>` | línea en negrita |
|
|
590
|
+
| `<ul>`, `<ol>`, `<li>` (anidadas) | `- …` / `1. …` |
|
|
591
|
+
| `<blockquote>` | `> …` |
|
|
592
|
+
| `<a href>` | `texto (url)`; solo `http`, `https`, `mailto` y `tel` |
|
|
593
|
+
| `<table>` | una fila por línea: `celda \| celda` (las `<th>` en negrita) |
|
|
594
|
+
| `<br>`, `<p>`, `<hr>`, `<div>` | saltos de línea |
|
|
595
|
+
|
|
596
|
+
Lo demás (`<script>`, `<style>`, `<iframe>`, atributos como `onclick`, etiquetas desconocidas) se descarta y solo se conserva el texto. No se dibujan colores, tamaños, imágenes ni tablas reales: WhatsApp no puede mostrarlos en un mensaje de texto. Un `*` suelto dentro del texto puede ser leído por WhatsApp como negrita.
|
|
597
|
+
|
|
598
|
+
### Avisar a todo el grupo (`tagAll`)
|
|
599
|
+
|
|
600
|
+
```js
|
|
601
|
+
// menciona a cada miembro (el texto puede ser cualquiera)
|
|
602
|
+
await sock.tagAll(jid, '📢 Reunión a las 8')
|
|
603
|
+
|
|
604
|
+
// usa el "@todos" de WhatsApp
|
|
605
|
+
await sock.tagAll(jid, '📢 Reunión a las 8', { mode: 'all' })
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
El modo `all` depende de que tu WhatsApp lo soporte; `members` (por defecto) funciona siempre. Solo en grupos.
|
|
609
|
+
|
|
610
|
+
### Encuesta que se cierra sola (`sendTimedPoll`)
|
|
611
|
+
|
|
612
|
+
```js
|
|
613
|
+
await sock.sendTimedPoll(jid, '¿Pizza o tacos?', ['Pizza', 'Tacos'], {
|
|
614
|
+
closeAfter: '10m', // de 5 s a 24 días: '30s', '2h', '1d' o milisegundos
|
|
615
|
+
showVoters: false,
|
|
616
|
+
onClose: async result => console.log(result)
|
|
617
|
+
})
|
|
618
|
+
console.log(sock.openPolls()) // las que siguen abiertas
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
Al cerrar, avisa en el chat con el resultado y los votos de cada opción. El cierre lo hace el bot (WhatsApp no tiene fecha de cierre en las encuestas), así que **si el bot se reinicia antes, la encuesta ya no se cierra sola**.
|
|
622
|
+
|
|
623
|
+
### Reintentos al enviar (`sendRetry`)
|
|
624
|
+
|
|
625
|
+
Si un envío falla por un problema temporal (conexión caída, tiempo agotado), `sock.sendMessage` lo reintenta hasta 2 veces con esperas crecientes. Usa **el mismo id de mensaje** en cada intento, así que si el primero sí llegó pero perdiste la respuesta, no se duplica. Los errores definitivos (número inválido, contenido erróneo) no se reintentan.
|
|
626
|
+
|
|
627
|
+
```js
|
|
628
|
+
makeWASocket({ auth, sendRetry: false }) // desactivar
|
|
629
|
+
makeWASocket({ auth, sendRetry: { retries: 4, baseDelayMs: 500 } }) // ajustar
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
### Respaldo de la sesión
|
|
633
|
+
|
|
634
|
+
```js
|
|
635
|
+
import { backupSession, restoreSession } from '@yui-bails/yui-bails'
|
|
636
|
+
|
|
637
|
+
await backupSession('./sesion', './respaldo-2026-11-17.ysb') // un archivo comprimido, permisos 0600
|
|
638
|
+
await restoreSession('./respaldo-2026-11-17.ysb', './sesion') // no sobrescribe: falla si ya hay una sesión
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
El respaldo contiene **tus credenciales**: quien lo tenga puede usar tu WhatsApp. Guárdalo en un lugar privado y nunca lo mandes por chat ni lo subas a GitHub. Al restaurar solo se aceptan nombres de archivo simples (nada de rutas con `..`).
|
|
642
|
+
|
|
643
|
+
### Reconexión inteligente (`makeReconnector`)
|
|
644
|
+
|
|
645
|
+
```js
|
|
646
|
+
import { makeReconnector } from '@yui-bails/yui-bails'
|
|
647
|
+
|
|
648
|
+
const reconnector = makeReconnector({
|
|
649
|
+
connect: iniciarBot, // la misma función que arranca tu bot
|
|
650
|
+
onRetry: ({ attempt, delayMs }) => console.log(`Reintento ${attempt} en ${delayMs} ms`),
|
|
651
|
+
onGiveUp: reason => console.log('No reconecto:', reason)
|
|
652
|
+
})
|
|
653
|
+
|
|
654
|
+
sock.ev.on('connection.update', update => reconnector.handle(update))
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
- Espera cada vez más (2 s, 4 s, 8 s… hasta 60 s) con un poco de azar para no reconectar todos al mismo segundo. Se ajusta con `baseDelayMs`, `maxDelayMs`, `jitter` y `maxRetries` (10 seguidos por defecto).
|
|
658
|
+
- Una conexión que se mantiene abierta 30 s (`stableAfterMs`) cuenta como sana y reinicia la cuenta.
|
|
659
|
+
- **No reintenta** cuando no sirve o hace daño: sesión cerrada desde el teléfono (`logged-out`), sesión abierta en otro lugar (`replaced`, si reintentas las dos se pelean), `bad-session` y `forbidden`. En esos casos llama a `onGiveUp`.
|
|
660
|
+
- El reinicio que WhatsApp pide justo después de vincular (código 515) se hace de inmediato y no cuenta como fallo.
|
|
661
|
+
- `reconnector.stop()` lo detiene si apagas el bot a propósito.
|
|
662
|
+
|
|
663
|
+
### Sesión en un solo archivo (`useSingleFileAuthState`)
|
|
664
|
+
|
|
665
|
+
Una carpeta con cientos de archivos pequeños es lenta, sobre todo en el teléfono. Esta guarda toda la sesión en **un** archivo:
|
|
666
|
+
|
|
667
|
+
```js
|
|
668
|
+
import { useSingleFileAuthState } from '@yui-bails/yui-bails'
|
|
669
|
+
|
|
670
|
+
const { state, saveCreds, flush } = await useSingleFileAuthState('./sesion/auth.json')
|
|
671
|
+
const sock = makeWASocket({ auth: state })
|
|
672
|
+
sock.ev.on('creds.update', saveCreds)
|
|
673
|
+
|
|
674
|
+
process.on('SIGINT', async () => { await flush(); process.exit(0) }) // guarda lo pendiente al apagar
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
- Los cambios se juntan y se escriben después de 500 ms (`saveDelayMs`); las credenciales se escriben al instante.
|
|
678
|
+
- Cada escritura va a un archivo temporal que luego se renombra, así que un corte de luz no deja el archivo a medias. Si el archivo se daña y existe la copia `.bak` (se hace al abrir), la usa; si no hay copia, falla con un error claro en vez de crear una sesión nueva sin avisar.
|
|
679
|
+
- Es un formato **nuevo**: no lee las carpetas de `useMultiFileAuthState`. Una sesión existente se queda como está; esto es para sesiones nuevas.
|
|
680
|
+
- Sin dependencias nativas, así que funciona igual en Termux.
|
|
681
|
+
|
|
682
|
+
### Info de un canal (`channelInfo`)
|
|
683
|
+
|
|
684
|
+
```js
|
|
685
|
+
const canal = await sock.channelInfo('https://whatsapp.com/channel/0029Va…') // enlace, código o 120363…@newsletter
|
|
686
|
+
console.log(canal?.name, canal?.subscribers) // null si no existe
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
## 🧠 Quiz y novedades experimentales
|
|
690
|
+
|
|
691
|
+
Salen de campos que **existen en el protocolo de WhatsApp** pero que no hemos confirmado en todos los teléfonos y versiones: si WhatsApp no los soporta, el mensaje puede llegar como una encuesta o mensaje normal. Pruébalos en tu cuenta antes de ofrecerlos.
|
|
692
|
+
|
|
693
|
+
### Quiz (encuesta con respuesta correcta)
|
|
694
|
+
|
|
695
|
+
```js
|
|
696
|
+
const sent = await sock.sendQuiz(jid, '¿Capital de Perú?', ['Lima', 'Quito', 'Bogotá'], 0) // 0 = primera opción, o el texto 'Lima'
|
|
697
|
+
|
|
698
|
+
// cuando llegan votos (evento poll.votes) o cuando quieras:
|
|
699
|
+
const resultado = sock.getQuizResult(sent.key)
|
|
700
|
+
// { correct: 'Lima', right: [jids que acertaron], wrong: [jids que fallaron], votes: [...] }
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
También puedes usar `sock.sendMessage(jid, { poll: { name, values, correctAnswer: 'Lima' } })`. Un quiz tiene una sola respuesta correcta.
|
|
704
|
+
|
|
705
|
+
### Encuesta con imágenes
|
|
706
|
+
|
|
707
|
+
WhatsApp tiene un tipo propio de "encuesta con imágenes", pero su formato no está documentado. `sendImagePoll` hace lo que sí funciona en todas las versiones: manda las fotos como álbum (cada una numerada con su opción) y después una encuesta normal con esas opciones.
|
|
708
|
+
|
|
709
|
+
```js
|
|
710
|
+
await sock.sendImagePoll(jid, {
|
|
711
|
+
name: '¿Cuál prefieres?',
|
|
712
|
+
options: [
|
|
713
|
+
{ text: 'Gato', image: { url: 'https://…/gato.jpg' } },
|
|
714
|
+
{ text: 'Perro', image: { url: 'https://…/perro.jpg' } }
|
|
715
|
+
]
|
|
716
|
+
})
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
### Llamada programada
|
|
720
|
+
|
|
721
|
+
```js
|
|
722
|
+
await sock.sendScheduledCall(jid, { title: 'Reunión', start: '2026-12-24T20:00:00', type: 'video' })
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
### Estado que menciona a personas
|
|
726
|
+
|
|
727
|
+
```js
|
|
728
|
+
await sock.sendStatusMention({ text: '¡Feliz año! 🎉' }, { mentions: ['5731XXXXXXXX@s.whatsapp.net'], backgroundColor: '#1b5e20' })
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
Publica el estado y avisa a cada persona mencionada, como hacen otras librerías. Es la parte menos probada.
|
|
732
|
+
|
|
733
|
+
### Preguntar y esperar la respuesta
|
|
734
|
+
|
|
735
|
+
```js
|
|
736
|
+
const nombre = await sock.ask(msg, '¿Cómo te llamas?', { timeoutMs: 30_000 }) // texto, o undefined si no contestó
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
La "caja de pregunta" nativa de WhatsApp no tiene formato documentado; `ask` te da lo mismo con un mensaje normal.
|
|
740
|
+
|
|
741
|
+
> No incluimos las "respuestas ricas" de la IA de WhatsApp: son mensajes que genera el propio servidor de WhatsApp y no se pueden crear desde un bot.
|
|
742
|
+
|
|
743
|
+
## 🪪 Usernames y LID
|
|
744
|
+
|
|
745
|
+
WhatsApp está probando **usernames** (en el beta de Android) con opciones para ocultar el número de teléfono. Cuando eso llegue, de algunos usuarios solo conocerás su LID (`2696…@lid`), no su número. Yui-Bails ya lo tiene en cuenta:
|
|
746
|
+
|
|
747
|
+
- `sock.getSender(msg)` devuelve `jid`, `pn` (número, si se conoce), `lid`, `number`, `id` y ahora **`name`** (el nombre que el usuario eligió en WhatsApp). Si solo hay LID, `number` es `undefined` pero `jid`, `id` y `name` siguen sirviendo.
|
|
748
|
+
- `sender.is(['5191…', '2696…'])` acepta números **y** ids LID: pon ambos en la lista de dueños.
|
|
749
|
+
- Los logs bonitos ya no muestran un LID como si fuera un teléfono: ponen el nombre y solo el final del id.
|
|
750
|
+
- Responde y menciona usando `sender.jid`, nunca armes el jid a mano desde un número.
|
|
751
|
+
|
|
752
|
+
Esto prepara la bails, pero los usernames aún no se pueden probar en cuentas reales.
|
|
753
|
+
|
|
512
754
|
## 📱 Multi-sesión (`makeSessionManager`)
|
|
513
755
|
|
|
514
756
|
Varios números de WhatsApp en un mismo proceso. Cada sesión guarda su login en `<authDir>/<id>/`, tiene su socket y se reconecta sola.
|
|
@@ -632,7 +874,7 @@ Las miniaturas de video usan `ffmpeg` lanzado sin shell (`spawn`), así que ruta
|
|
|
632
874
|
| `YUI_BAILS_BUTTONS_FORMAT=buttons` | Cambia el formato de botones a `ButtonsMessage` clásico (ver abajo) |
|
|
633
875
|
| `YUI_BAILS_LOG_LEVEL=info` | Reactiva los logs internos (por defecto: silencio total) |
|
|
634
876
|
| `YUI_BAILS_VERBOSE=1` | Muestra también el ruido de libsignal (desactiva el filtro) |
|
|
635
|
-
| `YUI_BAILS_NO_BANNER=1` | Oculta el banner de arranque |
|
|
877
|
+
| `YUI_BAILS_NO_BANNER=1` | Oculta el banner de arranque (`0`, `false`, `no`, `off` o vacío lo dejan visible) |
|
|
636
878
|
|
|
637
879
|
<p align="center">
|
|
638
880
|
<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="100%" alt="divider" />
|
|
@@ -318,6 +318,7 @@ export declare const connectBot: (options: ConnectBotOptions) => Promise<{
|
|
|
318
318
|
disableButtons: (msg: import("../index.js").WAMessage, text?: string) => Promise<boolean>;
|
|
319
319
|
sendList: (jid: string, { sections, ...rest }: import("../index.js").SendListOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
320
320
|
sendPoll: (jid: string, name: string, values: string[], poll?: Partial<Omit<import("../index.js").PollMessageOptions, "name" | "values">>, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
321
|
+
sendQuiz: (jid: string, name: string, values: string[], correctAnswer: string | number, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
321
322
|
getPollVotes: (pollKey: import("../index.js").WAMessageKey | string) => {
|
|
322
323
|
pollKey: import("../index.js").WAMessageKey;
|
|
323
324
|
pollName: string;
|
|
@@ -326,6 +327,17 @@ export declare const connectBot: (options: ConnectBotOptions) => Promise<{
|
|
|
326
327
|
voters: string[];
|
|
327
328
|
}[];
|
|
328
329
|
} | undefined;
|
|
330
|
+
getQuizResult: (pollKey: import("../index.js").WAMessageKey | string) => {
|
|
331
|
+
pollKey: import("../index.js").WAMessageKey;
|
|
332
|
+
pollName: string;
|
|
333
|
+
correct: string;
|
|
334
|
+
right: string[];
|
|
335
|
+
wrong: string[];
|
|
336
|
+
votes: {
|
|
337
|
+
name: string;
|
|
338
|
+
voters: string[];
|
|
339
|
+
}[];
|
|
340
|
+
} | undefined;
|
|
329
341
|
downloadMedia: (msg: import("../index.js").WAMessage, options?: import("../index.js").DownloadMediaOptions) => Promise<Buffer>;
|
|
330
342
|
} & {
|
|
331
343
|
onReply: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
|
|
@@ -333,6 +345,17 @@ export declare const connectBot: (options: ConnectBotOptions) => Promise<{
|
|
|
333
345
|
onList: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
|
|
334
346
|
awaitReply: (msg: import("../index.js").WAMessage, { timeoutMs, filter }?: import("../index.js").AwaitReplyOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
335
347
|
} & {
|
|
348
|
+
sendTimedPoll: (jid: string, name: string, values: string[], { closeAfter, selectableCount, showVoters, onClose }: import("../index.js").TimedPollOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<{
|
|
349
|
+
message: import("../index.js").WAMessage;
|
|
350
|
+
closesAt: Date;
|
|
351
|
+
cancel: () => boolean;
|
|
352
|
+
}>;
|
|
353
|
+
openPolls: () => {
|
|
354
|
+
id: string;
|
|
355
|
+
jid: string;
|
|
356
|
+
name: string;
|
|
357
|
+
closesAt: Date;
|
|
358
|
+
}[];
|
|
336
359
|
commands: {
|
|
337
360
|
add: (definition: import("../index.js").CommandDefinition) => /*elided*/ any;
|
|
338
361
|
remove: (name: string) => boolean;
|
|
@@ -387,6 +410,27 @@ export declare const connectBot: (options: ConnectBotOptions) => Promise<{
|
|
|
387
410
|
clear: () => void;
|
|
388
411
|
readonly size: number;
|
|
389
412
|
} | undefined;
|
|
413
|
+
sendContact: (jid: string, contacts: import("../index.js").ContactInput | import("../index.js").ContactInput[] | string, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
414
|
+
sendLocation: (jid: string, { latitude, longitude, name, address }: import("../index.js").LocationInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
415
|
+
sendAlbum: (jid: string, items: import("../index.js").AlbumItem[], options?: import("../index.js").MiscMessageGenerationOptions) => Promise<{
|
|
416
|
+
album: import("../index.js").WAMessage;
|
|
417
|
+
items: (import("../index.js").WAMessage | undefined)[];
|
|
418
|
+
}>;
|
|
419
|
+
sendEvent: (jid: string, event: import("../index.js").EventInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
420
|
+
sendLong: (jid: string, text: string, long?: import("../index.js").SendLongOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<(import("../index.js").WAMessage | undefined)[]>;
|
|
421
|
+
sendImagePoll: (jid: string, poll: import("../index.js").ImagePollInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<{
|
|
422
|
+
album: {
|
|
423
|
+
album: import("../index.js").WAMessage;
|
|
424
|
+
items: (import("../index.js").WAMessage | undefined)[];
|
|
425
|
+
};
|
|
426
|
+
poll: import("../index.js").WAMessage | undefined;
|
|
427
|
+
}>;
|
|
428
|
+
sendScheduledCall: (jid: string, call: import("../index.js").ScheduledCallInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
429
|
+
sendStatusMention: (content: Record<string, any>, { mentions, backgroundColor, font }: import("../index.js").StatusMentionOptions) => Promise<import("../index.js").WAMessage>;
|
|
430
|
+
channelInfo: (input: string) => Promise<import("../index.js").NewsletterMetadata | null>;
|
|
431
|
+
sendHtml: (jid: string, html: string, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
432
|
+
tagAll: (jid: string, text: string, { mode }?: import("../index.js").TagAllOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
433
|
+
ask: (to: import("../index.js").WAMessage, question: string, { timeoutMs }?: import("../index.js").AskOptions) => Promise<string | undefined>;
|
|
390
434
|
confirm: (msg: import("../index.js").WAMessage, text: string, options?: import("../index.js").ConfirmOptions) => Promise<boolean>;
|
|
391
435
|
paginate: (msg: import("../index.js").WAMessage, items: unknown[], options?: import("../index.js").PaginateOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
392
436
|
menu: (msg: import("../index.js").WAMessage, definition: import("../index.js").MenuDefinition) => Promise<import("../index.js").WAMessage | undefined>;
|
|
@@ -690,6 +734,7 @@ export declare const connectBot: (options: ConnectBotOptions) => Promise<{
|
|
|
690
734
|
disableButtons: (msg: import("../index.js").WAMessage, text?: string) => Promise<boolean>;
|
|
691
735
|
sendList: (jid: string, { sections, ...rest }: import("../index.js").SendListOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
692
736
|
sendPoll: (jid: string, name: string, values: string[], poll?: Partial<Omit<import("../index.js").PollMessageOptions, "name" | "values">>, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
737
|
+
sendQuiz: (jid: string, name: string, values: string[], correctAnswer: string | number, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
693
738
|
getPollVotes: (pollKey: import("../index.js").WAMessageKey | string) => {
|
|
694
739
|
pollKey: import("../index.js").WAMessageKey;
|
|
695
740
|
pollName: string;
|
|
@@ -698,6 +743,17 @@ export declare const connectBot: (options: ConnectBotOptions) => Promise<{
|
|
|
698
743
|
voters: string[];
|
|
699
744
|
}[];
|
|
700
745
|
} | undefined;
|
|
746
|
+
getQuizResult: (pollKey: import("../index.js").WAMessageKey | string) => {
|
|
747
|
+
pollKey: import("../index.js").WAMessageKey;
|
|
748
|
+
pollName: string;
|
|
749
|
+
correct: string;
|
|
750
|
+
right: string[];
|
|
751
|
+
wrong: string[];
|
|
752
|
+
votes: {
|
|
753
|
+
name: string;
|
|
754
|
+
voters: string[];
|
|
755
|
+
}[];
|
|
756
|
+
} | undefined;
|
|
701
757
|
downloadMedia: (msg: import("../index.js").WAMessage, options?: import("../index.js").DownloadMediaOptions) => Promise<Buffer>;
|
|
702
758
|
} & {
|
|
703
759
|
onReply: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
|
|
@@ -705,6 +761,17 @@ export declare const connectBot: (options: ConnectBotOptions) => Promise<{
|
|
|
705
761
|
onList: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
|
|
706
762
|
awaitReply: (msg: import("../index.js").WAMessage, { timeoutMs, filter }?: import("../index.js").AwaitReplyOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
707
763
|
} & {
|
|
764
|
+
sendTimedPoll: (jid: string, name: string, values: string[], { closeAfter, selectableCount, showVoters, onClose }: import("../index.js").TimedPollOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<{
|
|
765
|
+
message: import("../index.js").WAMessage;
|
|
766
|
+
closesAt: Date;
|
|
767
|
+
cancel: () => boolean;
|
|
768
|
+
}>;
|
|
769
|
+
openPolls: () => {
|
|
770
|
+
id: string;
|
|
771
|
+
jid: string;
|
|
772
|
+
name: string;
|
|
773
|
+
closesAt: Date;
|
|
774
|
+
}[];
|
|
708
775
|
commands: {
|
|
709
776
|
add: (definition: import("../index.js").CommandDefinition) => /*elided*/ any;
|
|
710
777
|
remove: (name: string) => boolean;
|
|
@@ -759,6 +826,27 @@ export declare const connectBot: (options: ConnectBotOptions) => Promise<{
|
|
|
759
826
|
clear: () => void;
|
|
760
827
|
readonly size: number;
|
|
761
828
|
} | undefined;
|
|
829
|
+
sendContact: (jid: string, contacts: import("../index.js").ContactInput | import("../index.js").ContactInput[] | string, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
830
|
+
sendLocation: (jid: string, { latitude, longitude, name, address }: import("../index.js").LocationInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
831
|
+
sendAlbum: (jid: string, items: import("../index.js").AlbumItem[], options?: import("../index.js").MiscMessageGenerationOptions) => Promise<{
|
|
832
|
+
album: import("../index.js").WAMessage;
|
|
833
|
+
items: (import("../index.js").WAMessage | undefined)[];
|
|
834
|
+
}>;
|
|
835
|
+
sendEvent: (jid: string, event: import("../index.js").EventInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
836
|
+
sendLong: (jid: string, text: string, long?: import("../index.js").SendLongOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<(import("../index.js").WAMessage | undefined)[]>;
|
|
837
|
+
sendImagePoll: (jid: string, poll: import("../index.js").ImagePollInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<{
|
|
838
|
+
album: {
|
|
839
|
+
album: import("../index.js").WAMessage;
|
|
840
|
+
items: (import("../index.js").WAMessage | undefined)[];
|
|
841
|
+
};
|
|
842
|
+
poll: import("../index.js").WAMessage | undefined;
|
|
843
|
+
}>;
|
|
844
|
+
sendScheduledCall: (jid: string, call: import("../index.js").ScheduledCallInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
845
|
+
sendStatusMention: (content: Record<string, any>, { mentions, backgroundColor, font }: import("../index.js").StatusMentionOptions) => Promise<import("../index.js").WAMessage>;
|
|
846
|
+
channelInfo: (input: string) => Promise<import("../index.js").NewsletterMetadata | null>;
|
|
847
|
+
sendHtml: (jid: string, html: string, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
848
|
+
tagAll: (jid: string, text: string, { mode }?: import("../index.js").TagAllOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
849
|
+
ask: (to: import("../index.js").WAMessage, question: string, { timeoutMs }?: import("../index.js").AskOptions) => Promise<string | undefined>;
|
|
762
850
|
confirm: (msg: import("../index.js").WAMessage, text: string, options?: import("../index.js").ConfirmOptions) => Promise<boolean>;
|
|
763
851
|
paginate: (msg: import("../index.js").WAMessage, items: unknown[], options?: import("../index.js").PaginateOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
764
852
|
menu: (msg: import("../index.js").WAMessage, definition: import("../index.js").MenuDefinition) => Promise<import("../index.js").WAMessage | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-bot.d.ts","sourceRoot":"","sources":["../../src/Socket/connect-bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAGjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEtD,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAEtE,MAAM,MAAM,iBAAiB,GAAG;IAC/B,mGAAmG;IACnG,OAAO,EAAE,MAAM,CAAA;IACf,yGAAyG;IACzG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;IACxC,qGAAqG;IACrG,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjD,4FAA4F;IAC5F,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAC5E,sFAAsF;IACtF,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B,+BAA+B;IAC/B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IAClC,2EAA2E;IAC3E,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,aAAa,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,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uB,GAAG,0BACjC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAgHurI,CAAC;;;;;qBAA6U,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAA98F,CAAC;qBAAoB,CAAC;;;;;;;IAZnlD,kDAAkD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAYmuuB,CAAC;;;;;;;;;8DAjHtvuB,GAAG,0BACjC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAgHurI,CAAC;;;;;qBAA6U,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAA98F,CAAC;qBAAoB,CAAC;;;;;;;IARnlD,gDAAgD;;IAEhD,uDAAuD;;EAGxD,CAAA;AAED,MAAM,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAA"}
|
|
@@ -52,6 +52,7 @@ export const connectBot = async (options) => {
|
|
|
52
52
|
}
|
|
53
53
|
log(`🔗 Código de vinculación: ${info.formatted}`);
|
|
54
54
|
log(' En el teléfono: WhatsApp > Dispositivos vinculados > Vincular un dispositivo > Vincular con el número de teléfono');
|
|
55
|
+
log(' ¿No te llegó la notificación? Es normal a veces: escribe el código ahí a mano, funciona igual (dura ~1 min).');
|
|
55
56
|
});
|
|
56
57
|
manager.on('session.qr', ({ qr }) => {
|
|
57
58
|
if (options.onQR) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-bot.js","sourceRoot":"","sources":["../../src/Socket/connect-bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5F,OAAO,EAAE,kBAAkB,EAAkB,MAAM,mBAAmB,CAAA;AA+BtE,uEAAuE;AACvE,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,EAAE;IAC7C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QACpD,MAAM,IAAI,IAAI,CAAC,4EAA4E,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAA;IAClH,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IACvE,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,IAAI,CAAC,YAAY,OAAO,oEAAoE,EAAE;YACvG,UAAU,EAAE,GAAG;SACf,CAAC,CAAA;IACH,CAAC;IAED,OAAO,QAAQ,CAAA;AAChB,CAAC,CAAA;AAED;;;;;;;;GAQG;AACH,MAA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ACzC,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAA;QACvC,IAAI,OAAO,CAAC,OAAO;YAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;;YAC/C,GAAG,CAAC,MAAM,OAAO,EAAE,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAA;IAEtD,OAAO;QACN,uEAAuE;QACvE,KAAK;QACL,kDAAkD;QAClD,IAAI,IAAI;YACP,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC3B,CAAC;QACD,gDAAgD;QAChD,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAChC,uDAAuD;QACvD,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;KACpC,CAAA;AACF,CAAC,CAAA"}
|
package/lib/Socket/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { UserFacingSocketConfig } from '../Types/index.js';
|
|
1
|
+
import type { GroupMetadata, UserFacingSocketConfig } from '../Types/index.js';
|
|
2
2
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
3
|
-
communityMetadata: (jid: string) => Promise<
|
|
4
|
-
communityCreate: (subject: string, body: string) => Promise<
|
|
5
|
-
communityCreateGroup: (subject: string, participants: string[], parentCommunityJid: string) => Promise<
|
|
3
|
+
communityMetadata: (jid: string) => Promise<GroupMetadata>;
|
|
4
|
+
communityCreate: (subject: string, body: string) => Promise<GroupMetadata | null>;
|
|
5
|
+
communityCreateGroup: (subject: string, participants: string[], parentCommunityJid: string) => Promise<GroupMetadata | null>;
|
|
6
6
|
communityLeave: (id: string) => Promise<void>;
|
|
7
7
|
communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
8
8
|
communityLinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
|
|
@@ -36,13 +36,13 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
36
36
|
communityAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
37
37
|
communityRevokeInviteV4: (communityJid: string, invitedJid: string) => Promise<boolean>;
|
|
38
38
|
communityAcceptInviteV4: (key: string | import("../index.js").WAMessageKey, inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
39
|
-
communityGetInviteInfo: (code: string) => Promise<
|
|
39
|
+
communityGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
|
40
40
|
communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
41
41
|
communitySettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
42
42
|
communityMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
43
43
|
communityJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
44
44
|
communityFetchAllParticipating: () => Promise<{
|
|
45
|
-
[_: string]:
|
|
45
|
+
[_: string]: GroupMetadata;
|
|
46
46
|
}>;
|
|
47
47
|
logger: import("../Utils/logger.js").ILogger;
|
|
48
48
|
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../index.js").OrderDetails>;
|
|
@@ -117,8 +117,8 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
117
117
|
newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
|
|
118
118
|
newsletterDemote: (jid: string, userJid: string) => Promise<void>;
|
|
119
119
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
120
|
-
groupMetadata: (jid: string) => Promise<
|
|
121
|
-
groupCreate: (subject: string, participants: string[]) => Promise<
|
|
120
|
+
groupMetadata: (jid: string) => Promise<GroupMetadata>;
|
|
121
|
+
groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>;
|
|
122
122
|
groupLeave: (id: string) => Promise<void>;
|
|
123
123
|
groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
124
124
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
@@ -139,13 +139,13 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
139
139
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
140
140
|
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
141
141
|
groupAcceptInviteV4: (key: string | import("../index.js").WAMessageKey, inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
142
|
-
groupGetInviteInfo: (code: string) => Promise<
|
|
142
|
+
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
|
|
143
143
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
144
144
|
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
145
145
|
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
146
146
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
147
147
|
groupFetchAllParticipating: () => Promise<{
|
|
148
|
-
[_: string]:
|
|
148
|
+
[_: string]: GroupMetadata;
|
|
149
149
|
}>;
|
|
150
150
|
serverProps: {
|
|
151
151
|
privacyTokenOn1to1: boolean;
|
|
@@ -269,6 +269,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
269
269
|
disableButtons: (msg: import("../index.js").WAMessage, text?: string) => Promise<boolean>;
|
|
270
270
|
sendList: (jid: string, { sections, ...rest }: import("../index.js").SendListOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
271
271
|
sendPoll: (jid: string, name: string, values: string[], poll?: Partial<Omit<import("../index.js").PollMessageOptions, "name" | "values">>, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
272
|
+
sendQuiz: (jid: string, name: string, values: string[], correctAnswer: string | number, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
272
273
|
getPollVotes: (pollKey: import("../index.js").WAMessageKey | string) => {
|
|
273
274
|
pollKey: import("../index.js").WAMessageKey;
|
|
274
275
|
pollName: string;
|
|
@@ -277,6 +278,17 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
277
278
|
voters: string[];
|
|
278
279
|
}[];
|
|
279
280
|
} | undefined;
|
|
281
|
+
getQuizResult: (pollKey: import("../index.js").WAMessageKey | string) => {
|
|
282
|
+
pollKey: import("../index.js").WAMessageKey;
|
|
283
|
+
pollName: string;
|
|
284
|
+
correct: string;
|
|
285
|
+
right: string[];
|
|
286
|
+
wrong: string[];
|
|
287
|
+
votes: {
|
|
288
|
+
name: string;
|
|
289
|
+
voters: string[];
|
|
290
|
+
}[];
|
|
291
|
+
} | undefined;
|
|
280
292
|
downloadMedia: (msg: import("../index.js").WAMessage, options?: import("../index.js").DownloadMediaOptions) => Promise<Buffer>;
|
|
281
293
|
} & {
|
|
282
294
|
onReply: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
|
|
@@ -284,6 +296,17 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
284
296
|
onList: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
|
|
285
297
|
awaitReply: (msg: import("../index.js").WAMessage, { timeoutMs, filter }?: import("../index.js").AwaitReplyOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
286
298
|
} & {
|
|
299
|
+
sendTimedPoll: (jid: string, name: string, values: string[], { closeAfter, selectableCount, showVoters, onClose }: import("../index.js").TimedPollOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<{
|
|
300
|
+
message: import("../index.js").WAMessage;
|
|
301
|
+
closesAt: Date;
|
|
302
|
+
cancel: () => boolean;
|
|
303
|
+
}>;
|
|
304
|
+
openPolls: () => {
|
|
305
|
+
id: string;
|
|
306
|
+
jid: string;
|
|
307
|
+
name: string;
|
|
308
|
+
closesAt: Date;
|
|
309
|
+
}[];
|
|
287
310
|
commands: {
|
|
288
311
|
add: (definition: import("../index.js").CommandDefinition) => /*elided*/ any;
|
|
289
312
|
remove: (name: string) => boolean;
|
|
@@ -332,12 +355,33 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
332
355
|
clear: () => void;
|
|
333
356
|
} | undefined;
|
|
334
357
|
groupCache: {
|
|
335
|
-
get: (jid: string) =>
|
|
336
|
-
set: (jid: string, data:
|
|
358
|
+
get: (jid: string) => GroupMetadata | undefined;
|
|
359
|
+
set: (jid: string, data: GroupMetadata) => void;
|
|
337
360
|
delete: (jid: string) => boolean;
|
|
338
361
|
clear: () => void;
|
|
339
362
|
readonly size: number;
|
|
340
363
|
} | undefined;
|
|
364
|
+
sendContact: (jid: string, contacts: import("../index.js").ContactInput | import("../index.js").ContactInput[] | string, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
365
|
+
sendLocation: (jid: string, { latitude, longitude, name, address }: import("../index.js").LocationInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
366
|
+
sendAlbum: (jid: string, items: import("../index.js").AlbumItem[], options?: import("../index.js").MiscMessageGenerationOptions) => Promise<{
|
|
367
|
+
album: import("../index.js").WAMessage;
|
|
368
|
+
items: (import("../index.js").WAMessage | undefined)[];
|
|
369
|
+
}>;
|
|
370
|
+
sendEvent: (jid: string, event: import("../index.js").EventInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
371
|
+
sendLong: (jid: string, text: string, long?: import("../index.js").SendLongOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<(import("../index.js").WAMessage | undefined)[]>;
|
|
372
|
+
sendImagePoll: (jid: string, poll: import("../index.js").ImagePollInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<{
|
|
373
|
+
album: {
|
|
374
|
+
album: import("../index.js").WAMessage;
|
|
375
|
+
items: (import("../index.js").WAMessage | undefined)[];
|
|
376
|
+
};
|
|
377
|
+
poll: import("../index.js").WAMessage | undefined;
|
|
378
|
+
}>;
|
|
379
|
+
sendScheduledCall: (jid: string, call: import("../index.js").ScheduledCallInput, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
380
|
+
sendStatusMention: (content: Record<string, any>, { mentions, backgroundColor, font }: import("../index.js").StatusMentionOptions) => Promise<import("../index.js").WAMessage>;
|
|
381
|
+
channelInfo: (input: string) => Promise<import("../index.js").NewsletterMetadata | null>;
|
|
382
|
+
sendHtml: (jid: string, html: string, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
383
|
+
tagAll: (jid: string, text: string, { mode }?: import("../index.js").TagAllOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
384
|
+
ask: (to: import("../index.js").WAMessage, question: string, { timeoutMs }?: import("../index.js").AskOptions) => Promise<string | undefined>;
|
|
341
385
|
confirm: (msg: import("../index.js").WAMessage, text: string, options?: import("../index.js").ConfirmOptions) => Promise<boolean>;
|
|
342
386
|
paginate: (msg: import("../index.js").WAMessage, items: unknown[], options?: import("../index.js").PaginateOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
343
387
|
menu: (msg: import("../index.js").WAMessage, definition: import("../index.js").MenuDefinition) => Promise<import("../index.js").WAMessage | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Socket/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Socket/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AA0BrE,QAAA,MAAM,YAAY,GAAI,QAAQ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgM6rmB,CAAC;;;;;;;;;0DA3L5umB,GAAG,0BACN,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0LkJ,CAAC;;;;;iBAA6U,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YArEhe,CAAC;iBAAoB,CAAC;;;;;;CAkE5B,CAAA;AAED,eAAe,YAAY,CAAA"}
|