import login from "fca-priyansh";
import fs from "fs";
import express from "express";
const OWNER_UIDS = ["100041949485196", "100051427690855", "100072241764812",
"100024330052795"];
let rkbInterval = null;
let stopRequested = false;
const lockedGroupNames = {};
let mediaLoopInterval = null;
let lastMedia = null;
let targetUID = null;
let stickerInterval = null;
let stickerLoopActive = false;
const friendUIDs = [Link]("[Link]") ? [Link]("[Link]",
"utf8").split("\n").map(x => [Link]()).filter(Boolean) : [];
const targetUIDs = [Link]("[Link]") ? [Link]("[Link]",
"utf8").split("\n").map(x => [Link]()).filter(Boolean) : [];
const messageQueues = {};
const queueRunning = {};
const app = express();
[Link]("/", (_, res) => [Link]("<h2>Messenger Bot Running</h2>"));
[Link](20782, () => [Link]("🌐 Log server: [Link]
[Link]("uncaughtException", (err) => [Link]("❗ Uncaught Exception:",
[Link]));
[Link]("unhandledRejection", (reason) => [Link]("❗ Unhandled
Rejection:", reason));
login({ appState: [Link]([Link]("[Link]", "utf8")) }, (err,
api) => {
if (err) return [Link]("❌ Login failed:", err);
[Link]({ listenEvents: true });
[Link]("✅ Bot logged in and running...");
[Link](async (err, event) => {
try {
if (err || !event) return;
const { threadID, senderID, body, messageID } = event;
const enqueueMessage = (uid, threadID, messageID, api) => {
if (!messageQueues[uid]) messageQueues[uid] = [];
messageQueues[uid].push({ threadID, messageID });
if (queueRunning[uid]) return;
queueRunning[uid] = true;
const lines = [Link]("[Link]", "utf8").split("\
n").filter(Boolean);
let index = 0;
const processQueue = async () => {
if (!messageQueues[uid].length) {
queueRunning[uid] = false;
return;
}
const msg = messageQueues[uid].shift();
const randomLine = lines[[Link]([Link]() * [Link])];
[Link](randomLine, [Link], [Link]);
setTimeout(processQueue, 20000);
};
processQueue();
};
if ([Link]("[Link]") && ([Link](senderID) || senderID ===
targetUID)) {
enqueueMessage(senderID, threadID, messageID, api);
}
if ([Link] === "event" && [Link] === "log:thread-name") {
const currentName = [Link];
const lockedName = lockedGroupNames[threadID];
if (lockedName && currentName !== lockedName) {
try {
await [Link](lockedName, threadID);
[Link](` "${lockedName}"`, threadID);
} catch (e) {
[Link]("❌ Error reverting group name:", [Link]);
}
}
return;
}
if (!body) return;
const lowerBody = [Link]();
const badNames = ["hannu", "syco", "anox", "avii", "satya", "anox", "avi"];
const triggers = ["rkb", "bhen", "maa", "Rndi", "chut", "randi",
"madhrchodh", "mc", "bc", "didi", "ma"];
if (
[Link](n => [Link](n)) &&
[Link](w => [Link](w)) &&

) {
return [Link](
"teri ma Rndi hai tu msg mt kr sb chodege teri ma ko byy🙂 ss Lekr story
Lga by",
threadID,
messageID
);
}
if (!OWNER_UIDS.includes(senderID)) return;
const args = [Link]().split(" ");
const cmd = args[0].toLowerCase();
const input = [Link](1).join(" ");
if (cmd === "/allname") {
try {
const info = await [Link](threadID);
const members = [Link];
[Link](`🛠 ${[Link]} ' nicknames...`, threadID);
for (const uid of members) {
try {
await [Link](input, threadID, uid);
[Link](`✅ Nickname changed for UID: ${uid}`);
await new Promise(res => setTimeout(res, 30000));
} catch (e) {
[Link](`⚠️ Failed for ${uid}:`, [Link]);
}
}
[Link]("ye gribh ka bcha to Rone Lga bkL", threadID);
} catch (e) {
[Link]("❌ Error in /allname:", e);
[Link]("badh me kLpauga", threadID);
}
}
else if (cmd === "/groupname") {
try {
await [Link](input, threadID);
[Link](`📝 Group name changed to: ${input}`, threadID);
} catch {
[Link](" klpoo🤣 rkb", threadID);
}
}
else if (cmd === "/lockgroupname") {
if (!input) return [Link]("name de 🤣 gc ke Liye", threadID);
try {
await [Link](input, threadID);
lockedGroupNames[threadID] = input;
[Link](`🔒 Group name "${input}"`, threadID);
} catch {
[Link]("❌ Locking failed.", threadID);
}
}
else if (cmd === "/unlockgroupname") {
delete lockedGroupNames[threadID];
[Link]("🔓 Group name unlocked.", threadID);
}
else if (cmd === "/uid") {
[Link](`🆔 Group ID: ${threadID}`, threadID);
}
else if (cmd === "/exit") {
try {
await [Link]([Link](), threadID);
} catch {
[Link]("❌ Can't leave group.", threadID);
}
}
else if (cmd === "/rkb") {
if () return [Link]("konsa gaLi du rkb
ko", threadID);
const name = [Link]();
const lines = [Link]("[Link]", "utf8").split("\
n").filter(Boolean);
stopRequested = false;
if (rkbInterval) clearInterval(rkbInterval);
let index = 0;
rkbInterval = setInterval(() => {
if (index >= [Link] || stopRequested) {
clearInterval(rkbInterval);
rkbInterval = null;
return;
}
[Link](`${name} ${lines[index]}`, threadID);
index++;
}, 60000);
[Link](`sex hogya bche 🤣rkb ${name}`, threadID);
}
else if (cmd === "/stop") {
stopRequested = true;
if (rkbInterval) {
clearInterval(rkbInterval);
rkbInterval = null;
[Link]("chud gaye bche🤣", threadID);
} else {
[Link]("konsa gaLi du sale ko🤣 rkb tha", threadID);
}
}
else if (cmd === "/photo") {
[Link]("📸 Send a photo or video within 1 minute...", threadID);
const handleMedia = async (mediaEvent) => {
if (
[Link] === "message" &&
[Link] === threadID &&
[Link] &&
[Link] > 0
) {
lastMedia = {
attachments: [Link],
threadID: [Link]
};
[Link]("✅ Photo/video received. Will resend every 30
seconds.", threadID);
if (mediaLoopInterval) clearInterval(mediaLoopInterval);
mediaLoopInterval = setInterval(() => {
if (lastMedia) {
[Link]({ attachment: [Link] },
[Link]);
}
}, 30000);
[Link]("message", handleMedia);
}
};
[Link]("message", handleMedia);
}
else if (cmd === "/stopphoto") {
if (mediaLoopInterval) {
clearInterval(mediaLoopInterval);
mediaLoopInterval = null;
lastMedia = null;
[Link]("chud gaye sb.", threadID);
} else {
[Link]("🤣ro sale chnar", threadID);
}
}
else if (cmd === "/forward") {
try {
const info = await [Link](threadID);
const members = [Link];
const msgInfo = [Link];
if (!msgInfo) return [Link]("❌ Kisi message ko reply karo bhai",
threadID);
for (const uid of members) {
if (uid !== [Link]()) {
try {
await [Link]({
body: [Link] || "",
attachment: [Link] || []
}, uid);
} catch (e) {
[Link](`⚠️ Can't send to ${uid}:`, [Link]);
}
await new Promise(res => setTimeout(res, 2000));
}
}
[Link]("📨 Forwarding complete.", threadID);
} catch (e) {
[Link]("❌ Error in /forward:", [Link]);
[Link]("❌ Error bhai, check logs", threadID);
}
}
else if (cmd === "/target") {
if (!args[1]) return [Link]("👤 UID de jisko target krna h",
threadID);
targetUID = args[1];
[Link](`ye chudega bhen ka Lowda ${targetUID}`, threadID);
}
else if (cmd === "/cleartarget") {
targetUID = null;
[Link]("ro kr kLp gya bkL🤣", threadID);
}
else if (cmd === "/help") {
const helpText = `
📌 Available Commands:
/allname <name> – Change all nicknames
/groupname <name> – Change group name
/lockgroupname <name> – Lock group name
/unlockgroupname – Unlock group name
/uid – Show group ID
/exit – group se Left Le Luga
/rkb <name> – HETTER NAME DAL
/stop – Stop RKB command
/photo – Send photo/video after this; it will repeat every 30s
/stopphoto – Stop repeating photo/video
/forward – Reply kisi message pe kro, sabko forward ho jaega
/target <uid> – Kisi UID ko target kr, msg pe random gali dega
/cleartarget – Target hata dega
/sticker<seconds> – [Link] se sticker spam (e.g., /sticker20)
/stopsticker – Stop sticker loop
😁
/help – Show this help message`;
[Link]([Link](), threadID);
}
else if ([Link]("/sticker")) {
if () return [Link]("❌ [Link]
not found", threadID);
const delay = parseInt([Link]("/sticker", ""));
if (isNaN(delay) || delay < 5) return [Link]("🕐 Bhai sahi time de
(min 5 seconds)", threadID);
const stickerIDs = [Link]("[Link]", "utf8").split("\n").map(x
=> [Link]()).filter(Boolean);
if (![Link]) return [Link]("⚠️ [Link] khali hai
bhai", threadID);
if (stickerInterval) clearInterval(stickerInterval);
let i = 0;
stickerLoopActive = true;
[Link](`📦 Sticker bhejna start: har ${delay} sec`, threadID);
stickerInterval = setInterval(() => {
if (!stickerLoopActive || i >= [Link]) {
clearInterval(stickerInterval);
stickerInterval = null;
stickerLoopActive = false;
return;
}
[Link]({ sticker: stickerIDs[i] }, threadID);
i++;
}, delay * 1000);
}
else if (cmd === "/stopsticker") {
if (stickerInterval) {
clearInterval(stickerInterval);
stickerInterval = null;
stickerLoopActive = false;
[Link]("🛑 Sticker bhejna band", threadID);
} else {
[Link]("😒 Bhai kuch bhej bhi rha tha kya?", threadID);
}
}
} catch (e) {
[Link]("⚠️ Error in message handler:", [Link]);
}
});
});