Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0125· OpenAIAi2 WildChat-4.8M (AI2)

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

    You can make your bot on discord.js have a custom status by using the client.user.setActivity() method. Here's an example code snippet that demonstrates how to set a custom status for your bot:

    const Discord = require('discord.js');
    const client = new Discord.Client();
    
    client.on('ready', () => {
        console.log('Bot is online!');
    
        client.user.setActivity('Hello, world!', { type: 'PLAYING' });
    });
    
    client.login('YOUR_BOT_TOKEN');
    

    In this code snippet, the client.user.setActivity() method is used to set a custom status for the bot. You can customize the status message (e.g., 'Hello, world!') and the status type (e.g., 'PLAYING', 'WATCHING', 'LISTENING', 'STREAMING') as needed.

    Remember to replace YOUR_BOT_TOKEN with your actual bot token before running the code.

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