简体   繁体   English

如何在 discord.js 中设置自定义状态?

[英]How do you set a custom status in discord.js?

I've been trying to set a custom status message for my discord.js bot but I can't find anything online the docs don't seem to contain anything on it (probably because it's a relatively new feature) so I was wondering if there was a dev build or a way to get around it?我一直在尝试为我的 discord.js 机器人设置自定义状态消息,但我在网上找不到任何内容, 文档似乎没有包含任何内容(可能是因为它是一个相对较新的功能)所以我想知道是否有开发版本或绕过它的方法?

The current way of setting status is当前设置状态的方式是

client.user.setPresence({ game: { name: 'with discord.js' }, status: 'idle' })
  .then(console.log)
  .catch(console.error);

Thanks for any help谢谢你的帮助

Edit: This PR is waiting to be accepted to add this feature.编辑:此 PR正在等待被接受以添加此功能。 I'll post an answer when it's approved.我会在批准后发布答案。

You can't set a custom status with a bot for the moment.您暂时无法使用机器人设置自定义状态。 You will find more informations on this thread .您将在此线程上找到更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM