-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
36 lines (31 loc) · 627 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"fmt"
"log"
"github.com/green-api/whatsapp-api-client-golang/pkg/api"
)
func main() {
GreenAPI := api.GreenAPI{
IDInstance: "1101000001",
APITokenInstance: "d75b3a66374942c5b3c019c698abc2067e151558acbd412345",
}
response, err := GreenAPI.Methods().Sending().SendPoll(map[string]interface{}{
"chatId": "11001234567@c.us",
"message": "Please choose a color:",
"options": []map[string]interface{}{
{
"optionName": "Red",
},
{
"optionName": "Green",
},
{
"optionName": "Blue",
},
},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(response)
}