Recently began writing a bot for Discord and study Discord.js in parallel.
Constantly seeing bots with the status “Plays in / Help” or “Looks at N Servers”
So, how to do it on discord.js 12.2.0 ?!
Answer 1
You can use the setPresence
const discord = require ('discord.js');
Const Client = New discord.client ();
const prefix = '?';
Const Token = Require ('./ token.json'). Token;
client.on ('Ready', () = & gt; {
Console.log (`Bot Is Ready`);
Client.user.SetPresence ({
Status: 'Online',
Activity: {
Type: 'Watching',
Name: '/ Help',
},
});
});
Answer 2
Plays in “/ Help”:
bot.user.setpresence ({
Game: {
Name: `Plays $ {Prefix} Help`
Type: "Playing",
}
});
Looks at N Servers:
bot.user.setpresence ({
Game: {
Name: $ {bot.guilds.cache.size} servers`
Type: "Watching",
}
});
});