module.exports = { config: { name: "listbox", aliases: ["boxlist"], author: "HR ID OY", version: "2.0", cooldowns: 5, role: 0, shortDescription: { en: "List all group chats the bot is in." }, longDescription: { en: "Use this command to list all group chats the bot is currently in." }, category: "Admin", guide: { en: "{p}{n} " } }, onStart: async function ({ api, event }) { try { const groupList = await api.getThreadList(100, null, ['INBOX']); const filteredList = groupList.filter(group => group.threadName !== null); if (filteredList.length === 0) { await api.sendMessage('No group chats found.', event.threadID); } else { const formattedList = filteredList.map((group, index) => `ā”‚šŸ‚${index + 1}. ${group.threadName}\nā”‚āž„š“šˆšƒ: ${group.threadID}\n` ); const message = `╭─╮\nā”‚š‹š¢š¬š­ šØšŸ š š«šØš®š© šœš”ššš­š¬:\n${formattedList.map(line => `${line}`).join("\n")}\n╰───────────ꔪ`; await api.sendMessage(message, event.threadID, event.messageID); } } catch (error) { console.error("Error listing group chats", error); } }, };