discord - 我想将我的不和谐机器人状态从播放更改为观看
问题描述
我想让我的状态为“正在观看”命令 -help”,但我不知道如何将其从播放切换为观看,
这是我的代码:
command(client, 'status', (message) => {
if (message.author.id != "my id goes here") return;
const content = message.content.replace('-status ', '')
client.user.setPresence({
activity: {
name: content,
type: 0,
},
})
})
解决方案
您需要设置代码:
client.user.setPresence({
status: 'online', //you can set online , idle , dnd and offline
activity: {
name: 'Some Name',
type: 'PLAYING', //here you can change it to 'WATCHING' , 'PLAYING' , STREAM,
url: 'https://discord.com'
}
});
有关更多信息,您可以在此处查看
推荐阅读
- typescript - 反转依赖注入不将依赖注入构造函数
- mysql - 使用phpmyadmin传输数据的问题
- c - 从不同的函数创建和列出数组
- reactjs - 使用不同的 onPress React Native 渲染多个按钮
- python - 无法将参数传递给在 python shell 中运行的 python 脚本
- curl - 没有用户名的邮递员授权(只有密码)
- python - 蟒蛇 3 | 属性错误
- c - C-将矩阵传递给没有非常量列值的函数
- ios - 如何将 UIScrollView 移动一帧的宽度?(Xcode,斯威夫特)
- python - 当我使用多轴时,WebAgg 后端没有响应 CrtrC