简体   繁体   English

有什么方法可以在 discord.js v13 上将我的 Discord Bot 的在线状态设置为移动设备?

[英]Is there any way I can set my Discord Bot's online status to mobile on discord.js v13?

The methods used in previous versions of Discord.js don't seem to work in V13 Discord.js 以前版本中使用的方法似乎在 V13 中不起作用

I have tried using this code but it did not work我曾尝试使用此代码,但它不起作用

const client = new Discord.Client({ ws: { properties: { $browser: "Discord iOS" }} });

I also could not find the code used to set it in Constants.js file我也找不到用于在Constants.js文件中设置它的代码
File path: /node_modules/discord.js/src/util/Constants.js文件路径: /node_modules/discord.js/src/util/Constants.js

Code reference: How to set a bot active on mobile代码参考: 如何设置机器人在移动设备上处于活动状态

just put that code in index.js like this:只需将代码放在 index.js 中,如下所示:

const client = new Discord.Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
    ws: { properties: { $browser: "Discord iOS" }}
});

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

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