herramientas-fakeReply.js 1.1 KB

12345678910111213141516171819202122232425
  1. const handler = async (m, {conn, text, usedPrefix, command}) => {
  2. if (!text) return m.reply(`*⚠️ 𝐔𝐬𝐨 𝐝𝐞𝐥 𝐜𝐨𝐦𝐚𝐧𝐝𝐨*\n\n*${usedPrefix + command}* hola @${m.sender.split`@`[0]} a`, null, {mentions: [m.sender]});
  3. const cm = copy(m);
  4. let who;
  5. if (text.includes('@0')) who = '[email protected]';
  6. else if (m.isGroup) who = cm.participant = m.mentionedJid[0];
  7. else who = m.chat;
  8. if (!who) return m.reply(`*⚠️ 𝐔𝐬𝐨 𝐝𝐞𝐥 𝐜𝐨𝐦𝐚𝐧𝐝𝐨*\n\n*${usedPrefix + command}* hola @${m.sender.split`@`[0]} a`, null, {mentions: [m.sender]});
  9. cm.key.fromMe = false;
  10. cm.message[m.mtype] = copy(m.msg);
  11. const sp = '@' + who.split`@`[0];
  12. const [fake, ...real] = text.split(sp);
  13. conn.fakeReply(m.chat, real.join(sp).trimStart(), who, fake.trimEnd(), m.isGroup ? m.chat : false, { contextInfo: { mentionedJid: conn.parseMention(real.join(sp).trim()),
  14. },
  15. })};
  16. handler.help = ['fake <text> @user <text2>'];
  17. handler.tags = ['tools'];
  18. handler.command = /^(fitnah|fakereply|fake)$/;
  19. handler.register = true
  20. handler.limit = 3
  21. export default handler;
  22. function copy(obj) {
  23. return JSON.parse(JSON.stringify(obj));
  24. }