Skip to content
Sign upLog in
← Back to Community

Bot status

Profile icon
RyanJackson3

So I am currently scripting a discord bot using node.js but I cannot figure out how to make a bot status similar to this
image


I would really appreciate if anyone can tell me how to do this. Thanks!

Voters
Profile icon
NinjaStar
Profile icon
JOLLIBEE1
Profile icon
normaantonen
Profile icon
MrPizza1
Profile icon
norvikplays
Profile icon
VishalBansal4
Profile icon
SteeevenPHAngar
Profile icon
scrie555111555
Profile icon
VampboiiGaming
Profile icon
MinecraftJunky
Comments
hotnewtop
Profile icon
[deleted]

you can use this piece of code here.

client.on("ready", () => { // This event will run if the bot starts, and logs in, successfully. console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`); // Example of changing the bot's playing game to something useful. `client.user` is what the // docs refer to as the "ClientUser". client.user.setActivity(`Serving ${client.guilds.cache.size} servers`); });

In the last line you can put whatever status you want.

Profile icon
retronbv

client.on('ready', () => {
client.user.setPresence({ game: { name: 'with discord.js' }, status: 'idle' })
console.log(${client.user.username} is up and running!);
})

Profile icon
RyanJackson3

@retronbv
So I used the code you gave me. When I ran it it said "client not defined" so I modified the code to this

bot.on('ready', () => { bot.user.setPresence({ WATCHING: { name: '!help' }, status: 'online' }); console.log(`[READY] ${bot.user.tag} has been successfully booted up!`); });

The bot was able to start up but the status didn't show on the bot. Can you help with that?

Profile icon
RyanJackson3

@RyanJackson3
Never mind. I have recently discovered that game is no longer supported.

Profile icon
retronbv

game is still supported i think

Profile icon
RyanJackson3

@retronbv
It is not.

Profile icon
Skwider-RobloxR

it says bot name is not defined

Profile icon
pes-gamergamer

client.on("ready", () => {
// This event will run if the bot starts, and logs in, successfully.
console.log(Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.);
// Example of changing the bot's playing game to something useful. client.user is what the
// docs refer to as the "ClientUser".
client.user.setActivity(Serving ${client.guilds.cache.size} servers);
});

Profile icon
cutieuwu

const discord = require("discord.js");
const client = new discord.Client()
const { prefix, ServerID } = require("./config.json")
const config = require('./config.json');

client.on("ready", () => {

console.log("Bot online") client.user.setActivity("?help", {type: 'WATCHING' }).catch(console.error); });
Profile icon
ryukunbot

/help

Profile icon
cutieuwu