Documentation
¶
Overview ¶
Package cloud is the Meta Cloud API flavor of botbooter's WhatsApp support: it exposes the webhook-based constructor, the raw-message accessor, and the Config/Message/Media types. Import it for a WhatsApp bot backed by a Meta Business account; the adapter speaks the Cloud API over plain HTTP, so a WhatsApp-only binary pulls in no third-party platform SDK — it never compiles discordgo, slack-go, go-telegram or whatsmeow. For the QR-linked WhatsApp Web flavor (no Meta account or webhook needed), see botbooter/whatsapp/whatsmeow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMissingConfig = waint.ErrMissingConfig
ErrMissingConfig is returned by New when a required Config field is empty.
Functions ¶
func Addr ¶
Addr returns the address b's webhook listener is bound to (host:port), or "" if b is not a WhatsApp bot or is not connected. Use it to recover the OS-assigned port after passing cfg.Addr ":0".
func New ¶
New creates a WhatsApp bot backed by the Meta Cloud API. It runs an inbound webhook HTTP server at cfg.Addr, so put a TLS-terminating proxy in front and register the public HTTPS URL in Meta's webhook settings. It returns ErrMissingConfig if a required config field is missing.
Types ¶
type Message ¶
Message is the parsed payload of a WhatsApp webhook message.
func RawMessage ¶
RawMessage returns the parsed WhatsApp message carried on m, reporting whether m originated from WhatsApp.
type ReactionInfo ¶
type ReactionInfo = waint.ReactionInfo
ReactionInfo carries the reacted-to message id and emoji of a reaction message.