EddieBot: EddieBot crashes
Description
EddieBot crash shows the error below
/root/EddieBot/dist/messageReactionAdd.js:49
if (reaction.message.member.partial) {
^
TypeError: Cannot read property 'partial' of null
at Object.exports.messageReactionAdd (/root/EddieBot/dist/messageReactionAdd.js:49:33)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (16 by maintainers)
Commits related to this issue
- fix(messageReactionAdd): add null check to member field We were using the ! non-null assertion operator, which is removed in the emitted JavaScript code. The crash is caused by the fact that the memb... — committed to EddieHubCommunity/EddieBot by BOLT04 3 years ago
- fix(messageReactionAdd): add null check to member field (#451) We were using the ! non-null assertion operator, which is removed in the emitted JavaScript code. The crash is caused by the fact that t... — committed to EddieHubCommunity/EddieBot by BOLT04 3 years ago
Static analysis is not perfect. As per the typescript release notes
The transpiled code does not have this check. From
dist/messageReactionAdd.jsIf we wish to have this
nullcheck during runtime - we have to explicitly add that in. We can see ifreaction.message.memberis truthy. In TypeScriptThe transpiled JavaScript code
Adding this check fixes the error.
Great team work everyone 👍 - I think there are more crash issues in the log, but this is a great start 💪
This bug is caused when Eddie bot tried to add a role to a member that has left.