FKLC / WhatsAppToDiscord

WhatsAppToDiscord is a Discord bot that uses WhatsApp Web as a bridge between Discord and WhatsApp.
https://fklc.github.io/WhatsAppToDiscord/
MIT License
238 stars 67 forks source link

Unexpected Crashes #141

Closed shad-yx closed 1 year ago

shad-yx commented 1 year ago

I've used this bot in the past before but stopped using it because it would unexpectedly close down its own regardless of what discord/WhatsApp account, device, OS, or Hardware I used. I recently gave it another go, seeing it had received updates, thinking the issue would be resolved by now but I'm experiencing the same problem again. IMO, its a really powerful solution but I can't seem to make it work without having to restart it manually every time its down

JasperTheMinecraftDev commented 1 year ago

That's because your internet disconnects, it just quits the program when that happens.

FKLC commented 1 year ago

I mean I can code automatic restart to the bot, but I would rather not because I try to handle all crashing exceptions and not spam the user/WA servers. So if you can share your logs, I can look at them, but otherwise, unfortunately, I'm not going to place a auto-restart functionality. In the meantime, you can probably do something like:

while [ 1 ]; do
  ./WA2DC
done
JasperTheMinecraftDev commented 1 year ago

There are no errors, it just quits.

FKLC commented 1 year ago

I mean there should be something in logs.txt. Are you sure?

JasperTheMinecraftDev commented 1 year ago

Didn't see anything, can you remind me on monday so I can double check it?Op 10 jun. 2023 23:07 schreef Fatih Victor Kilic @.***>: I mean there should be something in logs.txt. Are you sure?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

FKLC commented 1 year ago

Okay no problem. Just to let you know, I've looked at handling the failures when an internet connection failure happens, and it requires handling so many stuff. This is unfortunately not something that I will implement. I'm sorry. If it, however, crashes due to another reason, then feel free to share your logs here. Thank you!

FKLC commented 1 year ago

Didn't see anything, can you remind me on monday so I can double check it?

Just reminding this.

JasperTheMinecraftDev commented 1 year ago

Didn't see anything, can you remind me on monday so I can double check it?

Just reminding this.

Thank you, found these logs:

{"level":30,"time":1686259996034,"pid":12184,"hostname":"DESKTOP-Q5CQI7H","version":"v0.10.10","trace":"Error: Connection Failure\n    at WebSocket.<anonymous> (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at WebSocket.emit (node:events:537:28)\n    at C:\\snapshot\\WhatsAppToDiscord\\out.js\n    at Object.decodeFrame (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at WebSocket.onMessageRecieved (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at WebSocket.emit (node:events:537:28)\n    at Receiver.receiverOnMessage (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at Receiver.emit (node:events:537:28)\n    at Receiver.dataMessage (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at Receiver.getData (C:\\snapshot\\WhatsAppToDiscord\\out.js)","msg":"connection errored"}
{"level":50,"time":1686259996035,"pid":12184,"hostname":"DESKTOP-Q5CQI7H","version":"v0.10.10","err":{"type":"Error","message":"Connection Failure","stack":"Error: Connection Failure\n    at WebSocket.<anonymous> (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at WebSocket.emit (node:events:537:28)\n    at C:\\snapshot\\WhatsAppToDiscord\\out.js\n    at Object.decodeFrame (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at WebSocket.onMessageRecieved (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at WebSocket.emit (node:events:537:28)\n    at Receiver.receiverOnMessage (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at Receiver.emit (node:events:537:28)\n    at Receiver.dataMessage (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at Receiver.getData (C:\\snapshot\\WhatsAppToDiscord\\out.js)","data":{"reason":"405","location":"atn"},"isBoom":true,"isServer":false,"output":{"statusCode":405,"payload":{"statusCode":405,"error":"Method Not Allowed","message":"Connection Failure"},"headers":{}}},"msg":"Connection Failure"}
{"level":50,"time":1686260006676,"pid":12184,"hostname":"DESKTOP-Q5CQI7H","version":"v0.10.10","err":{"type":"Error","message":"Connection Closed","stack":"Error: Connection Closed\n    at sendRawMessage (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at sendNode (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at query (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at groupQuery (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at groupMetadata (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at C:\\snapshot\\WhatsAppToDiscord\\out.js\n    at C:\\snapshot\\WhatsAppToDiscord\\out.js\n    at Object.transaction (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at relayMessage (C:\\snapshot\\WhatsAppToDiscord\\out.js)\n    at Object.sendMessage (C:\\snapshot\\WhatsAppToDiscord\\out.js)","data":null,"isBoom":true,"isServer":false,"output":{"statusCode":428,"payload":{"statusCode":428,"error":"Precondition Required","message":"Connection Closed"},"headers":{}}},"msg":"Connection Closed"}
{"level":30,"time":1686260006676,"pid":12184,"hostname":"DESKTOP-Q5CQI7H","version":"v0.10.10","msg":"Exiting!"}
FKLC commented 1 year ago

Yeah this is about internet disconnecting. It just doesn't make sense to handle internet disconnects, so nothing I can do about this. Closing the issue.