rotating status
const servers = (client.guilds.cache.size)
const members = client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0);
const activities = [
'GTA',
with ${members} users
,
'with AmNobCop',
with ${servers} servers
,
'with NotCaesahr'
];
setInterval(() => {
const status = activities[Math.floor(Math.random() * activities.length)];
client.user.setPresence({ activities: [{name: ${status}
}]});
}, 5000);20 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
now how would i make it so it would set the status to watching if the thing was ${members}
anyone wanna help
5 seconds is way too short of an interval
so i figured out my first question
but how would i make the ${members} update like every 20 mins. cuz rn it just gets the users from startup but then it gets out dated, is there a way to do that?
Fetch the members in the interval
so like the const inside the interval?
Sure, that would work
is there a better way?
What do you mean by "better"?
r u sayin like this?
Yes that would work, but that is also API spam
Ye thats why i was wondering if there is a better way
that wouldnt spam the api
Change the interval to be longer than 10s
Ok
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Like 30 mins
mhm
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
That wouldn't work, timeouts only run once
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View