const fs = require('fs');
const path = require('path');
const { WebhookClient } = require('[Link]-selfbot-v13');
const Config = require("../../Config/[Link]");
const Settings = require("../../Config/[Link]");
[Link] = {
name: 'afk',
description: 'Toggle AFK mode',
category: 'General',
execute(message, args, client) {
const configPath = [Link](__dirname, '..', 'Config', '[Link]');
// Toggle AFK status
[Link] = ![Link];
// Save updated config
[Link](configPath, [Link](Config, null, 2));
[Link](`AFK mode has been ${[Link] ?
'enabled' : 'disabled'}.`);
},
init(client) {
[Link]('messageCreate', handle);
}
};
async function handle(message) {
// Reload config on each message to get latest settings
const Config = [Link]([Link]([Link](__dirname, '..', '..',
'Config', '[Link]')));
if (![Link]) return;
// Check if mention or DM
if ([Link] === 'DM' ||
[Link]([Link])) {
if ([Link] === [Link]) return; // Don't reply to
self
if ([Link]('@everyone') ||
[Link]('@here')) return; // Exclude everyone and here
// Get random AFK message from config
const randomKeyword = [Link][
[Link]([Link]() * [Link])
];
await [Link](`${randomKeyword}`);
try {
const webhookClient = new WebhookClient({ url: [Link] });
await [Link]({
content: `@everyone AFK Logs (Type: ${[Link] === 'DM'
? 'DM' : [Link]})\n\`\`\`\nUser: ${[Link]}\nMessage: $
{[Link]}\nResponse: ${randomKeyword}\`\`\``
});
} catch (error) {
//[Link]('Failed to send webhook:', error);
}
}
}