I'm developing a bot where at a set interval, like every hour the bot will pick a random user and remove a role from them, it will be using the positioning on the side to do this. The problem was I couldn't really find a function in Discord.JS that had a property for a guild member's position on the side.
I've tried finding other bots that do this and try to mimic them, but I didn't find anything. I double checked the documentation but didn't find anything.
var thatguild = message.guild.id.find(`576463944298790929`);
thatguild.fetchMembers();
setInterval(function() {
let sizes = thatguild[Math.floor(Math.random() * thatguild.members.size())];
if(thatguild.member.id == `userid1` || `userid2`)
return(thatguild.member.removeRole('roleid'))
}, 1000)
I expect a bot where it randomly picks a user by the position, and remove a role from the member. What I actually get is code and no way of knowing if it works or not.