Answer the question
In order to leave comments, you need to log in
Why doesn't the bot change the name of the discrod.js channel anymore?
The bot changes the number of users online 1-2 times. Further, it does not give an error, but it does not change the name either. All permissions are there and the audit log is empty
Code:
module.exports = async function(bot) {
const guild = bot.guilds.cache.get("675285730150449153");
setInterval(function () {
let memberCount = guild.members.cache.filter(member => !member.user.bot).size;
let onlineMemberCount = guild.members.cache.filter(member => !member.user.bot && member.presence.status === "online").size;
let memberCountChannel = guild.channels.cache.get("850002722945892482");
let memberCountChannel1 = guild.channels.cache.get("850002915267706942");
memberCountChannel.setName(`╭Участников: ${memberCount}`);
memberCountChannel1.setName(`╰Онлайн: ${onlineMemberCount}`);
console.log(memberCount)
console.log(onlineMemberCount)
}, 20000);
}
Answer the question
In order to leave comments, you need to log in
Bots can change the name and description of channels 2 times in 10 minutes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question