// code from goatstore // api: https://store.agi.bd module.exports = { config: { name: "everyone", version: "1.0.5", author: "Robiul", countDown: 15, role: 1, // 1 = Admin only, 0 = Everyone shortDescription: "Mention each member one by one", longDescription: "This command tags every member in the group individually with a custom message.", category: "group", guide: "{pn} [your message]" }, onStart: async function ({ api, event, args, threadsData }) { try { const { threadID, messageID, senderID } = event; const threadInfo = await api.getThreadInfo(threadID); const { participantIDs, userInfo } = threadInfo; // Filter out the bot itself const listMembers = participantIDs.filter(id => id != api.getCurrentUserID()); let inputMessage = args.join(" ") || "Hi everyone, please check this message!"; let body = `📣 Notification: ${inputMessage}\n\n`; let mentions = []; for (let id of listMembers) { // Get name of the user from userInfo if available const name = (await api.getUserInfo(id))[id].name; const tag = `@${name} `; mentions.push({ id: id, tag: tag, fromIndex: body.length }); body += tag; } return api.sendMessage({ body, mentions }, threadID, messageID); } catch (e) { console.error(e); return api.sendMessage("An error occurred while trying to mention everyone.", event.threadID); } } };