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 ¶
- func PlainTextFromProto(msg *waE2E.Message) string
- func Reply(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func ReplyWithMentions(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendAudio(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendBundledOggVoice(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendDocument(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendImage(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendLocation(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendReaction(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendSticker(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendText(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendTextToJID(ctx context.Context, client *whatsmeow.Client, chat types.JID, text string, ...) error
- func SendTextWithMentions(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func SendVideo(ctx context.Context, client *whatsmeow.Client, evt *events.Message, ...) error
- func VisibleTextFromEvent(evt *events.Message) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlainTextFromProto ¶
PlainTextFromProto retorna Conversation ou ExtendedText (sem captions de mídia).
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 ¶
VisibleTextFromEvent extrai o texto que pode disparar comandos: corpo, extended ou caption.
Types ¶
This section is empty.