Is it possible to reply or send buttons?
Closed this issue · 3 comments
puzanov commented
puzanov commented
Whoa! I've found it here: https://github.com/paked/messenger/blob/master/response.go
Can you share an example how to use that?
dgellow commented
@puzanov A simple example, with a button template for account linking:
// Handle received messages
client.HandleMessage(func(m messenger.Message, r *messenger.Response) {
switch strings.ToLower(m.Text) {
case "login":
buttons := &[]messenger.StructuredMessageButton{
messenger.StructuredMessageButton{
Type: "account_link",
URL: "https://yourSignInFormURL" ,
},
}
err := r.ButtonTemplate("Connect your account", buttons, messenger.ResponseType)
if err != nil {
log.Println("failed to send login button:", err)
return
}
}
puzanov commented
Thanks