![](/img/trans.png)
[英]I'm trying to make an autorole function in discord.js for my bot but it doesn't work
[英]I'm looking to make my discord.js bot invisible
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
您需要在ready
回调中调用client.user.setStatus('invisible')
,否则client.user
将是 null。 除此之外看起来不错:)
编辑:看起来像这样
client.on('ready', async() => {
console.log('I am online and ready to listen to commands!')
client.user.setStatus('invisible')
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.