knights-of-academia / horace

discord.js bot powering the Knights of Academia server with commands like info, AFK, and more
MIT License
23 stars 19 forks source link

[BUG REPORT] Error in highlight messages #277

Closed debashisbiswas closed 3 years ago

debashisbiswas commented 3 years ago

Horace will sometimes try to send messages to users that don't exist, resulting in an error: (error from production server)

3|horace   | 2021-08-26T04:00:24: TypeError: Cannot read property 'send' of undefined
3|horace   | 2021-08-26T04:00:24:     at Function.sendHighlightDM (/home/ec2-user/horace/eventActions/highlightActions.js:90:9)
3|horace   | 2021-08-26T04:00:24:     at /home/ec2-user/horace/eventActions/highlightActions.js:68:11
3|horace   | 2021-08-26T04:00:24:     at tryCatcher (/home/ec2-user/horace/node_modules/bluebird/js/release/util.js:16:23)
3|horace   | 2021-08-26T04:00:24:     at Promise._settlePromiseFromHandler (/home/ec2-user/horace/node_modules/bluebird/js/release/promise.js:547:31)
3|horace   | 2021-08-26T04:00:24:     at Promise._settlePromise (/home/ec2-user/horace/node_modules/bluebird/js/release/promise.js:604:18)
3|horace   | 2021-08-26T04:00:24:     at Promise._settlePromise0 (/home/ec2-user/horace/node_modules/bluebird/js/release/promise.js:649:10)
3|horace   | 2021-08-26T04:00:24:     at Promise._settlePromises (/home/ec2-user/horace/node_modules/bluebird/js/release/promise.js:729:18)
3|horace   | 2021-08-26T04:00:24:     at _drainQueueStep (/home/ec2-user/horace/node_modules/bluebird/js/release/async.js:93:12)
3|horace   | 2021-08-26T04:00:24:     at _drainQueue (/home/ec2-user/horace/node_modules/bluebird/js/release/async.js:86:9)
3|horace   | 2021-08-26T04:00:24:     at Async._drainQueues (/home/ec2-user/horace/node_modules/bluebird/js/release/async.js:102:5)
3|horace   | 2021-08-26T04:00:24:     at Immediate.Async.drainQueues (/home/ec2-user/horace/node_modules/bluebird/js/release/async.js:15:14)
3|horace   | 2021-08-26T04:00:24:     at processImmediate (node:internal/timers:464:21)

This will require further investigation, but my current theory is that

The behavior should be updated such that the error is avoided.