Baileys
Baileys copied to clipboard
Pin Messages
Implement the new pinning feature
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.