cloud

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 2 Imported by: 0

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

View Source
var ErrMissingConfig = waint.ErrMissingConfig

ErrMissingConfig is returned by New when a required Config field is empty.

Functions

func Addr

func Addr(b *botbooter.Bot) string

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

func New(cfg Config) (*botbooter.Bot, error)

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 Config

type Config = waint.Config

Config configures a WhatsApp Cloud API bot.

type Media

type Media = waint.Media

Media is a media object attached to a WhatsApp message.

type Message

type Message = waint.Message

Message is the parsed payload of a WhatsApp webhook message.

func RawMessage

func RawMessage(m *botbooter.Message) (*Message, bool)

RawMessage returns the parsed WhatsApp message carried on m, reporting whether m originated from WhatsApp.

func RawReaction

func RawReaction(r *botbooter.Reaction) (*Message, bool)

RawReaction returns the parsed WhatsApp reaction message carried on r, reporting whether r originated from a WhatsApp reaction. The reacted message's id and emoji are on the returned Message's Reaction field.

type ReactionInfo

type ReactionInfo = waint.ReactionInfo

ReactionInfo carries the reacted-to message id and emoji of a reaction message.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL