MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / handler

Function handler

plugins/forwarded.js:21–53  ·  view source on GitHub ↗
(sock, message, args, context)

Source from the content-addressed store, hash-verified

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 * *

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected