由于问题,我们需要大规模的去排名很多人,但当试图通过Roblox的组API发出请求时,它返回401(未经授权的请求)
我很确定令牌是有效的,机器人也有权限去破坏它们。代码在下面。
const token = "TOKEN WOULD GO HERE BUT NOT SHOWN"
const axios = require('axios')
const noblox = require('noblox.js')
const rolesetID = 36926359
const groupId = 5598688
const url = `https://groups.roblox.com/v1/groups/5598688/roles/${rolesetID}/users?limit=100`
let userCount = 0
for (let i = 0; i < 1000; i++) {
axios.get(`${url}`)
.then(async function (response) {
response.data.data.forEach(async data => {
if(data.username == 'lickty123') {
} else {
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)
})
}
});
// userCount = userCount + 100
// console.log(`${userCount} people have been demoted`)
})
wait(1)
}
任何帮助都很感激。
1条答案
按热度按时间2izufjch1#
您必须将Cookie字段放在头中,而不是正文中
您还必须在头中包含x-csrf-token,这可以通过noblox通过
noblox.getGeneralToken()
实现