ChannelNotCached
Error [ChannelNotCached]: Could not find the channel where this message came from in the cache!
how to fix this error its showing up in my messageCreate event
19 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.Is it a dm?
Versions:
Discord.js v14.11.0
NodeJS v16.20.1
Line
Error:
@Myth 🌈
do you have the Guilds intent
Yes
@luna🌈
Are you sure you shared the correct line? This error is being thrown from calling
<Message>.reply()
according to the error stack, not <User>.send()
The erroring line is src/events/interactions/messageCreate.js:42
I'm sorry
This was the line
it was the previous line
@Squid
Can you show your full Client construction?
@Squid
doesnt seem to be djs related
How to handle Unknown Interaction error
@luna🌈
Common causes of
DiscordAPIError[10062]: Unknown interaction
:
- Initial response took more than 3 seconds ➞ defer the response *.
- Wrong interaction object inside a collector.
* Note: you cannot defer modal or autocomplete value responsesand #rules 5
I'm sorry
Alright thanks
Please provide a fix for this !
you appear to be using a custom client, not a discord.js one
@aura.me Do you ever call
message.channel.delete()
in your project?Am not using a custom client am just extending the discord.js client to add some config and define some files
Nope
but i do use message.delete()
not channel.delete
I don't have a solution, but the problem here is confusing (for anyone else who may try to help):
The internal line that throws the error is
if (!this.channel) return Promise.reject(new DiscordjsError(ErrorCodes.ChannelNotCached));
from Message#reply()
. That means that this.channel
is falsy; however, because Message#reply()
only gets called by your if
statement's condition which relies on message.channel.permissionsFor(...)...
, message.channel
must be truthy.
Therefore, something is causing message.channel
to change from truthy to falsy from the time of reaching the if
statement to the time that you call message.reply()
, which ... feels impossible
You can try uninstalling and reinstalling discord.js, but that's all I personally have left@squiddleton ohk i will try this