kritzware / twitch-bot

🤖 Easily create chat bots for Twitch.tv
https://www.npmjs.com/package/twitch-bot
MIT License
149 stars 36 forks source link

random disconnet #28

Closed tcarlsen closed 6 years ago

tcarlsen commented 6 years ago

hey there.

I have this random disconnect where the bot just leaves the channel without any errors and I have to restart the script.

any ideas to how I can test what's happening?

kritzware commented 6 years ago

Hi @tcarlsen,

Perhaps you could use the message event and check if anything looks strange about the final chatter object, or the chat message itself, before a random disconnect.

Alternatively, you could log the raw IRC data block in node_modules/twitch-bot/lib/bot.js e.g.

  listen() {
    this.irc.on('data', data => {
      console.log(data) // Add this log statement and check if there is anything unusual before a disconnect    

    ...
    })
}

Let me know if you find anything 👍

tcarlsen commented 6 years ago

Haven't done it since I wrote this issue. No idea what happened before

kritzware commented 6 years ago

Hmm that is strange, but no worries. Feel free to re-open this issue if it happens again 👍