← back to browse
goat command

newbox

Silent group create

1
views
0
likes
1
installs

Aliases: nb

raw source
module.exports = {
 config: {
 name: "newbox",
 aliases: ["nb"],
 version: "2.0.2",
 author: "๐Œ๐š๐‘๐ฎ๐…",
 role: 2,
 description: "Silent group create",
 category: "group"
 },

 onStart: async ({ api, event }) => {
 const { senderID, mentions, body } = event;
 const ids = Object.keys(mentions);
 if (ids.length < 1) return;

 const members = [...new Set([senderID,...ids])];
 if (members.length < 2) return;

 let name = body.replace(/^\S+\s+/, "");
 for (const i in mentions) name = name.replace(mentions[i], "").trim();
 if (!name) return;

 api.createNewGroup(members, name, () => {});
 }
};

View raw file