M
M
MoneySMile2021-06-29 22:38:54
Node.js
MoneySMile, 2021-06-29 22:38:54

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);
  }

60db763d92722588042600.png60db764300d3c965844139.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Nevzorov, 2021-06-30
@fixator10

Bots can change the name and description of channels 2 times in 10 minutes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question