小编Sap*_*per的帖子

如何让我的 Discord 机器人每 10 秒更改一次状态?

我有一个 smol Discord bot(使用 discord.js-commando),我有这个代码:

var activevar = ["with the &help command.", "with the developers console", "with some code", "with JavaScript"];
var activities = activevar[Math.floor(Math.random()*activevar.length)];
client.on('ready', () => {
    client.user.setActivity(activities);
}
Run Code Online (Sandbox Code Playgroud)

但这只有在我重新启动机器人时才会改变它。有人可以帮我吗?

discord discord.js

3
推荐指数
1
解决办法
4万
查看次数

标签 统计

discord ×1

discord.js ×1