Member Count bot!

Hey, Developers!
So I was wondering, today, how groups do this in their Communications Server, which says a certain sentence when someone joins the group. It’d be awesome if you can provide details & instructions.

I wouldn’t recommend doing this if you’re planning on getting a high member count.

See: Discord Integration: A guide on using Discord through Roblox [UPDATED]

They probably use the Groups API to get the member count every minute or so and send the message if any change. You can program the bot in Python (discord.py), JS (discord.js) or Lua (Discordia).

As @demofocus stated, it’s not a too good idea to be logging this on Discord if the group is highly active.

2 Likes

You can make a discord bot using Javascript and a discord webhook. Using the webhook you will be able to make messages!

If someone can do it, please DM me on Sum’s!#0001

This category isn’t for asking people to make scripts, discord bots etc. Please make a topic in #collaboration:recruitment if you’d like to hire someone for work.

1 Like

Hello, I know you already found a solution but, there is a website that will do it for free…
https://campfirehq.net/members

3 Likes

[EDIT: THIS WILL NOT WORK DUE TO DISCORD HAS UPGRADED THEIR VERSION TO V13.]

Well, you’ll need a discord bot. To do this, you can simply do:

const discord = require('discord.js')
const client = new Client({
disableEveryone: true
})

client.login('YOUR BOT TOKEN HERE')

That’s basic thing you need to do. Also you will need to install Visual Studio Code and node.js for this. Or, you can use repl for free hosting. You can see how to host on youtube. Anyways, let’s get back into the topic. Now, after you have that, you want to get the bot token by going to the Discord Developer Portal. Go to Applications, create new applications, bot, add bot, copy token and paste the token on the client.login(‘’).

Next, you want to add the code. If you want to use a webhook, create a webook on the channel. Then add this code on the top.

const axios = require('axios');
let GROUP_ID = 
let GOAL = 
let count = 0
let wid = "" \\ The webhookID.
let wtoken = "" \ The webhook token.
let webhook = new discord.WebhookClient(wid, wtoken)

So, just fill that up. Group ID is the groupID of your group, obviosuly. Count just stays at 0. You can get the webhookokID by copy the webhook and paste it on any channel. The number part of the link is the id of the webook. The token can be found next to the id. Once you’ve done that, you can paste this code.

async function updateCount() {
let response = await axios.get(`https://groups.roblox.com/v1/groups/${GROUP_ID}/`)
let response_count = response.data.memberCount 
console.log("got request")
if (count < response_count) {
    console.log(response_count, count) 
webhook.send(`:tada: We're now at ${response_count} members in our group! Only ${GOAL - response_count} to go until ${GOAL}!`)      
   
  if (count == 0) {
            count = response_count
            return;
        }
        count = response_count
    }
    }

setInterval(() => {

  updateCount()
}, 60000);

There you go! Your member count has been setup! Also, it will send the message event if its the same amount of members due to the roblox api. But, it still works properly. Enjoy! I’ll just paste all of it here just to not make you confuse about it.

const discord = require('discord.js')
const client = new Client({
disableEveryone: true
})
    const axios = require('axios');
let GROUP_ID = 
let GOAL = 
let count = 0
let wid = "" \\ The webhookID.
let wtoken = "" \ The webhook token.
let webhook = new discord.WebhookClient(wid, wtoken)

  async function updateCount() {
let response = await axios.get(`https://groups.roblox.com/v1/groups/${GROUP_ID}/`)
let response_count = response.data.memberCount 
console.log("got request")
if (count < response_count) {
    console.log(response_count, count) 
webhook.send(`:tada: We're now at ${response_count} members in our group! Only ${GOAL - response_count} to go until ${GOAL}!`)      
   
  if (count == 0) {
            count = response_count
            return;
        }
        count = response_count
    }
    }

setInterval(() => {

  updateCount()
}, 60000);

client.login('YOUR BOT TOKEN HERE')

If you have any question, feel free to DM me at clloudy.js#0074. Enjoy!

2 Likes