interaction.channel = null
Sometimes interaction.channel = null. This is often fixed by restarting the bot. But I don't want to restart the bot every 24 hours.
It's a command interaction that was executed in a guild. The bot is in this guild and the guild is cached.
Along with that I fetch the channel if I am receiveing a chanel partial
But I am still getting this error
18 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.This should throw
Cannot read properties of null
Could you show the full error?
I cannot show you the full stack trace because I am dumb and I just logged the error name without the stack trace.
However another error occured when it proceed and tried to send an embed
This is probably the same error anyways.
So is interaction.channel even null 😂
the channel id gets passed into the url so your channel isnt null, its just not a valid channel
could be a message id, role id, user id etc
It looks like the channel already got deleted when the bot sent the message
it doesn't get deleted because it errors
😂
but I gotta correct myself, this is not a command interaction. It's a button interaction
At least there's already no channel with that id
Sometimes it works after restarting the bot
this doesn't make sence
and overall it errors 1 out of 10 button interactions
Could you show your ticketClose code?
sure
In line 35 you should log the error to console, not send it as an embed, it's not an embed.
it's a custom function
it returns the embed and logs the error
I have been told that a possibility is that the guild is not cached, I had no idea to fix it so I added that (being aware of that this probably doesn't work that way)
So originally these 2 lines would be gone
I see but I am still wondering how this can happen
but none of them are the reasons, it's a bot account 100% and the command was executed in a guild where the bot is a memberof
let me double check
nope
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
• Note: if you initialize your Client as
bot
or other identifiers you need to use these instead of client
• If the output is too long to post consider using a bin instead: gist | paste.gg | sourceb.in | hastebinthat's what I am thinking
I can't reproduce this issue
but someone else who has access to the bot
he's using node v20, might this be an issue here?
It is my bot, but another user who's using my bot told me that this isn't working. So I got access to his hosting provider to get all required information
(he got the files)
bot code
nope
he created his own bot account
because he gave me perms
You can trust me at that point
I am not retarded holy