Skip to content

Internal helper that prepares quick reply buttons for Whapi interactive messages. It relies on whapi_coerce_buttons_base() to normalize input (accept data.frame/list, map aliases label/name -> title, auto-generate id via slug + uniqueness) and then:

  • Enforces type = "quick_reply" for all buttons;

  • Requires the fields title and id;

  • Ensures the WhatsApp constraint of 1 to 3 buttons.

Usage

whapi_coerce_buttons_quick(buttons, verbose = TRUE)

Arguments

buttons

A data.frame/tibble (one row per button) or a list of named lists. title is required (or via alias), id will be auto-created when missing by whapi_coerce_buttons_base().

verbose

Logical (default TRUE). If TRUE, prints progress messages via cli.

Value

A list-of-lists of buttons, each including at least title, id, and type = "quick_reply".

See also

whapi_coerce_buttons_base() for normalization; other coercers for mixed buttons (url/call/copy).

Examples

# tibble::tribble(~title, "YES", "NO") |>
#   whapi_coerce_buttons_base() |>
#   whapi_coerce_buttons_quick()