Last active
June 18, 2024 16:48
-
-
Save techgod143/428b0f65ca90016b18d7054d49e5c57d to your computer and use it in GitHub Desktop.
Rngk auto fd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @READ_THIS For multiple forward tasks, copy this plugin and make a new one with another plugin name!!! | |
*/ | |
var source = "120363099306702747@g.us,120363139956956718@g.us,923025757095-1621488586@g.us" // Messages' source (SPLIT WITH COMMAS) | |
var target = "120363042835525124@g.us" // Messages will be sent here! (SPLIT WITH COMMAS) | |
let types = [ | |
"video", | |
"image", | |
// "extendedText", // remove first 2 slashes to forward large text | |
// "conversation", // remove first 2 slashes to forward text | |
"audio" | |
] | |
// ========================================================================= | |
// ======================== END OF EDITABLES =============================== | |
// ========================================================================= | |
let {Module} = require('../main'); | |
// pattern: 'autoforward_1 ?(.*)', | |
Module({on:"message",fromMe:false},async (m)=>{ | |
if (source.split(",").includes(m.jid)){ | |
let mtp = Object.keys(m.data.message)[0].replace("Message","") | |
if (types.includes(mtp)){ | |
if (m.data.message[Object.keys(m.data.message)[0]].caption){ | |
let caption = m.data.message[Object.keys(m.data.message)[0]].caption | |
var isLink = (/(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])/gi).test(caption) | |
if (isLink) m.data.message[Object.keys(m.data.message)[0]].caption = "" | |
} | |
await m.forwardMessage(target,m.data,{contextInfo:{isForwarded:false}}) | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment