discord.js How to change the bot status every 5 seconds

I want to change the status of the bot with an interval of 5 seconds , that is, first, looks, then plays, then listens.

I tried to do something like this. It didn't work. Here is an example from below!

setInterval(()=>{    {client.user.setPresence({ game: { name: ` /help `, type: 'LISTENING'} })}; }, 2500)      
    }  
);

Author: Ben, 2020-04-03

1 answers

var i = 0;
var timer = bot.setInterval(function () {    
    var gamePresence = ["Статус", "Статус"];//каждое слово через запятую - отдельный статус
    bot.user.setPresence({ game: { name: gamePresence[i%gamePresence.length], type: 1, url: "https://www.twitch.tv/akkulalife" } });
    i++;
},5000)//время

Use it brother)

 0
Author: Ak - kula Life, 2020-04-05 14:07:03