Skip to content

GOWA - WhatsApp REST API with support for UI, Multi Account, Webhooks, and MCP, and Chatwoot. Built with Golang for efficient memory use.

refactor(whatsapp): add JSON tags to ExtractedMedia and EvtMessage structs

Aldino Kemalab423b73bf84
diff --git a/src/pkg/utils/whatsapp.go b/src/pkg/utils/whatsapp.go
index ea4c6e3b..3a2b4d2a 100644
--- a/src/pkg/utils/whatsapp.go
+++ b/src/pkg/utils/whatsapp.go
@@ -467,9 +467,9 @@ func FormatJID(jid string) types.JID {
// ExtractedMedia represents extracted media information
type ExtractedMedia struct {
- MediaPath string
- MimeType string
- Caption string
+ MediaPath string `json:"media_path"`
+ MimeType string `json:"mime_type"`
+ Caption string `json:"caption"`
}
// ExtractMedia is a helper function to extract media from whatsapp
@@ -579,15 +579,15 @@ func MustLogin(client *whatsmeow.Client) {
// Internal message types for event handling
type EvtMessage struct {
- Text string
- ID string
- RepliedId string
- QuotedMessage string
+ Text string `json:"text"`
+ ID string `json:"id"`
+ RepliedId string `json:"replied_id"`
+ QuotedMessage string `json:"quoted_message"`
}
type EvtReaction struct {
- Message string
- ID string
+ Message string `json:"message"`
+ ID string `json:"id"`
}
// GetMessageDigestOrSignature generates HMAC signature for message