From 83669df329dcd475b4f7f03697dae2260c0babcf Mon Sep 17 00:00:00 2001 From: Deniz <100031702+diezeldev@users.noreply.github.com> Date: Sat, 12 Mar 2022 05:02:27 +0100 Subject: [PATCH 1/2] Make disconnect reason in example more apparent when logged out. (#1352) * Add a warning to make people aware of what they should do about the 'Restart Required' message. * More descriptive message when session has been logged out of. --- Example/example.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example/example.ts b/Example/example.ts index b8820db..f3bccf2 100644 --- a/Example/example.ts +++ b/Example/example.ts @@ -75,7 +75,7 @@ const startSock = async() => { if((lastDisconnect.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut) { startSock() } else { - console.log('connection closed') + console.log('Connection closed. You are logged out.') } } From 2b702699476a4df7ac2126918e0515bf94620b92 Mon Sep 17 00:00:00 2001 From: Dwi Rizqi Date: Sun, 13 Mar 2022 22:41:41 +0700 Subject: [PATCH 2/2] Update README.md (#1354) --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c44f2d..a869e7f 100644 --- a/README.md +++ b/README.md @@ -316,6 +316,10 @@ import { MessageType, MessageOptions, Mimetype } from '@adiwajshing/baileys' const id = 'abcd@s.whatsapp.net' // the WhatsApp ID // send a simple text! const sentMsg = await sock.sendMessage(id, { text: 'oh hello there' }) +// send a reply messagge +const sentMsg = await sock.sendMessage(id, { text: 'oh hello there' }, { quoted: message }) +// send a mentions message +const sentMsg = await sock.sendMessage(id, { text: '@12345678901', mentions: ['12345678901@s.whatsapp.net'] }) // send a location! const sentMsg = await sock.sendMessage( id, @@ -480,7 +484,7 @@ const sendMsg = await sock.sendMessage(id, templateMessage) contextInfo: { forwardingScore: 2, isForwarded: true }, // some random context info (can show a forwarded message with this too) timestamp: Date(), // optional, if you want to manually set the timestamp of the message caption: "hello there!", // (for media messages) the caption to send with the media (cannot be sent with stickers though) - thumbnail: "23GD#4/==", /* (for location & media messages) has to be a base 64 encoded JPEG if you want to send a custom thumb, + jpegThumbnail: "23GD#4/==", /* (for location & media messages) has to be a base 64 encoded JPEG if you want to send a custom thumb, or set to null if you don't want to send a thumbnail. Do not enter this field if you want to automatically generate a thumb */ @@ -701,6 +705,8 @@ Of course, replace ``` xyz ``` with an actual ID. ``` ts // only allow admins to send messages await sock.groupSettingUpdate("abcd-xyz@g.us", 'announcement') + // allow everyone to send messages + await sock.groupSettingUpdate("abcd-xyz@g.us", 'not_announcement') // allow everyone to modify the group's settings -- like display picture etc. await sock.groupSettingUpdate("abcd-xyz@g.us", 'unlocked') // only allow admins to modify the group's settings