(sock, message, args, context)
| 19 | description: 'Send text with a fake "Frequently Forwarded" tag', |
| 20 | usage: '.viral <text> OR reply to a message', |
| 21 | async handler(sock, message, args, context) { |
| 22 | const chatId = context.chatId || message.key.remoteJid; |
| 23 | try { |
| 24 | let txt = ""; |
| 25 | const quoted = message.message?.extendedTextMessage?.contextInfo?.quotedMessage; |
| 26 | if (quoted) { |
| 27 | txt = quoted.conversation || |
| 28 | quoted.extendedTextMessage?.text || |
| 29 | quoted.imageMessage?.caption || |
| 30 | quoted.videoMessage?.caption || |
| 31 | ""; |
| 32 | } |
| 33 | if (!txt || txt.trim() === "") { |
| 34 | txt = args?.join(' ') || ""; |
| 35 | } |
| 36 | if (!txt || txt.trim() === "") { |
| 37 | return await sock.sendMessage(chatId, { |
| 38 | text: 'Please provide text or reply to a message to forward.' |
| 39 | }, { quoted: message }); |
| 40 | } |
| 41 | await sock.sendMessage(chatId, { |
| 42 | text: txt, |
| 43 | contextInfo: { |
| 44 | isForwarded: true, |
| 45 | forwardingScore: 999 |
| 46 | } |
| 47 | }); |
| 48 | } |
| 49 | catch (err) { |
| 50 | console.error('Forwarding Spoof Error:', err); |
| 51 | await sock.sendMessage(chatId, { text: '❌ Failed to spoof forwarding.' }); |
| 52 | } |
| 53 | } |
| 54 | }; |
| 55 | /***************************************************************************** |
| 56 | * * |
nothing calls this directly
no outgoing calls
no test coverage detected