I want to take the Member count and put in inside my precence so people can see it in the activity
my current code:
module.exports = {
name: 'ready',
once: true,
async execute(client) {
setInterval(() => {
let membersCount = client.guilds.cache.map(guild => guild.memberCount).reduce((a, b) => a + b, 0)
}, 1000 * 60 * 5);
const options = [
{
type: ActivityType.Playing,
text: `mit [${membersCount} usern]`,
status: "online"
}
];
await client.user.setPrecence({
activities: [{
name: [options].text,
type: [options].type
},
],
status: [options].status
}).catch(console.error);
}
}```
Error: membersCount is not defined-
I'm not even sure if this whole code is right..
Additional Information: Changes and deletions - ClientUser
