Skip to content
Advertisement

Discord js v13 channel filter not working

I’m currently trying to get the total amount of text channels and voice channels to display in my embed, when I try to filter them as I did in discord.js v12 it gives me an output of 0 but if I use no filter and do guild.channels.cache.size, it prints 4 which is the correct amount ( 2 text channels, 1 voice channel , 1 category channel).

If anyone can explain why it’s printing 0 and not the correct amount of text/voice channels that would be amazing, I’ve searched everywhere and can’t find a reason why it wouldn’t work.

JavaScript

Advertisement

Answer

Discord.js v13 changed the possible values of Channel.type.

Here is how you change it

JavaScript

Replace whatever is preceded with a - with the text below which is preceded with a +

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement