Replies: 2 comments
-
|
same problem |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
does anyone have any pointers here? My current code looks like this: func sendMessage2(message *waE2E.Message, jidStr string, client *whatsmeow.Client) {
if message != nil {
var JID types.JID
JID, err := types.ParseJID(jidStr)
if err != nil {
slog.Error("Failed to parse", "JID", jidStr)
} else {
slog.Info("Parsed correctly", "JID", JID)
}
m, err := client.SendMessage(context.Background(), JID, message)
key := waCommon.MessageKey{ID: proto.String(m.ID), RemoteJID: proto.String(jidStr), FromMe: proto.Bool(true)}
m, err = client.SendMessage(context.Background(), JID, &waE2E.Message{
MessageContextInfo: &waE2E.MessageContextInfo{
MessageAddOnDurationInSecs: proto.Uint32(604800),
},
PinInChatMessage: &waE2E.PinInChatMessage{
Key: &key,
//Key: client.BuildMessageKey(JID, *client.Store.ID, m.ID),
Type: waE2E.PinInChatMessage_PIN_FOR_ALL.Enum(),
SenderTimestampMS: proto.Int64(time.Now().UnixMilli()),
},
EventMessage: &waE2E.EventMessage{},
})
// FIXME showing error even when successful
if err != nil {
slog.Error("Failed to send message", "error", err)
} else {
slog.Info("Sent Message successfully")
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Whatszup fellas, yo give me a hand here. I'm trying to pin a message in a group but its not working. Here my code i was trying (based on message log received by event handler
My code:
Beta Was this translation helpful? Give feedback.
All reactions