Builders & Interactive

New in v1.0.4: Meta AI-style rich message builders and native-flow buttons โ€” no hand-rolling raw protos.

Button

import { Button } from 'aunubaileys'

const content = new Button()
  .title('Main Menu')
  .body('Pick one:')
  .footer('AunuCore')
  .reply('menu_ai', '๐Ÿค– AI')
  .url('๐ŸŒ Website', 'https://ai.aunuhost.bond')
  .copy('๐Ÿ“‹ Copy Code', 'AUNU-2026')
  .call('๐Ÿ“ž Call', '+12125550123')
  .build()

await sock.sendMessage(jid, content)

Export aliases: Buttons, ButtonBuilder.

ButtonV2 & lists

import { ButtonV2, Toolkit } from 'aunubaileys'

const section = Toolkit.listSection('Categories', [
  { id: 'music', title: 'Music', description: 'Latest releases' },
  { id: 'tools', title: 'Tools' }
])
const content = new ButtonV2()
  .body('Choose a category')
  .footer('AunuCore')
  .list('Open List', [section])
  .build()

Alias: ListButton. Toolkit also provides static shortcuts: quickReply(id, text), urlButton(text, url), copyButton(text, code), callButton(text, phone), listButton(text, title, rows).

Carousel

import { Carousel } from 'aunubaileys'

const content = new Carousel()
  .body('AunuCore products')
  .card({ /* card 1: image + buttons */ })
  .card({ /* card 2 */ })
  .build()

Alias: CarouselBuilder.

AIRich โ€” AI-style rich responses

import { AIRich } from 'aunubaileys'

const content = new AIRich()
  .text('Here is the code:')
  .code('console.log("hello")', 'javascript')
  .latex('E = mc^2')
  .build()

await sock.sendMessage(jid, content)

More methods: .table(table) and .raw(sub). Aliases: AiRich, RichResponse.

sendInteractive + AunuHandler (v1.0.3 / v1.0.4)

Every socket carries sock.aunuHandler โ€” an ergonomic wrapper over the socket:

MethodPurpose
handler.send(jid, content, options?)Send a message
handler.reply(jid, content, quoted, options?)Reply with a quote
handler.react(jid, emoji, key)Add an emoji reaction
handler.sendInteractive(jid, content, options?)Send interactive content โ€” automatically falls back to plain text when the linked iOS device can't render it
handler.newsletterId(jid)Normalize a newsletter JID
await sock.aunuHandler.reply(jid, { text: 'Received ๐Ÿ–ค' }, m)
await sock.aunuHandler.react(jid, '๐Ÿ”ฅ', m.key)
await sock.aunuHandler.sendInteractive(jid, content)

The class is also exported directly: new AunuHandler(sock) โ€” with .name and .brand properties for bot identity.