【问题标题】:I'm looking to make my discord.js bot invisible我想让我的 discord.js 机器人不可见
【发布时间】:2021-05-06 14:29:13
【问题描述】:
client.user.setStatus('invisible')
client.on('ready',  async() => {
    console.log('I am online and ready to listen to commands!')
})

这行得通吗?另外,我正在寻找可以执行此操作的命令,例如 ;status dnd 或 ;dnd,很确定此代码将无法正常工作:

client.user.setStatus('dnd')

好的,所以我意识到错误是: https://pastebin.com/xtUZy0WW

【问题讨论】:

    标签: javascript node.js json discord discord.js


    【解决方案1】:

    您需要在ready 回调中调用client.user.setStatus('invisible'),否则client.user 将为空。除此之外看起来不错:)

    编辑:看起来像这样

    client.on('ready',  async() => {
        console.log('I am online and ready to listen to commands!')
        client.user.setStatus('invisible')
    
    })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-21
      • 2021-08-17
      • 2021-10-27
      • 1970-01-01
      • 1970-01-01
      • 2021-08-17
      • 2021-10-07
      • 2021-10-29
      相关资源
      最近更新 更多