-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message.deletable giving TypeError (possible issue with Channel.permissionsFor) #2319
Comments
No, the cause isn't related to bot leaving and rejoining a guild (at least not for me). I don't know of any way of reproducing this. It looks like it happens at random. I run the bot continuously for a week until it's updated and restarted, and when I check the logs for previous week this comes up in the logs. I don't see any specific pattern, so I am unable to reproduce it. |
dc92582 probably fixed it as I haven't encountered this issue after updating to discord.js |
Please describe the problem you are having in as much detail as possible:
Message.deletable
sometimes givesTypeError: Cannot read property 'has' of null
.Upon looking at the discord.js code for
Message.deletable
, I found that the actual issue is withChannel.permissionsFor()
- it sometimes returnsnull
(check the complete stack trace below):I've previously found that
Channel.permissionsFor()
returnednull
sometimes, but I thought that was intended. So, I did a workaround for that when I directly accessed that. But ifMessage.deletable
internally uses that and it gives aTypeError
, that's a bug and should be fixed. And so, I'm reporting it.Include a reproducible code sample here, if possible:
Link to the snippet above: https://github.com/TheBastionBot/Bastion/blob/master/modules/games/acrophobia.js#L48
Complete stack trace of the error:
Further details:
11.3.0
8.9.4
Debian 9.1 x64
Medium - Because it doesn't happen all the time. I've got 6 logs of this error since last Sunday.
The text was updated successfully, but these errors were encountered: