← back to browse
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.");
        }
    }
};

View raw file