I noticed something in many discord servers recently, the person who is a member of the developer forum is given a special role. I want to tell you exactly, for example, when the person writes
! Toogle devforum, if the developer is a member of the forum, I want him to give him a role,
do you think this can be done in javascript? How to do it?
Its better to look at the JSON data returned, yes you get a 404 if the member isn’t registered, however it will return data if the user is a visitor.
The OP requests to know if the user is able to post on the DevForum (has a trust level >= 1)
In the returned data, you should be looking for the key trust_level, which my case would be 2, for you it’s 1
Anyway, You’re gonna have to use the Roblox API.
You should be able to use some parts of this post. Instead of using HTTP Service, you could use e.g Axios to deal with your HTTP Requests. If you’re going to use Axios, you just gotta make a get request through it. E.g;
const axios = require("axios");
var flag = false
var trust_level = 0;
await axios.get(`https://devforum.roblox.com/u/aIoNeDarK01`)
.then(function (response) {
if (response.data.errors){
flag = true;
}else{
// --user is valid, get trust_level
trust_level = response.data.trust_level
}
}).catch(function (error) {
//-- error
console.log(`Error - ${error} (toggleforum.js)`)
message.channel.send(`**ERROR**\n\`${error}\``)
})
Note this ain’t tested so ya might run into some issues.
There are a lot of discord servers dedicated to programming (including JS). I’ll link one here