如何根据新更新在Discord机器人中设置自定义状态? [英] How can I set custom status in discord bot according to new update?

查看:66
本文介绍了如何根据新更新在Discord机器人中设置自定义状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据新更新,您可以设置自己的自定义状态,而无需播放或收听,但文档中并未添加,但是我可以在这里做什么.在discord.js git中没有设置自定义活动的选项,请参见图像在这里也是stable/src/util/Constants.js 不一致的状态图片

According to new update youu can set your own custom status without playing or listening this is't added in documentation yet what can I do here. There is no option to set custom activity in the discord.js git see the image stable/src/util/Constants.js here too discord status image

推荐答案

您可以使用此代码

client.on("ready", () =>{
    console.log(`Logged in as ${client.user.tag}!`);
    client.user.setPresence({
        status: "online",  //You can show online, idle....
        game: {
            name: "Using !help",  //The message shown
            type: "STREAMING" //PLAYING: WATCHING: LISTENING: STREAMING:
        }
    });
 });

这篇关于如何根据新更新在Discord机器人中设置自定义状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆