Skip to content

Instantly share code, notes, and snippets.

@spark-shadow
Last active March 2, 2024 06:18
Show Gist options
  • Save spark-shadow/c8da085d90e0293939aa8e4e12108086 to your computer and use it in GitHub Desktop.
Save spark-shadow/c8da085d90e0293939aa8e4e12108086 to your computer and use it in GitHub Desktop.
const Shadow = require("../Utilis/events");
const { forwardOrBroadCast } = require("../Utilis/groupmute");
const { getBuffer } = require('../Utilis/download');
const { parseJid } = require("../Utilis/vote");
// shadow
Shadow.addCommand(
{ pattern: 'send ?(.*)', fromMe: true, desc: "Forward replied msg." },
async (message, match) => {
if (match == "") return await message.sendMessage("*Give me a jid*\nExample .send jid1 jid2 jid3 jid4 ...");
if (!message.reply_message)
return await message.sendMessage("*Reply to a Message*");
let options = {}
options.ptt = true
options.contextInfo = {
forwardingScore: 5, // change it to 999 for many times forwarded
isForwarded: true
}
match.match(parseJid).map((jid) => {
forwardOrBroadCast(jid, message, options);
});
}
);
Shadow.addCommand(
{ pattern: 'fmsend ?(.*)', fromMe: true, desc: "Forward replied msg with fm tag" },
async (message, match) => {
if (match == "") return await message.sendMessage("*Give me a jid*\nExample .fmsend jid1 jid2 jid3 jid4 ...");
if (!message.reply_message)
return await message.sendMessage("*Reply to a Message*");
let options = {}
options.ptt = true
options.contextInfo = {
forwardingScore: 5, // change it to 999 for many times forwarded
isForwarded: true
}
match.match(parseJid).map((jid) => {
forwardOrBroadCast(jid, message, options);
});
}
);
Shadow.addCommand(
{ pattern: '2send ?(.*)', fromMe: true, desc: "Forward replied msg." },
async (message, match) => {
if (match == "") return await message.sendMessage("*Give me a jid*\nExample .2send jid1 jid2 jid3 jid4 ...");
if (!message.reply_message)
return await message.sendMessage("*Reply to a Message*");
let options = {}
options.contextInfo = {
forwardingScore: 5, // change it to 999 for many times forwarded
isForwarded: true
}
match.match(parseJid).map((jid) => {
forwardOrBroadCast(jid, message, options);
});
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment