@pontasockets/baileys 0.3.0 → 0.3.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.
@@ -298,7 +298,7 @@ const prepareRichResponseMessage = (content) => {
298
298
  items = [{ code: content.code, language: content.language }]
299
299
  }
300
300
 
301
- submessages = items.map(item => {
301
+ submessages = items.flatMap(item => {
302
302
  // ── TEXT ──────────────────────────────────────────────────────────
303
303
  if ('text' in item) {
304
304
  return {
@@ -318,13 +318,20 @@ const prepareRichResponseMessage = (content) => {
318
318
  for (const row of (rows || [])) {
319
319
  allRows.push({ items: row, isHeading: false })
320
320
  }
321
- return {
321
+ const tableSubmessage = {
322
322
  messageType: RichSubMessageType.TABLE,
323
- tableMetadata: {
324
- ...(title ? { title } : {}),
325
- rows: allRows
326
- }
323
+ tableMetadata: { rows: allRows }
324
+ }
325
+ if (title) {
326
+ return [
327
+ {
328
+ messageType: RichSubMessageType.TEXT,
329
+ messageText: title
330
+ },
331
+ tableSubmessage
332
+ ]
327
333
  }
334
+ return tableSubmessage
328
335
  }
329
336
 
330
337
  // ── CODE (default) ────────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pontasockets/baileys",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Baileys is a lightweight JavaScript library for interacting with the WhatsApp Web API using WebSocket.",
5
5
  "keywords": [
6
6
  "facebook",
@@ -31,7 +31,7 @@
31
31
  "@adiwajshing/keyed-db": "^0.2.4",
32
32
  "@cacheable/node-cache": "1.5.3",
33
33
  "@pontasockets/eslint-config": "^1.0.0",
34
- "@pontasockets/libsignal-node": "^1.0.0",
34
+ "@pontasockets/libsignal-node": "^1.1.0",
35
35
  "@hapi/boom": "^9.1.3",
36
36
  "async-mutex": "^0.5.0",
37
37
  "axios": "^1.12.1",