How can i set custom status in discord bot according to new update

我是研究僧i 提交于 2019-12-04 05:46:42

问题


according to new update u 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


回答1:


Discord libaries should only be used for bots, using the API for user-account clients violates Discords Terms of Service as this is considered as API Abuse.
Moreover the recent announcement does not apply for bots, for many months Bots are able to set custom presence, including listening and watching.

To set this custom presence, the custom activity, take a look at the Discord.js Documentation here




回答2:


You can get custom status to appear on a bot, but it won't be able to say anything. According to a Github issue on discord-api-docs, More specifically, this issue, and even more specifically, this comment on that issue. You can basically set the activity type to 4 for the client's cs by using the ClientUser.setActivity() method, and check it's full profile to see that custom status is technically available for bots.

bot.user.setActivity(`this won't appear in the bot's custom status!`, {type: 4})



回答3:


You can use this code

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:
        }
    });
 });


来源:https://stackoverflow.com/questions/58568377/how-can-i-set-custom-status-in-discord-bot-according-to-new-update

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!