Mapler
Mapler

Reputation: 49

Making a JavaScript Discord bot have a "Do not disturb" status

I am making a simple JavaScript Discord bot and I was wondering if it was still possible for my bot to have a "do not disturb status so people know not to dm it back.

bot.once("ready", () => {
  console.log(chalk`{blue CODED BY MAPLER © 2021 :)}`)
  console.log(chalk`{green ✔} Ready to give results!`);
  bot.user.setActivity(config.status.message, { type: playying});
});

Upvotes: 0

Views: 5636

Answers (2)

Alixy Mizuki
Alixy Mizuki

Reputation: 91

Discord.js v12

client.user.setPresence(
    { 
        activity: { 
            name: '?help', 
            type: 'LISTENING' 
        }, 
        status: "idle" // online, idle, invisible, dnd
    }
) 

Discord.js v13

client.user.setPresence(
    { 
        activities: [
            { 
                name: "?help" , 
                type: 'LISTENING' 
            }
        ], 
        status: "idle" // online, idle, invisible, dnd
    }
) 

Upvotes: 1

Links
Links

Reputation: 23

Put

client.user.setStatus('dnd')

In your client.on("ready") place.

This may not be exactly correct because I am doing this off the top of my head, but it should work.

Upvotes: 2

Related Questions