We need to mass demote people due to a bot going rogue in our group, which requires me to create a bot to handle that.
I am currently using the following node.js code to attempt to handle this:
let url = `https://groups.roblox.com/v1/groups/5598688/users/${data.userId}`
await axios.patch(url, { body: { roleId: 36926437,Cookie: ".ROBLOSECURITY=" + token} })
.then(async (res) => {
console.log(`${data.userID} has been demoted!`)
})
.catch(error => {
console.log(error)
})
But every time that runs, it just returns the status code 401 (unauthorized request)
Any and all help will be greatly appreciated