From 57267a63c75efaf3e194055fa0133f498d8c0752 Mon Sep 17 00:00:00 2001 From: fadiinho Date: Wed, 10 Aug 2022 03:46:30 -0300 Subject: [PATCH] docs: add how to pin and delete a chat --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index d53e36d..b458d4f 100644 --- a/README.md +++ b/README.md @@ -662,6 +662,24 @@ WA uses an encrypted form of communication to send chat/app updates. This has be ``` +- Delete a chat + ``` ts + const lastMsgInChat = await getLastMessageInChat('123456@s.whatsapp.net') // implement this on your end + await sock.chatModify({ + delete: true, + lastMessages: [{ key: lastMsgInChat.key, messageTimestamp: lastMsgInChat.messageTimestamp }] } + }, + '123456@s.whatsapp.net') + ``` + +- Pin/unpin a chat + ``` ts + await sock.chatModify({ + pin: true // or `false` to unpin + }, + '123456@s.whatsapp.net') + ``` + **Note:** if you mess up one of your updates, WA can log you out of all your devices and you'll have to log in again. ## Disappearing Messages