Search code examples
javascriptnode.jsdiscord.jsstatus

How do I make a Discord bot that change status with watching status type?


  const activities_list = [
  "happy holidays!❄️", 
  "happy holidays!🎅",
  "happy holidays!🎄", 
  "happy holidays!⛄"
  ];

   

  bot.on('ready', () => {
      setInterval(() => {
          const index = Math.floor(Math.random() * (activities_list.length - 1) + 1); 
          bot.user.setActivity(activities_list[index]);
      }, 30000); 
    });

But i want to display this in WATCHING status type, how can i do that ?


Solution

  • Start by looking at the Discord.js documentation, that gives a direct example for what you're after:

    client.user.setActivity('YouTube', { type: 'WATCHING' })