Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· openaiHugging Face Suzhen/CodeChat

how can i make my bot on discord.js have a custom status?

  1. User

    how can i make my bot on discord.js have a custom status?

  2. Assistant

    To set a custom status for your Discord bot using discord.js, you can use the ActivityOptions and Client#user#setPresence methods. Here's an example of how you can achieve this:

    const Discord = require('discord.js');
    
    const client = new Discord.Client();
    
    client.once('ready', () => {
        console.log('Bot is ready!');
        
        // Set custom status
        client.user.setPresence({
            activity: {
                name: 'with cool features',
                type: 'PLAYING', // You can use 'WATCHING', 'LISTENING', 'STREAMING', 'PLAYING'
            },
            status: 'online', // You can use 'online', 'idle', 'dnd', or 'invisible'
        });
    });
    
    client.login('YOUR_BOT_TOKEN');
    

    In this example, the bot will be displayed as "Playing with cool features" in its custom status. You can modify the name and type values to customize it further. Additionally, the status field can be set to determine the online status of your bot.

    Remember to replace 'YOUR_BOT_TOKEN' with your actual Discord bot token obtained from the Discord Developer Portal.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.