// code from goatstore // api: https://store.agi.bd module.exports = { config: { name: "supportgc", version: "1.1", author: "Shikaki", countDown: 5, role: 0, shortDescription: { en: "Join the support group chat" }, longDescription: { en: "Join the official support group chat" }, category: "General", guide: { en: "{pn}" } }, onStart: async function ({ api, event, threadsData, getLang, message }) { const supportGroupThreadID = "8718896788143396"; // Replace with your support group thread ID const botID = api.getCurrentUserID(); try { const { members } = await threadsData.get(supportGroupThreadID); // Check if the user is already a member of the support group const senderName = event.senderName || (await api.getUserInfo(event.senderID))[event.senderID].name; const userAlreadyInGroup = members.some( member => member.userID === event.senderID && member.inGroup ); if (userAlreadyInGroup) { // Reply with a message indicating that the user is already in the group const alreadyInGroupMessage = ` đŸšĢ āφāĻĒāύāĻŋ āχāϤāĻŋāĻŽāĻ§ā§āϝ⧇āχ SupportGc āĻ—ā§āϰ⧁āĻĒ⧇āϰ āϏāĻĻāĻ¸ā§āϝđŸšĢ ------------------------ `; return message.reply(alreadyInGroupMessage); } // Add the user to the support group await api.addUserToGroup(event.senderID, supportGroupThreadID); // Reply with a message indicating successful addition const successMessage = ` 🎉 āφāĻĒāύāĻžāϕ⧇ āϏāĻĢāϞāĻ­āĻžāĻŦ⧇ SupportGc āϤ⧇ āϝ⧁āĻ•ā§āϤ āĻ•āϰāĻž āĻšāϝāĻŧ⧇āϛ⧇ 🎉 ------------------------ `; return message.reply(successMessage); } catch (error) { // Handle any errors that occur during the process // Reply with a message indicating the failure const senderName = event.senderName || (await api.getUserInfo(event.senderID))[event.senderID].name; const failedMessage = ` ❌ āφāĻĒāύāĻžāϕ⧇ SopportGc āϤ⧇ āĻāĻĄ āĻ•āϰāϤ⧇ āĻŦā§āϝāĻ°ā§āĻĨ āĻšāϝāĻŧ⧇āĻ›āĻŋ😞āĨ¤āφāĻĒāύāĻŋ āφāĻŽāĻžāϝāĻŧ āĻĢā§āϰ⧇āĻ¨ā§āĻĄ āϰāĻŋāϕ⧋āϝāĻŧ⧇āĻ¸ā§āϟ āĻĒāĻžāĻ āĻžāύ āĻ…āĻĨāĻŦāĻž āφāĻĒāύāĻžāϰ āĻĒā§āϰ⧋āĻĢāĻžāχāϞ āφāύāϞāĻ• āĻ•āϰ⧁āύ āĻāĻŦāĻ‚ āφāĻŦāĻžāϰ āĻšā§‡āĻˇā§āϟāĻž āĻ•āϰ⧁āύ ❌ ------------------------ `; console.error("Error adding user to support group:", error); return message.reply(failedMessage); } } };