yourgrandma
yourgrandma

Reputation: 25

I'm looking to make my discord.js bot invisible

client.user.setStatus('invisible')
client.on('ready',  async() => {
    console.log('I am online and ready to listen to commands!')
})

Does that work? Also I'm looking for a command that will do that like ;status dnd or ;dnd, pretty sure this code won't work:

client.user.setStatus('dnd')

Ok, so I realised that the error is: https://pastebin.com/xtUZy0WW

Upvotes: 0

Views: 2503

Answers (1)

Dinty
Dinty

Reputation: 642

You need to call client.user.setStatus('invisible') within the ready callback, otherwise client.user will be null. Other than that looks good :)

EDIT: looks like this

client.on('ready',  async() => {
    console.log('I am online and ready to listen to commands!')
    client.user.setStatus('invisible')

})

Upvotes: 1

Related Questions