【问题标题】:Adding a custom status on a discord.js bot在 discord.js 机器人上添加自定义状态
【发布时间】:2020-09-13 21:05:31
【问题描述】:

我目前正在尝试向我的 discord.js 机器人添加自定义状态以请求新的开发人员,但它不起作用。这是我的代码:

client.on('ready', () => {
 console.log(`Ready to comply.`);
 client.user.setPresence({
  status: 'online',
  game: {
   name:
    'need developers, DM Daniel for more info, BTW, you can learn the language at discord.js.org.', //The message shown
   type: 'PLAYING',
  },
 });
});

我已经尝试搜索 Stack Overflow,并找到了一个答案,告诉我使用上面的代码,但它不起作用。

【问题讨论】:

    标签: javascript node.js discord discord.js


    【解决方案1】:

    如果您指的是最近的 Discord 更新之一引入的自定义状态,这是不可能的。

    如果您的意思是“使用 100 个命令”,您可以使用:

    client.user.setPresence({ activity: { name: 'with discord.js' }, status: 'idle' })
    

    【讨论】:

      【解决方案2】:

      如果你使用 discord.js v12,那么试试这段代码,它对我来说非常有效:

      client.user.setPresence({
       status: 'online',
       activity: {
        type: 'PLAYING',
        name: 'need developers, DM Daniel for more info',
       },
      });
      

      【讨论】:

        猜你喜欢
        • 2022-01-07
        • 2021-09-03
        • 2022-11-11
        • 1970-01-01
        • 2019-07-31
        • 2020-11-17
        • 2021-01-11
        • 2021-05-07
        • 2020-11-23
        相关资源
        最近更新 更多