Skip to content

Commit 7067e1d

Browse files
committed
[WAHA] Add poll meta attrs in sendNewsletter
1 parent 52e5e50 commit 7067e1d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

send.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,21 @@ func (cli *Client) sendNewsletter(
670670
plaintextNode.Attrs["mediatype"] = mediaType
671671
}
672672
}
673+
content := []waBinary.Node{}
674+
if attrs["type"] == "poll" {
675+
content = append(content, waBinary.Node{
676+
Tag: "meta",
677+
Attrs: waBinary.Attrs{
678+
"polltype": "creation",
679+
"contenttype": "text",
680+
},
681+
})
682+
}
683+
content = append(content, plaintextNode)
673684
node := waBinary.Node{
674685
Tag: "message",
675686
Attrs: attrs,
676-
Content: []waBinary.Node{plaintextNode},
687+
Content: content,
677688
}
678689
start = time.Now()
679690
data, err := cli.sendNodeAndGetData(node)

0 commit comments

Comments
 (0)