← back to browse
mirai command

antileave

No description

0
views
0
likes
0
installs
raw source
const { getTime } = global.utils;

module.exports = {
  config: {
    name: "antileave",
    version: "2.5",
    author: "EryXenX",
    category: "events"
  },

  onStart: async ({ api, event, usersData, message }) => {
    if (event.logMessageType !== "log:unsubscribe") return;

    const { threadID, logMessageData, author } = event;
    const leftID = logMessageData.leftParticipantFbId;

    if (leftID === author) {
      const userName = await usersData.getName(leftID);

      const boldMap = {
        A: "๐—”", B: "๐—•", C: "๐—–", D: "๐——", E: "๐—˜", F: "๐—™", G: "๐—š", H: "๐—›", I: "๐—œ", J: "๐—",
        K: "๐—ž", L: "๐—Ÿ", M: "๐— ", N: "๐—ก", O: "๐—ข", P: "๐—ฃ", Q: "๐—ค", R: "๐—ฅ", S: "๐—ฆ", T: "๐—ง",
        U: "๐—จ", V: "๐—ฉ", W: "๐—ช", X: "๐—ซ", Y: "๐—ฌ", Z: "๐—ญ",
        a: "๐—ฎ", b: "๐—ฏ", c: "๐—ฐ", d: "๐—ฑ", e: "๐—ฒ", f: "๐—ณ", g: "๐—ด", h: "๐—ต", i: "๐—ถ", j: "๐—ท",
        k: "๐—ธ", l: "๐—น", m: "๐—บ", n: "๐—ป", o: "๐—ผ", p: "๐—ฝ", q: "๐—พ", r: "๐—ฟ", s: "๐˜€", t: "๐˜",
        u: "๐˜‚", v: "๐˜ƒ", w: "๐˜„", x: "๐˜…", y: "๐˜†", z: "๐˜‡"
      };

      const boldName = userName.split("").map(c => boldMap[c] || c).join("");

      const form = {
        body: `๐Ÿ˜น ${boldName} tried to leave...  

๐Ÿšซ Not allowed here!  
๐Ÿ”„ Added back ๐Ÿ˜‡`
      };

      try {
        await api.addUserToGroup(leftID, threadID);
        await message.send(form);
      } catch (err) {}
    }
  }
};

View raw file