Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

Pin messages

Open APdev93 opened this issue 1 year ago • 14 comments

I've tried the code from the baileys documentation, but I only get the response ID, and nothing happens Screenshot_20231208-143844~2

APdev93 avatar Dec 10 '23 23:12 APdev93

Someone can help me?🗿

APdev93 avatar Dec 12 '23 00:12 APdev93

Someone can help me?🗿

Try to use in code

Riders004 avatar Dec 12 '23 02:12 Riders004

Seseorang dapat membantu saya?🗿

Coba gunakan dalam kode

I've tried but it still doesn't work

APdev93 avatar Dec 12 '23 07:12 APdev93

image i try this code, and nothing happen.. any solution?

ahmadkeren avatar Dec 13 '23 04:12 ahmadkeren

image i try this code, and nothing happen.. any solution?

Wait for Baileys update

Riders004 avatar Dec 13 '23 13:12 Riders004

image i try this code, and nothing happen.. any solution?

that's not a code for pin messages, it's for pin chat

Rippanteq7 avatar Dec 13 '23 16:12 Rippanteq7

image i try this code, and nothing happen.. any solution?

that's not a code for pin messages, it's for pin chat

await sock.chatModify({ pin: true // or false to unpin }, '[email protected]')

The the code use m.chat or m.from instread of chat id

Riders004 avatar Dec 14 '23 02:12 Riders004

There is only a function to pin chats for now. As for pinning messages, considering it's a new feature, if I have some free time, I will create a pull request for it..

azudindaem avatar Dec 14 '23 02:12 azudindaem

image i try this code, and nothing happen.. any solution?

that's not a code for pin messages, it's for pin chat

await sock.chatModify({ pin: true // or false to unpin }, '[email protected]')

The the code use m.chat or m.from instread of chat id

sorry, for my mistake

ahmadkeren avatar Dec 14 '23 03:12 ahmadkeren

There is only a function to pin chats for now. As for pinning messages, considering it's a new feature, if I have some free time, I will create a pull request for it..

thank you.. I'm glad to hear that

ahmadkeren avatar Dec 14 '23 03:12 ahmadkeren

https://github.com/WhiskeySockets/Baileys/pull/545

Please try this PR. i dont have much time to test, hopefully someone can help to complete

azudindaem avatar Dec 14 '23 10:12 azudindaem

image i try this code, and nothing happen.. any solution?

that's not a code for pin messages, it's for pin chat

await sock.chatModify({ pin: true // or false to unpin }, '[email protected]')

The the code use m.chat or m.from instread of chat id

Dude This code is for pinning the chat

shizothetechie avatar Dec 17 '23 04:12 shizothetechie

https://github.com/WhiskeySockets/Baileys/pull/545

Please try this PR. i dont have much time to test, hopefully someone can help to complete

I just test, your code work but just little bit problem is pinned message not visible on Mobile Application 🙃, but it pinned on WhatsApp Web Version

shizothetechie avatar Dec 17 '23 04:12 shizothetechie

let templategenerate= await generateWAMessageFromContent(from, proto.Message.fromObject({pinInChatMessage: { key: message.key, type: 1, senderTimestampMs: new Date().getTime() / 1000 }}), {})

let templatenew = { messageContextInfo: { messageAddOnDurationInSecs: 604800 }, ...templategenerate.message }

await conn.relayMessage(from, templatenew, { messageId: templategenerate.key.id })

It only works on WhatsApp Web.

gusta4321 avatar Apr 21 '24 21:04 gusta4321