whatsapp

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package whatsapp exposes the WhatsApp (Meta Cloud API) constructor, the raw-message accessor, and the Config/Message/Media types for botbooter. Import it for a WhatsApp bot; 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 or go-telegram.

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.

Jump to

Keyboard shortcuts

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