whatsapp

package
v0.0.0-...-db4cfd3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package whatsapp encapsula envio de mensagens WhatsApp (texto, mídia, reações, localização) e helpers para ler texto visível dos protos/eventos (router, comandos em DM).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PlainTextFromProto

func PlainTextFromProto(msg *waE2E.Message) string

PlainTextFromProto retorna Conversation ou ExtendedText (sem captions de mídia).

func Reply

func Reply(ctx context.Context, client *whatsmeow.Client, evt *events.Message, text string) error

Reply envia texto citando a mensagem que disparou o handler.

func ReplyWithMentions

func ReplyWithMentions(ctx context.Context, client *whatsmeow.Client, evt *events.Message, text string, mentions []string) error

ReplyWithMentions envia resposta citada com menções @.

func SendAudio

func SendAudio(
	ctx context.Context,
	client *whatsmeow.Client,
	evt *events.Message,
	uploaded *whatsmeow.UploadResponse,
	mimetype string,
	ptt bool,
	reply bool,
) error

SendAudio envia áudio já uploaded; ptt=true estilo nota de voz.

func SendBundledOggVoice

func SendBundledOggVoice(ctx context.Context, client *whatsmeow.Client, evt *events.Message, path string) error

SendBundledOggVoice lê um OGG Opus local, faz upload e envia como nota de voz (PTT) citando a mensagem.

func SendDocument

func SendDocument(
	ctx context.Context,
	client *whatsmeow.Client,
	evt *events.Message,
	uploaded *whatsmeow.UploadResponse,
	mimetype string,
	filename string,
	caption string,
	reply bool,
) error

SendDocument envia ficheiro como documento (PDF, ZIP, MP3, etc.).

func SendImage

func SendImage(
	ctx context.Context,
	client *whatsmeow.Client,
	evt *events.Message,
	uploaded *whatsmeow.UploadResponse,
	rawData []byte,
	caption string,
	reply bool,
) error

SendImage envia imagem com legenda opcional e miniatura borrada (JPEGThumbnail).

func SendLocation

func SendLocation(
	ctx context.Context,
	client *whatsmeow.Client,
	evt *events.Message,
	lat float64,
	lon float64,
	name string,
	address string,
	reply bool,
) error

SendLocation envia pin de mapa com coordenadas e nome/endereço opcionais.

func SendReaction

func SendReaction(
	ctx context.Context,
	client *whatsmeow.Client,
	evt *events.Message,
	emoji string,
) error

SendReaction reage à mensagem original com um emoji; string vazia remove a reação.

func SendSticker

func SendSticker(
	ctx context.Context,
	client *whatsmeow.Client,
	evt *events.Message,
	uploaded *whatsmeow.UploadResponse,
	animated bool,
	reply bool,
) error

SendSticker envia figurinha WebP estática ou animada já uploaded.

func SendText

func SendText(ctx context.Context, client *whatsmeow.Client, evt *events.Message, text string, reply bool) error

SendText envia texto; reply=true cita a mensagem que disparou o comando.

func SendTextToJID

func SendTextToJID(ctx context.Context, client *whatsmeow.Client, chat types.JID, text string, mentions []string) error

SendTextToJID envia texto para um JID sem evento (ex.: scheduler de aniversários).

func SendTextWithMentions

func SendTextWithMentions(ctx context.Context, client *whatsmeow.Client, evt *events.Message, text string, mentions []string, reply bool) error

SendTextWithMentions envia texto com @; reply=true cita a mensagem original.

func SendVideo

func SendVideo(
	ctx context.Context,
	client *whatsmeow.Client,
	evt *events.Message,
	uploaded *whatsmeow.UploadResponse,
	caption string,
	gifPlayback bool,
	seconds uint32,
	reply bool,
) error

SendVideo envia vídeo com legenda opcional; gifPlayback=true reproduz como GIF silencioso em loop.

func VisibleTextFromEvent

func VisibleTextFromEvent(evt *events.Message) string

VisibleTextFromEvent extrai o texto que pode disparar comandos: corpo, extended ou caption.

Types

This section is empty.

Jump to

Keyboard shortcuts

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