tulir / whatsmeow

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

How can I delete a message for me? #633

Open flykby opened 3 months ago

flykby commented 3 months 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 3 months ago

same problem

ozan-fn commented 3 months 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 months 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 months 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

marcos-travasso commented 2 days 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

I made the helper, waiting for approval on my PR #702