Note: I am learning JavaScript so I may not be as competent with it as I would be with lua for example.
I am trying to find out how to find a specific user’s role in a Roblox Group via their UserId in node.js. Can anyone help me with how I would go about doing this? I have had a look and I can’t seem to find anything of any help. What I need is the ability to input a UserId, and the function to return a boolean value of:
If the user is in the group
If the user is of a specific role.
Any help is appreciated! Sorry for the awful layout of this post!
const https = require(`https`)
const userId = 39939779,
groupId = 8535436
https.get(`https://groups.roblox.com/v2/users/${userId}/groups/roles`, resp => {
let data = ``
resp.on(`data`, chunk => data += chunk)
resp.on(`end`, () => {
const groups = JSON.parse(data).data
let role
for (const info of groups) {
if (info.group.id == groupId) {
role = info.role
break
}
}
console.log(role)
})
})