I want to try it too, could you put it in steps?
I found another way you can use for group member count with Campfire. They offer free services for group member count and shout proxy webhooks for discord! Just go on products at the menu on the top. They offer really good services. https://campfirehq.net/
I dont think trusting a site with a webhook is ideal especially with cookies etc (looked briefly at there other stuff). It is quite easy to do this yourself aswell. Did this in abt 10 mins.
const axios = require('axios');
const discord = require("discord.js")
let GROUP_ID = 0
let GOAL = 100000
let count = 150
let wid = ""
let wtoken = ""
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)
const embed = new discord.RichEmbed()
.setTitle("New Group Member")
.setDescription(`${response.data.name} | We are at ${response_count} members. Only ${GOAL - response_count} members to go till ${GOAL}!`)
.setFooter("Bot made by: HmmBilly")
webhook.send(embed)
if (count == 0) {
count = response_count
return;
}
count = response_count
}
}
setInterval(() => {
updateCount()
}, 600000); ```
We don’t take cookies ever? It’s a webhook and an API.
Yeah I was going to reply with the same, I have never known the site to take a Roblox Account cookie.
Tried this out and it works, thank you!
Is this a webhook or a bot? Should I host it as a bot?
That is not what that is. The code was hand made. Don’t assume because it is alike.
Yeah I know, it sucks! I’m pretty sure they did this because they want to focus their website on discord bots, not webhooks.
Easiest way, make a loop run every 1 minute in a repl.it. Web scrape your groups membercount, mainly use snekfetch for that. I used this to gather a group shout.
const rbxapi = "https://groups.roblox.com/v1/groups/5627994";
const snekfetch = require("snekfetch");
module.exports = {
name: 'getshout',
description: 'Ping!',
async execute(message, args) {
snekfetch.get(rbxapi).then(r => {
let body = r.body;
if (message.member.roles.cache.has('797513239545249822')) {
message.reply(`This is what I fetched. ${body.shout.body}`);
};
});
},
};
With that loop, check if the last member count is different to the new member count gathered, if it is then you use the code below to send the function.
const guild = client.guilds.cache.get('your server id');
const channel = guild.channels.cache.get('logging channel id that bot can talk in');
channel.send(`We are currently at ${newmembernum}`);
I made an easy way, follow this.
Tbh, I haven’t checked if it works, if it doesn’t play around with it until it does. The hard work is done, just make it loop around now.
as @Rare_tendo said this is what i learn
javascript:
const fetch = require('node-fetch')
async function getMembers(id) {
// -- i wonder why "docs"
var url = `https://groups.roblox.com/docs#!/Groups/${id}`
fetch(url).then(res => res.json()).then(tbl => {
return tbl.memberCount
})
}
console.log(getMembers(123))
The best way to fix this issue is the use the modulus operator!
You can use the modulus operator to make it send to the webhook every 10 members or a similar value.
In lua you’d do it like this:
memberCount.Changed:Connect(function()
if memberCount.Value % 10 == 0 then
webhook:Send()
end
end)
This is not the actual link you would sent a request to. The page serves as a documentation of the API endpoint, not the actual API endpoint. The structure of the url to send a request to is always https://[subdomain].roblox.com/[path]
. The subdomain is in the URL and precedes the domain, roblox.com
, in the url which in this case, the subdomain is groups
.
The v1/groups/{groupId}
specifies the path of the URL where you replace {groupId}
with the ID of your group.
So, the general URL for sending http requests to this endpoint is https://groups.roblox.com/v1/groups/{groupId}
. An example URL has been provided in the same post I made
So, the line defining the url
variable should be:
var url = `https://groups.roblox.com/v1/groups/${id}`
https://lightningbot.net is just what you’re looking for!
Lightning products include free member counters which relay new group members straight to your discord server with intervals of less than a minute. You can customise the message style and set the goal to whatever you like. Groups like Bakiez use Lightning.
“We’re at 9,153 group members, 847 to go until 10,000”
What would I put for the wtoken?
wtoken = Webhook Token which you can find my going into discord and then a channel’s settings which then you go to integration and then create one via there.
The following API endpoint can be used to fetch a group’s total member count.
https://groups.roblox.com/docs#!/Groups/get_v1_groups_groupId
This can then be dispatched to Discord through a webhook and displayed accordingly.
Here’s a script I wrote which retrieves a group’s member count.
local http = game:GetService("HttpService")
local get = http.GetAsync
local jsonDecode = http.JSONDecode
local proxyUrl = "roproxy.com" --Change this to your proxy's domain.
local baseUrl = "https://groups."..proxyUrl.."/v1/groups/%d"
local function getGroupsMemberCount(groupId)
local requestUrl = string.format(baseUrl, groupId)
local success, result = pcall(get, http, requestUrl)
if success then
if result then
local success2, result2 = pcall(jsonDecode, http, result)
if success2 then
if result2 then
return result2.memberCount
end
else
warn(result2)
end
end
else
warn(result)
end
end
local memberCount = getGroupsMemberCount(1)
print(memberCount) --35576