Skip to content

Instantly share code, notes, and snippets.

@I-NRL
Created October 27, 2023 02:07
Show Gist options
  • Save I-NRL/45149c7a63c9ab8b0456a9ded00b6f1b to your computer and use it in GitHub Desktop.
Save I-NRL/45149c7a63c9ab8b0456a9ded00b6f1b to your computer and use it in GitHub Desktop.
get or forward captions
const { inrl } = require('../lib')
inrl(
{
pattern: 'caption ?(.*)',
fromMe: true,
desc: 'copy or add caption to video or image',
type: 'whatsapp',
},
async (message, match) => {
if ((message.reply_message.image || message.reply_message.video) && match)
return await message.forwardMessage(message.jid,
await message.quoted.download(),
{ quoted: message.data, caption: match },
)
if (message.reply_message.text)
return await message.forwardMessage(message.jid, message.reply_message.text,
{ quoted: message.data})
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment