简体   繁体   English

我的 TypeScript/JavaScript discord.js 代码有什么问题

[英]What's wrong with my TypeScript/JavaScript discord.js code

This is my code and I need a way to fix it.这是我的代码,我需要一种方法来修复它。 This code is supposed to make my bot change statuses every 10 minutes but instead, it just makes my bot have no status at all.此代码应该让我的机器人每 10 分钟更改一次状态,但相反,它只会让我的机器人完全没有状态。

What's wrong with my code?我的代码有什么问题?

client.on('ready', () =>{
    console.log(`up n runnin wOof!`); setInterval(() => client.user.setPresence({
      status: "online",
      game: {
          name: (arrayRandom(actvs)),
          type: "WATCHING" }
        }
    ), 1000 * 60 * 10);

  });

Did you try to wait 10 minutes?你试过等10分钟吗?

When launching an interval, the code will be executed when the timer stops, which, in your case, would be 10 minutes after launching it.启动间隔时,将在计时器停止时执行代码,在您的情况下,将在启动它后 10 分钟执行。

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

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