Answer the question
In order to leave comments, you need to log in
The bot stops changing the color of the role. How to fix?
The bot on Discord JS, at one point, simply stopped changing the color of the role at startup. Didn't change anything. I tried to add it to another server, it worked there and later stopped working again.
bot.on('ready', () => {
console.log('Бот запущен✅');
setInterval(() => {
var serv = bot.guilds.cache.get("783324048583032862");
var channel = serv.roles.cache.get("783395502472691752");
channel.setColor(`#FF0000`);
channel.setColor(`#FA8072`);
channel.setColor(`#FFA500`);
channel.setColor(`#FFD700`);
channel.setColor(`#FFFF00`);
channel.setColor(`#7FFF00`);
channel.setColor(`#00FFFF`);
channel.setColor(`#00BFFF`);
channel.setColor(`#9400D3`);
channel.setColor(`#DC143C`);
}, 100);
});
Answer the question
In order to leave comments, you need to log in
If I'm not mistaken, the Discord API has a kind of "protection system" against rainbow roles, so such a bot will not work for a long time.
I certainly don't write in JS, but I would suggest waiting before each color change.
...
#спать 3 секунд
channel.setColor(`#FA8072`);
#спать 3 секунд
channel.setColor(`#FFA500`);
#спать 3 секунд
channel.setColor(`#FFD700`);
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question