tulir / whatsmeow

Go library for the WhatsApp web multidevice API
https://go.mau.fi/whatsmeow
Mozilla Public License 2.0
2.1k stars 385 forks source link

How can I delete a message for me? #633

Open flykby opened 1 month ago

flykby commented 1 month ago

I am writing a system for filtering messages. I need the messages that are in the list of "Stop words" to be blocked. I tried using the SendMessage(BuildRevoke()) and RevokeMessage() methods. but they only delete messages sent by me

evtuhovdo commented 1 month ago

same problem

ozan-fn commented 3 weeks ago
resp, _ := client.SendMessage(context.Background(), v.Info.Chat, client.BuildPollCreation("meow?", []string{"yes", "no"}, 1))
client.SendMessage(context.Background(), v.Info.Chat, client.BuildRevoke(v.Info.Chat, types.EmptyJID, resp.ID))

its work ya ges yaaaa

tulir commented 3 weeks ago

Delete for me is an app state event, so it can be sent using https://pkg.go.dev/go.mau.fi/whatsmeow#Client.SendAppState

Feel free to make PR for adding a BuildDeleteForMe helper in https://github.com/tulir/whatsmeow/blob/main/appstate/encode.go

xiaohuwei commented 2 weeks ago

Delete for me is an app state event, so it can be sent using https://pkg.go.dev/go.mau.fi/whatsmeow#Client.SendAppState

Feel free to make PR for adding a BuildDeleteForMe helper in https://github.com/tulir/whatsmeow/blob/main/appstate/encode.go

Who can help me achieve it? Thank you so much. 🥺

@tulir