我如何制作一个具有观看状态类型来更改状态的Discord机器人?

问题描述 投票:-1回答:1
  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); 
    });

但是我想以WATCHING状态类型显示它,我该怎么做?

javascript node.js discord.js status
1个回答
0
投票

[从查看the Discord.js documentation开始,这是您所追求的直接示例:

client.user.setActivity('YouTube', { type: 'WATCHING' })
© www.soinside.com 2019 - 2024. All rights reserved.