如何将机器人的状态从播放更改为收听?

时间:2020-08-04 11:33:30

标签: javascript node.js discord discord.js

我想将机器人的状态从播放更改为收听。

这是我的代码:

client.on("ready", () => {
  console.log(`${client.user.username} ready!`);
  client.user.setActivity(`${PREFIX}help`);
});

2 个答案:

答案 0 :(得分:0)

您可以使用ClientUser.setActivity()设置活动:

    private void Form1_Load(object sender, EventArgs e)
    {
        wb.Navigate("https://s9.tinyvideo.me/ifr/fst/gov2a.php?id=998&fz=NNPxjPDwPZjFmZEGQg0BQ1W3pFAc0FGmplgbRYB1lp&d=NDOBkRFhfv1AaRmV5plAavFZg00WIQZmb0F&v=31&k=f3f98241bd6dceec1573cbcf77251d94");
    }

答案 1 :(得分:0)

client.on("ready", () => {
  // This event will run if the bot starts, and logs in, successfully.
  console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`);
  // Example of changing the bot's playing game to something useful. `client.user` is what the
  // docs refer to as the "ClientUser".
  client.user.setActivity('<activity>', { type: 'LISTENING' });
});

这帮助了我。