get undefined on channelsmanager.fetch(forumChannel) but not on normal channel
Using both v14.6.0-dev and 14.5.0
SOLUTION HERE : https://canary.discord.com/channels/222078108977594368/1023950108770979840/1023953532350627960
when i try to get a forumchannel at the ready event like so :
i get an error :
cannot read properties of undefined (reading threads)
but when i change the channelID to some "normal text channel" it does its job without any problem
the same error appears in the same way when trying to fetch the channel on messageCreate event :
same error (c is not defined and returns null on console.log)
same thing, changing the channel if to some normal channel and it works like a charm16 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Are you sure the provided id is from a forum channel?
Actually, that is from a channel?
i right click the forum channel and click copy id like i do for every normal channels
i was starting to think about intents
If you have the Guilds, it shouldn't be an issue
Wrong reply
let me retry on v14.5.0 real quick but i had the guild intent
can you give me the bitfield for it pls ? i usually use an array of "GUILDS","GUILD_MESSAGES" and so on but idk why it wont work this time
v13?
Ugh, can you run
npm ls discord.js
He said v14 on the post but v14.5 and 14.6
GatewayIntentBits.Guilds
and GatewayIntentBits.GuildMessages
Idk it it is GatewayIntentBits
or GatewayIntentsBits
yeah mb im just dumv with those
well, seems like the good guild intent fixed it ? i really struggle to understand how to declare them versions to versions (often switching from dev to stable)
thx for the help i guess ?
Always use this, they won't change until v15 (and may not change there either)
ok thx for the tips
and for the one who's looking for the same problem as me, here's the bit of code that works :
1. Verify from
npm ls
that you got the good version and not an older one for whichever reason
2.
3, if you still get the error, try npm remove discord.js
then npm i discord.js
again so you dont have random shit in your djs version