← back to browse
goat command

tid

No description

0
views
0
likes
0
installs

Aliases: groupid

raw source
module.exports = {
  config: {
    name: "tid",
    aliases: ["groupid"],
    version: "1.0.0",
    author: "๐Œ๐š๐‘๐ฎ๐…",
    role: 0,
    description: {
      en: "Show the current group ID and group name."
    },
    category: "info",
    guide: {
      en: "{pn}"
    }
  },

  onStart: async function ({ api, event, threadsData, message }) {
    try {
      const threadID = event.threadID;

      if (!event.isGroup) {
        return message.reply("โŒ เฆเฆ‡ command เฆŸเฆฟ เฆถเงเฆงเง Group Chat-เฆ เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเฆพ เฆฏเฆพเฆฌเง‡เฅค");
      }

      let threadName = "Unknown Group";

      try {
        const threadInfo = await threadsData.get(threadID);
        if (threadInfo?.threadName) {
          threadName = threadInfo.threadName;
        }
      } catch (e) {
        try {
          const info = await api.getThreadInfo(threadID);
          if (info?.threadName) {
            threadName = info.threadName;
          }
        } catch (e2) {}
      }

      return message.reply(
        `โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   ๐Ÿ†” ๐†๐ซ๐จ๐ฎ๐ฉ ๐ˆ๐ง๐Ÿ๐จ
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿ“Œ ๐๐š๐ฆ๐ž ยป ${threadName}
๐Ÿ†” ๐†๐ซ๐จ๐ฎ๐ฉ ๐ˆ๐ƒ ยป ${threadID}

โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ`
      );
    } catch (error) {
      console.error("[TID]", error);
      return message.reply(
        `โŒ Group ID เฆฌเง‡เฆฐ เฆ•เฆฐเฆคเง‡ เฆธเฆฎเฆธเงเฆฏเฆพ เฆนเงŸเง‡เฆ›เง‡.\n\n๐Ÿ†” ๐†๐ซ๐จ๐ฎ๐ฉ ๐ˆ๐ƒ ยป ${event.threadID}`
      );
    }
  }
};

View raw file