goat
command
autoreact
Auto react on/off with status
0
views
0
likes
0
installs
Aliases: ar
raw source
module.exports = {
config: {
name: "autoreact",
aliases: ["ar"],
version: "6.2.2",
author: "๐๐๐๐ฎ๐
",
role: 0,
category: "system",
description: "Auto react on/off with status"
},
onStart: async function ({ api, event, args }) {
const { threadID, messageID } = event;
global.__autoReactStatus??= {};
if (global.__autoReactStatus[threadID] === undefined)
global.__autoReactStatus[threadID] = false;
const cmd = args[0]?.toLowerCase();
if (cmd === "on") {
global.__autoReactStatus[threadID] = true;
return api.sendMessage("โ
๐๐ฎ๐ญ๐จ๐๐๐๐๐ญ ๐๐ง๐๐๐ฅ๐๐", threadID, messageID);
}
else if (cmd === "off") {
global.__autoReactStatus[threadID] = false;
return api.sendMessage("โ ๐๐ฎ๐ญ๐จ๐๐๐๐๐ญ ๐๐ข๐ฌ๐๐๐ฅ๐๐", threadID, messageID);
}
else {
const status = global.__autoReactStatus[threadID]? "โ
๐๐" : "โ ๐๐
๐
";
return api.sendMessage(`๐ ๐๐ญ๐๐ญ๐ฎ๐ฌ: ${status}`, threadID, messageID);
}
},
onChat: async function ({ api, event }) {
const { messageID, senderID, threadID } = event;
if (!messageID) return;
if (senderID === api.getCurrentUserID()) return;
global.__autoReactStatus??= {};
if (global.__autoReactStatus[threadID] === undefined)
global.__autoReactStatus[threadID] = false;
if (!global.__autoReactStatus[threadID]) return;
const reacts = [
"โค๏ธ","๐งก","๐","๐","๐","๐","๐ค","๐ค","๐ค","๐ฉท","๐ฉต","๐ฉถ","๐","๐","๐","๐","๐","๐","๐","๐","๐",
"๐ซ","โจ","๐","โญ","๐ฅ","โก","๐ฅ","๐ฏ","๐","๐","๐","๐","๐","๐","๐","๐",
"๐ธ","๐บ","๐ป","๐ท","๐น","๐ผ","๐","๐","๐ฟ","๐พ","๐ฒ","๐ณ","๐ด","๐","๐","๐",
"๐ซถ","๐ซฐ","๐","๐","๐","๐","๐ค","โ๏ธ","๐ค","๐ค","๐ช","๐
","๐","๐ฉโโค๏ธโ๐จ",
"๐","๐","๐","๐","๐","๐","๐ฅญ","๐ฅ","๐","๐","๐","๐","๐","๐","๐","๐ฅฅ",
"๐ฉ","๐ฐ","๐ง","๐ช","๐ซ","๐ญ","๐ฏ","๐ฌ","๐","๐ง","โ","๐ฅ","๐ฆ","๐ง","๐ก","๐ฎ",
"๐ฆ","๐๏ธ","๐ชฝ","๐ผ","๐ฐ","๐ธ","๐ฏ","๐จ","๐ฑ","๐ถ","๐ฆ","๐ง","๐ค","๐ฃ","๐ฅ","๐บ",
"๐ธ","๐ก","โ
","๐","๐","๐","๐ซ","โจ","๐ฅ","โก","๐ฅ","๐ฏ","๐","๐","๐","๐"
];
const react = reacts[Math.floor(Math.random() * reacts.length)];
api.setMessageReaction(react, messageID);
}
};