How To Add A Status To My Discord Bot

So I’m new to glitch. I have seen other bots where they have ‘Listening To Something here’ How do you code that? Btw quick question. I can’t seem to find the code where I can change the prefix.

To set the bots status, do something like this
client.user.setPresence({ activity: { name: "something cool", type: "WATCHING" }})

If you want help with the prefix, you’ll have to share how it’s currently setup.

Thanks for the help @Ghostoblivion . It came up client not defined. So I added
const Discord = require('discord.js'); const client = new Discord.Client();
It seemed to fix the error but the status is not showing up in discord.

Same With me need help @Ghostoblivion

Did you check the documentation? As far as I can tell there is a mix of syntaxes in that example.

.setPresence seems to want a status: not a type: parameter

use .setActivity instead of .setPresence

Or use the proper syntax for setPresence

hello with discord.js you would do client.user.setActivity("a cool game")

Remember do not redefine a new client you will get many errors doing so

1 Like
1 Like