-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List and Button messages appearing only at the sender account #305
Comments
in my case, its appears on latest app version, but not on an older version and on whatsapp web |
I do have the latest app version at Android that is version 2.22.24.78, Is it the same you have? are you at Android or iOS? |
did you wrap it with ViewOnceMessage ?
|
No, do I need to wrap it? |
yups |
Thanks a lot, it is working fine now: package utils
import (
"context"
"fmt"
"strconv"
"strings"
"wa/Enum"
"wa/api"
"wa/global"
waProto "go.mau.fi/whatsmeow/binary/proto"
"google.golang.org/protobuf/proto"
)
func MainMenu(sender, welcome string) {
targetJID, ok := ParseJID(sender)
if !ok {
return
}
msg1 := &waProto.ListMessage{
Title: proto.String(welcome),
Description: proto.String("يرجى تحديد سبب التواصل"),
ButtonText: proto.String("أنقر هنا 👈"),
ListType: waProto.ListMessage_SINGLE_SELECT.Enum(),
Sections: []*waProto.ListMessage_Section{
{
Title: proto.String("لدي إستفسار بخصوص:"),
Rows: []*waProto.ListMessage_Row{
{
RowId: proto.String(strconv.Itoa(Enum.Discount)),
Title: proto.String("عمادة القبول والتسجيل"),
// Description: proto.String("عمادة القبول والتسجيل"),
},
{
RowId: proto.String(strconv.Itoa(Enum.Discount)),
Title: proto.String("عمادة شؤون المكتبات"),
},
{
RowId: proto.String(strconv.Itoa(Enum.Discount)),
Title: proto.String("مواقع كليات وفروع جامعة الملك خالد"),
},
},
},
},
// ProductListInfo: &waProto.ListMessage_ProductListInfo{},
// FooterText: new(string),
// ContextInfo: &waProto.ContextInfo{},
}
msg2 := &waProto.ButtonsMessage{
ContentText: proto.String("لدي إستفسار بخصوص:"),
HeaderType: waProto.ButtonsMessage_EMPTY.Enum(),
Buttons: []*waProto.ButtonsMessage_Button{
{
ButtonId: proto.String(strconv.Itoa(Enum.Yes)),
ButtonText: &waProto.ButtonsMessage_Button_ButtonText{DisplayText: proto.String("نعم")},
Type: waProto.ButtonsMessage_Button_RESPONSE.Enum(),
NativeFlowInfo: &waProto.ButtonsMessage_Button_NativeFlowInfo{},
},
{
ButtonId: proto.String(strconv.Itoa(Enum.No)),
ButtonText: &waProto.ButtonsMessage_Button_ButtonText{DisplayText: proto.String("لا")},
Type: waProto.ButtonsMessage_Button_RESPONSE.Enum(), //proto.ButtonsMessage_Button_Type.Enum,
NativeFlowInfo: &waProto.ButtonsMessage_Button_NativeFlowInfo{},
},
},
}
send, err := api.Client.SendMessage(context.Background(), targetJID, "", &waProto.Message{
ViewOnceMessage: &waProto.FutureProofMessage{
Message: &waProto.Message{
ListMessage: msg1,
},
}})
if err != nil {
global.Log.Errorf("Error sending message: %v", err)
} else {
global.Log.Infof("Message sent (server timestamp: %s)", send)
}
send3, err := api.Client.SendMessage(context.Background(), targetJID, "", &waProto.Message{
ViewOnceMessage: &waProto.FutureProofMessage{
Message: &waProto.Message{
ButtonsMessage: msg2,
},
}})
if err != nil {
global.Log.Errorf("Error sending message: %v", err)
} else {
global.Log.Infof("Message sent (server timestamp: %s)", send3)
}
var content strings.Builder
content.WriteString(welcome)
content.WriteString("\n")
content.WriteString("الرجاء إختيار خيار من أدناه")
content.WriteString("\n")
content.WriteString("1️⃣ إستفسارات عمادة القبول و التسجيل")
content.WriteString("\n")
content.WriteString("2️⃣ إستفسارات عمادة شؤون المكتبات")
content.WriteString("\n")
content.WriteString("3️⃣ مواقع كليات و فروع الجامعه")
content.WriteString("\n")
send2, err := api.Client.SendMessage(context.Background(), targetJID, "", &waProto.Message{
Conversation: proto.String(content.String()),
})
if err != nil {
global.Log.Errorf("Error sending message: %v", err)
} else {
global.Log.Infof("Message sent (server timestamp: %s)", send2)
}
fmt.Println(send2)
} |
Doesn't work when sending the template message. For example: #173 |
func (m Module) eventHandler(evt interface{}) {
} |
No able to see the button messages in the recipient mobile after using view once also |
I've the below code:
But the list message is seen only at th esender account (i.e. the account connected to the app using whatsmeow package) and not seeing it at the recieved account, same happen with
Button Message
, but sending aconversation message
is different as it is appearing at both accountsThe text was updated successfully, but these errors were encountered: