discord.js voice channel member count

I have the problem that the bot the member count updates only once and does nothing else after. Does anyone know how to solve it?Here you see a picture of a public counter bot on the right and on the left is my bot with the channel

Heres my current code:

bot.on("ready", () => {
    const guild = bot.guilds.cache.get('779790603131158559');
    setInterval(() => {
        const memberCount = guild.memberCount;
        const channel = guild.channels.cache.get('802083835092795442')
        channel.setName(`DC´Ş▒Member: ${memberCount.toLocaleString()}`)
    }, 5000);
});

98 thoughts on “discord.js voice channel member count”

Leave a Comment