goat
command
autoseen
Auto Seen
0
views
0
likes
0
installs
raw source
const fs = require("fs-extra");
const path = __dirname + "/cache/autoseen.json";
// Default ON
if (!fs.existsSync(path)) {
fs.writeFileSync(path, JSON.stringify({ status: true }, null, 2));
}
module.exports = {
config: {
name: "autoseen",
version: "3.1.0",
author: "๐๐๐๐ฎ๐
",
role: 0,
countDown: 0,
category: "system",
shortDescription: "Auto Seen",
longDescription: "Auto seen on/off korbe"
},
onStart: async function ({ api, event, args }) {
const { threadID, messageID } = event;
const data = JSON.parse(fs.readFileSync(path));
if (args[0] === "on") {
data.status = true;
fs.writeFileSync(path, JSON.stringify(data, null, 2));
return api.sendMessage("โ
๐๐ฎ๐ญ๐จ๐๐๐๐ง : ๐๐", threadID, messageID);
}
else if (args[0] === "off") {
data.status = false;
fs.writeFileSync(path, JSON.stringify(data, null, 2));
return api.sendMessage("โ ๐๐ฎ๐ญ๐จ๐๐๐ง : ๐๐
๐
", threadID, messageID);
}
else {
return api.sendMessage("โ ๏ธ ๐๐ฌ๐ : autoseen on / off", threadID, messageID);
}
},
onChat: async function ({ api, event }) {
try {
const data = JSON.parse(fs.readFileSync(path));
if (data.status === true) {
api.markAsReadAll();
}
} catch (e) {}
},
};