有什么方法可以将漫游器的状态设置为自定义状态?
我到处都看过网上,但找不到discord.js
的任何文档。
我发现
https://stackoverflow.com/questions/61754610/how-to-set-bots-custom-status-with-discord-py
对于discord.py
,但是我不确定这是否是我想要的,以及那是python而不是JavaScript。
如果您的意思是this然后您可以插入此代码
bot.user.setActivity(`custom status`, {
type: 'PLAYING' // you can set this to PLAYING, WATCHING, LISTENING or STREAMING
}); // you may have "client" instead of "bot"
[无论您要设置自定义状态的位置,例如,如果您要在bot准备就绪时进行设置,请将其添加到bot.on(“ ready”)函数中]
bot.on("ready", async () => {
// add it here
}); //again you may have client instead of bot
唯一可用的状态类型是:
关于自定义状态,您将无法使用它,因为它不会显示任何状态如果您想尝试,我会给您代码
client.user.setPresence({activity: {type: 'CUSTOM_STATUS', name: "Chilling"}, status: 'online'}).then(console.log).catch(console.error);