goat
command
activestatus
Set your active status on/off on Facebook
0
views
0
likes
0
installs
Aliases: active, onlinestatus
raw source
const { getPrefix } = global.utils;
module.exports = {
config: {
name: "activestatus",
aliases: ["active", "onlinestatus"],
version: "2.4.73",
author: "Sheikh Tamim",
countDown: 3,
role: 2,
description: "Set your active status on/off on Facebook",
category: "owner",
guide: {
en: "{pn} on - Turn on active status\n{pn} off - Turn off active status\n{pn} status - Check current status"
}
},
ST: async function ({ message, args, api, event }) {
const action = args[0];
if (!action) {
return message.reply(`๐ฑ Active Status Commands:\n\nโข ${getPrefix(event.threadID)}activestatus on - Turn on active status\nโข ${getPrefix(event.threadID)}activestatus off - Turn off active status\nโข ${getPrefix(event.threadID)}activestatus status - Check current status`);
}
try {
switch (action.toLowerCase()) {
case "on": {
const result = await new Promise((resolve, reject) => {
api.setActiveStatus(true, (err, data) => {
if (err) reject(err);
else resolve(data);
});
});
return message.reply("โ
Active status turned ON");
}
case "off": {
const result = await new Promise((resolve, reject) => {
api.setActiveStatus(false, (err, data) => {
if (err) reject(err);
else resolve(data);
});
});
return message.reply("โ
Active status turned OFF");
}
case "status": {
return message.reply(`๐ฑ Active Status Info:\n\n๐ Use "on" or "off" to change your active status\n\nโข ON: Friends can see when you're active\nโข OFF: You appear offline to friends\n\nNote: This affects your visibility across Facebook Messenger.`);
}
default:
return message.reply("โ Invalid action! Use: on, off, or status");
}
} catch (error) {
console.error("Active Status Error:", error);
return message.reply("โ An error occurred while setting active status. Please try again later.");
}
}
};