DiscordAPIError[50001]: Missing Access. In private threads
I am trying to create a MessageComponentCollector for an interaction Command. It works fine in private channels but in threads started inside those channels the interaction.channel property is null and trying to fetch the channel leads to a DiscordAPIError for missing access.
While I would say that the bot just cannot access that channel the interaction command works fine and in discord.js v13 fetching the threads also worked, as the bots were previously working fine in those threads before I updated to v14. So I am thinking it might be a bug in Discord.js v14
You can reproduce this by starting a private channel then creating a thread (private or not, doesn't matter) from this channel. Then trying to fetch that thread while using an interaction command from inside the thread.
interaction.client.channels.fetch(interaction.channelId);
Stack Trace
Discord.js v14.9.0
Node v18.15.01 Reply
• 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.