itanex / stream-assist-bot

GNU General Public License v3.0
1 stars 0 forks source link

Bot crashed after user subscribed #52

Closed leashadav closed 6 months ago

leashadav commented 7 months ago

we killed the bot it died after dawn's raid and shout out

itanex commented 6 months ago

Investigation: Crash appears to be related to other bug. Merging to this report.

Event: User subscribed and the application crashed.

Error analysis: It appears that the chatClient object was not provided to the Subscription Handler class as expected. The result was a null/undefined value for this object and there was an attempt to use the object in the null state.

Raw Error Report.

D:\Workspaces\stream-assist-bot\bot\handlers\subscription.handler.ts:39
        this.chatClient.say(channel, `Thank you. @${user} joined the colony!`);
             ^
TypeError: Cannot read properties of undefined (reading 'chatClient')
    at onSubscribe (D:\Workspaces\stream-assist-bot\bot\handlers\subscription.handler.ts:39:14)
    at ChatClient.emit (D:\Workspaces\stream-assist-bot\node_modules\@d-fischer\typed-event-emitter\lib\EventEmitter.js:31:17)
    at D:\Workspaces\stream-assist-bot\node_modules\@twurple\chat\lib\ChatClient.js:666:26
    at IrcClient._handleEvents (D:\Workspaces\stream-assist-bot\node_modules\ircv3\lib\IrcClient.js:626:13)
    at IrcClient.receiveLine (D:\Workspaces\stream-assist-bot\node_modules\ircv3\lib\IrcClient.js:276:14)
    at D:\Workspaces\stream-assist-bot\node_modules\ircv3\lib\IrcClient.js:578:18
    at PersistentConnection.emit (D:\Workspaces\stream-assist-bot\node_modules\@d-fischer\typed-event-emitter\lib\EventEmitter.js:31:17)
    at D:\Workspaces\stream-assist-bot\node_modules\@d-fischer\connection\lib\PersistentConnection.js:83:46
    at WebSocketConnection.emit (D:\Workspaces\stream-assist-bot\node_modules\@d-fischer\typed-event-emitter\lib\EventEmitter.js:31:17)
    at WebSocketConnection.receiveRaw (D:\Workspaces\stream-assist-bot\node_modules\@d-fischer\connection\lib\AbstractConnection.js:48:18)