I have this script currently:
function check() {
membercounter.find((err, documents) => {
if (err) return console.log(err)
documents.forEach(async (doc, i) => {
setTimeout(async function() {
let response = await axios.get(`https://groups.roblox.com/v1/groups/${doc.groupid}/`)
let response_count = response.data.memberCount
if (doc.currentCount === null) {
membercounter.findOneAndUpdate({ groupid: response.data.id }, { currentCount: response_count }, function(err, doc, res) {
})
return
}
if (doc.currentCount < response_count || doc.currentCount > response_count) {
await axios.post(doc.webhook, { content: ... })
if (doc.currentCount === 0) {
membercounter.findOneAndUpdate({ groupid: response.data.id }, { currentCount: response_count }, function(err, doc, res) {
})
return;
}
membercounter.findOneAndUpdate({ groupid: response.data.id }, { currentCount: response_count }, function(err, doc, res) {
})
}
}, 5000 * i)
})
})
}
setInterval(check, 120000)
I’ll explain it –
I’m making a member counter script where it gets the group id, webhook, etc from a MongoDB database using Mongoose. The script should technically work, except I’m getting ratelimited by Roblox, despite having protections in place (2 minute cooldown for checking, takes 5 seconds * index for the web request) yet I still get ratelimited. Is this a code issue, or something with Roblox?
Any help is appreciated.
Thanks!