Discord Group Member Counter [BOT & WEBHOOK VERSION]

Hiya, I’ve made a fully customisable live Group Member Counter that updates how many new members there are to Discord. I have seen a few of these but usually they’re either paid (???) or done by a website service, which usually has a silly watermark or something in a footer of an embed.

This isn’t perfect, and probably isn’t as good as other ones, but it’s open sourced and can be hosted by yourself.

You can find everything here, including how to set it up and how to configure it to your liking.

Thank you for reading and I hope you find my resource useful, I have some updates in mind but I’m not going to bother if people don’t need this, so please let me know if you’d like updates by just liking this post or commenting your feedback.

6 Likes

Update 1

  • Changed suggested & default cooldown time to 10 seconds
  • Better error handling, the code will now check why it’s errored and act appropriately rather than terminating the code (unless something’s gone terribly wrong).
  • If you get rate limited, the code will now warn you and pause the code for 1 minute then resume.

Get the new update


I’d also like to add that I am currently working on a Discord Bot version for this, as I know some developers may have an existing Discord Bot they’d like to use for this.

Discord Bot Version

I’ve made a discord bot version of this, just in case anyone would prefer to have it as a bot rather than a webhook!

It follows the same rules as the webhook version, however this time you need to specify a few more configurations such as the bot token, the server id, and the channel id.

Thank you!

Download Bot Version

bot version dont exist???

Oh sorry it was private, try again now.

1 Like

This is really good It’s been so hard to find these.

I have a question though are you having a tough time keeping this up like does this go down? because I used something like this before but the webhook went down and never went up again.

Did you mean the bot? You need some kind of server to keep it running 24/7, otherwise, it will go down. Something like UptimeRobot will do :wink:

it’s still the same for almost half a year :confused:

image

So what I understand from that picture is that bot is down and abandoned?

1 Like

yes it is down, GitHub will put this up if you go to an invalid or private repository

1 Like

Hey sorry I completely forgot about this project!

This is what I’m currently using in my Discord server, it’s pretty much the same code as this but just tweaked a bit:

var currentMembers = null;
const url = "https://groups.roblox.com/v1/groups/16592351";

async function post(client) {
  var request;

  try {
    request = await axios({
      method: "get",
      url: url,
    });
  } catch (error) {
    console.error(error);
    return;
  }

  const data = request["data"];
  const members = data["memberCount"];

  if (currentMembers == null) {
    currentMembers = members;
  } else {
    const diff = members - currentMembers;
    currentMembers = members;
    var content;

    if (diff !== 0) {
      if (diff > 0) {
        var p = "";
        if (diff !== 1) {
          p = "s";
        }

        content = `⭐ We have gained ${diff} new member${p}! (Goal: **${formatCommas(
          currentMembers
        )}/${formatCommas(getMemberGoal(currentMembers))} members**)`;
      } else if (diff < 0) {
        var p = "";
        if (Math.abs(diff) !== 1) {
          p = "s";
        }

        content = `😭 We have lost ${
          diff * -1
        } member${p}. (Goal: **${formatCommas(currentMembers)}/${formatCommas(
          getMemberGoal(currentMembers)
        )} members**)`;
      }

      const server = client.guilds.cache.get("932320416989610065");
      const channel = server.channels.cache.get("1086185631836803083");

      await channel.send({
        content: content,
      });
    }
  }
}

This is for my Discord bot, and it runs this post function every 15 seconds. The client parameter is a Client. Obviously change the server and channel constants with your guild & channel id. And change the number at the end of the url constant to your group id.