Closed SukhOberoi closed 2 years ago
same, Im still using GO version.
same, Im still using GO version.
Go version is no longer supported. JS version is stable at the moment. @SukhSinghOberoi are you also using the Go version?
same, Im still using GO version.
Go version is no longer supported. JS version is stable at the moment. @SukhSinghOberoi are you also using the Go version?
No. I'm on the latest release (windows). Can't send logs rn. On a vacation and don't have access to my server outside local network
@SukhSinghOberoi okay np. You can upload here, though I suggest checking for possible private info in logs before uploading.
i have the same problem. i use the lastest version
Could you send logs?
from the terminal on macOS
Last login: Thu Jun 23 23:16:44 on ttys002 xxx@StevesMacBook WA2DC JS Version % ./WA2DC-macOS It seems like this is your first run. Please enter your bot token: redacted Invite the bot using the following link: https://discordapp.com/oauth2/authorize?client_id=reddacted&scope=bot&permissions=536879120 Bot is now running. Press CTRL-C to exit. /snapshot/WhatsAppToDiscord/src/whatsapp_manager.js:59 if (!['conversation', 'extendedTextMessage', 'imageMessage', 'videoMessage', 'audioMessage', 'documentMessage', 'stickerMessage'].some(el => Object.keys(message.message).includes(el))) { ^
TypeError: Cannot convert undefined or null to object
at Function.keys (
RESTART BOT - back to the beginning again :(
Node.js v18.1.0 xxxx@StevesMacBook WA2DC JS Version % ./WA2DC-macOS It seems like this is your first run. Please enter your bot token: redacted Invite the bot using the following link: https://discordapp.com/oauth2/authorize?client_id=redacted&scope=bot&permissions=536879120
and the logs
{"level":30,"time":1656022951166,"pid":21751,"hostname":"StevesMacBook","msg":"Starting"}
{"level":30,"time":1656022951617,"pid":21751,"hostname":"StevesMacBook","msg":"Update checked."}
{"level":30,"time":1656022951626,"pid":21751,"hostname":"StevesMacBook","msg":"Initialized database."}
{"level":30,"time":1656022987211,"pid":21751,"hostname":"StevesMacBook","msg":"Loaded settings."}
{"level":30,"time":1656022987212,"pid":21751,"hostname":"StevesMacBook","msg":"Loaded contacts."}
{"level":30,"time":1656022987213,"pid":21751,"hostname":"StevesMacBook","msg":"Loaded chats."}
{"level":30,"time":1656022987887,"pid":21751,"hostname":"StevesMacBook","msg":"Discord client started."}
{"level":30,"time":1656022988245,"pid":21751,"hostname":"StevesMacBook","msg":"Repaired channels."}
{"level":30,"time":1656022988413,"pid":21751,"hostname":"StevesMacBook","msg":"WhatsApp client started."}
{"level":30,"time":1656022988851,"pid":21751,"hostname":"StevesMacBook","browser":["Baileys","Chrome","4.0.0"],"helloMsg":{"clientHello":{"ephemeral":"LOgW6t7Xf8i6p/JL24RMuYx076/UeA8dreiuzcXtFWk="}},"msg":"connected to WA Web"}
{"level":30,"time":1656022988971,"pid":21751,"hostname":"StevesMacBook","msg":"handshake complete"}
{"level":30,"time":1656022988972,"pid":21751,"hostname":"StevesMacBook","node":{"passive":true,"userAgent":{"platform":"WEB","appVersion":{"primary":2,"secondary":2222,"tertiary":11},"mcc":"000","mnc":"000","osVersion":"0.1","manufacturer":"","device":"Desktop","osBuildNumber":"0.1","releaseChannel":"RELEASE","localeLanguageIso6391":"en","localeCountryIso31661Alpha2":"US"},"webInfo":{"webSubPlatform":"WEB_BROWSER"},"connectType":"WIFI_UNKNOWN","connectReason":"USER_ACTIVATED","regData":{"eRegid":"AAAANg==","eKeytype":"BQ==","eIdent":"HQNOAWTcnKVL+TKrNfUCIo3ny7JJxuVbGOJorMfrOzk=","eSkeyId":"AAAB","eSkeyVal":"+hqARhgSoSb3Sm6IYQveSdDvGEp9Uk6E5E+7k16WPTY=","eSkeySig":"TkBRsW4V20JwLSCirefuuFBJYXuPEUyct+mhwGTJrqbqdHYEseAm3NYQ7/3UM7IfetybB93w2nkef68nzp/shA==","buildHash":"iY/3BIuIma3uGZPeXN50dQ==","companionProps":"CgdCYWlsZXlzEgYIBBAAGAAYASAA"}},"msg":"not logged in, attempting registration..."}
{"level":30,"time":1656023069245,"pid":21751,"hostname":"StevesMacBook","jid":"redacted:41@s.whatsapp.net","msg":"registered connection, restart server"}
{"level":30,"time":1656023069246,"pid":21751,"hostname":"StevesMacBook","error":{"data":null,"isBoom":true,"isServer":false,"output":{"statusCode":410,"payload":{"statusCode":410,"error":"Gone","message":"Restart Required"},"headers":{}}},"msg":"connection closed"}
{"level":40,"time":1656023069246,"pid":21751,"hostname":"StevesMacBook","msg":"If your process stalls here, make sure to implement the reconnect logic as shown in https://github.com/adiwajshing/Baileys/blob/master/Example/example.ts#:~:text=reconnect"}
{"level":50,"time":1656023069876,"pid":21751,"hostname":"StevesMacBook","err":{"type":"Error","message":"Restart Required","stack":"Error: Restart Required\n at WebSocket.
so I deleted all apps in Discord Developers, and all bots. Created a new App, new Bot token, and deleted all previous channels in Discord created by GO version. Ran into AUTH immediate problems as you can see trying to validate the token. No messages in discord, no new channels created after scanning the QR code in WA.
This was by running the WADC-macOS build with no previous database.
I previously managed to get this all working a few weeks back, but it was throwing so many errors and crashing frequently so I went back to the GO version which works flawlessly everytime. I also attached the debugger in VSCode and found exceptions thrown after I had got it working, here is one minor fix (as an example) which I committed to my own branch, but I dont have permissions to submit a PR. in discord_manager.js line 59 quotedMessage can be null, not sure why..
if (message.contextInfo.isForwarded) {
content += `> Forwarded Message:\n${message.text}`;
}
else if (message.contextInfo.quotedMessage) {
content += `> ${quotedName}: ${message.contextInfo.quotedMessage.conversation.split('\n').join('\n> ')}\n${message.text}`;
}
break;
OK I have got it running again on JS version, and Ill post errors/logs
Excellent, thanks for applying my fix. I will post more exceptions as they arise.
For anyone having problems trying to authorise the bot follow this guide.
chmod +x WA2DC-linux
. On Mac you should right click and open the file. This applies permissions to run the file (from non-trusted developer) and close again../WA2DC-linux
from a terminal. If running PC I think its simple double click on .exe, @Z0MBlI I checked your logs but unfortunately v0.6.7 doesn't log errors before exit. I pushed a new version and it catches errors before exit. So please run with that version and report back here. I deleted the original comment you made because it included your phone number.
thx would it be possible for the bot to save the data so that it can find its way back to where it was after a restart? i run it on my pc
This is normally the case, but when the bot crashes it can't save, and since the bot fails on the first run, it can't save your token info etc. causing you to enter it everytime. If it works for a moment, then run the bot enter your token invite it and then hit control + c to initiate saving the state of the bot before exit.
oh nice thx for help it works
log.txt can you fix the errors?
I have the problem when I restart the bot that all the messages are deleted in the discord and whatsapp groups don't work properly either
@Z0MBlI now the bot saves the state no matter the exit reason. it shouldn't reset everything now.
the bot crashes quite often and whenever i restart the bot it asks for the token everytime and i have to kick the bot and readd it to the server for it to work. should i send the log file here? (im kinda a noob to this stuff btw)