// code from goatstore // api: https://store.agi.bd module.exports = { config: { name: "setallnick", version: "1.0", author: "—͞𝐏ʀɪᴍᴇ́", countDown: 5, role: 2, shortDescription: "Change bot nick in all groups", longDescription: "Change bot nickname in all groups where bot is joined", category: "admin", guide: "{pn} " }, onStart: async function ({ api, event, args }) { if (!args[0]) return api.sendMessage("Use: setallnick ", event.threadID); const nick = args.join(" "); const botID = api.getCurrentUserID(); const list = await api.getThreadList(100, null, ["INBOX"]); const groups = list.filter(g => g.isGroup); for (let g of groups) { try { await api.changeNickname(nick, g.threadID, botID); } catch {} } api.sendMessage(`Done - Changed in ${groups.length} groups to ${nick}`, event.threadID); } };