1<client>.guilds.cache.reduce((a, g) => a + g.memberCount, 0)
2
3// The client is the bot itself.
4// You would have defined this at the top of your index.js/app.js
5// It would look like 'const client = new Discord.Client()'
6// Put that in place for '<client>' and remove the <>
1// Set the bot's "Playing: " status (must be in an event!)
2client.on("ready", () => {
3 client.user.setActivity("my code", { type: "WATCHING"})
4})
5// Set the bot's online/idle/dnd/invisible status
6client.on("ready", () => {
7 client.user.setStatus("online");
8});
9// Set the bot's presence (activity and status)
10client.on("ready", () => {
11 client.user.setPresence({
12 game: {
13 name: 'my code',
14 type: 'WATCHING'
15 },
16 status: 'idle'
17 })
18})