module.exports = { config: { name: "supportgc", aliases: ["support", "gc"], version: "0.0.8", author: "Azadx69x", countDown: 5, role: 0, shortDescription: { en: "Add user to support group", }, longDescription: { en: "Adds the user to the admin support group, notifies everyone, and uses fancy.", }, category: "supportgc", guide: { en: "Type )supportgc to join the support group", }, }, onStart: async function ({ api, event }) { try { const supportGroupId = "1229038958739377"; const commandThreadID = event.threadID; const userID = event.senderID; const userInfo = await api.getUserInfo(userID); const userName = userInfo[userID].name; const threadInfo = await api.getThreadInfo(supportGroupId); const participantIDs = threadInfo.participantIDs; if (participantIDs.includes(userID)) { return api.sendMessage( ` โ•ญโ”€โ– โ”‚ ๐Ÿ’Œ ๐’๐”๐๐๐Ž๐‘๐“ ๐†๐‘๐Ž๐”๐ โ”œโ”€โ€ข โ”‚ ๐Ÿค– ๐แดแด›ษชแด„แด‡: ๐”sแด‡ส€ ๐€สŸส€แด‡แด€แด…ส ๐€แด…แด…แด‡แด…! โ”‚ ๐Ÿ‘ค ๐๐š๐ฆ๐ž: ${userName} โ”‚ ๐Ÿ“ฉ ๐‚สœแด‡แด„แด‹ ๐ฌแด˜แด€แด ๐จส€ ๐ฆ๐žssage requests โ•ฐโ”€โ– `, commandThreadID ); } api.addUserToGroup(userID, supportGroupId, (err) => { if (err) { return api.sendMessage( ` โ•ญโ”€โ– โ”‚ โš ๏ธ ๐€แด…แดษชษด ๐’แดœแด˜แด˜แดส€แด› ๐†๐‘๐Ž๐”๐ โ”œโ”€โ€ข โ”‚ โŒ ๐„ส€ส€แดส€: Unable to add user โ”‚ ๐Ÿ‘ค ๐๐š๐ฆ๐ž: ${userName} โ”‚ ๐Ÿ†” ๐”sแด‡ส€ ID: ${userID} โ”‚ โ— Account might be private or message requests blocked โ•ฐโ”€โ– `, commandThreadID ); } api.sendMessage( ` โ•ญโ”€โ– โ”‚ โœ… ๐€แด…แด… ๐’แดœแด„แด„แด‡ss โ”œโ”€โ€ข โ”‚ ๐Ÿ‘ค ๐๐š๐ฆ๐ž: ${userName} โ”‚ ๐Ÿ†” ๐”sแด‡ส€ ID: ${userID} โ”‚ ๐ŸŽ‰ ๐แดแดก ๐€แด…แด…แด‡แด… ๐’แดœแด„แด„แด‡ssา“แดœสŸ ๐’แดœแด˜แด˜แดส€แด› ๐†๐ซ๐จแดœแด˜! โ•ฐโ”€โ– `, commandThreadID ); const notificationMessage = ` โ•ญโ”€โ– โ”‚ ๐Ÿ’Œ ๐€แด…แดษชษด ๐’แดœแด˜แด˜แดส€แด› ๐†๐‘๐Ž๐”๐ โ”œโ”€โ€ข โ”‚ ๐Ÿ‘ค ๐แด‡แดก ๐”sแด‡ส€ ๐€แด…แด…แด‡แด… โ”‚ ๐Ÿ‘ค ๐๐š๐ฆ๐ž: ${userName} โ”‚ ๐Ÿ†” ๐”sแด‡ส€ ID: ${userID} โ”‚ โœ… ๐‚สœแด‡แด„แด‹ ๐ขษด ๐’แดœแด˜แด˜แดส€แด› ๐†๐ซ๐จแดœแด˜ โ•ฐโ”€โ– `; api.sendMessage(notificationMessage, supportGroupId); }); } catch (err) { console.error("[SUPPORTGC CMD ERROR]", err); api.sendMessage( ` โ•ญโ”€โ– โ”‚ โŒ ๐„ส€ส€แดส€ โ”œโ”€โ€ข โ”‚ Failed to process support group add โ•ฐโ”€โ– `, event.threadID, event.messageID ); } }, };