Closed olalonde closed 1 year ago
retry with
// Pairing code for Web clients
if (!sock.authState.creds.registered) {
const phoneNumber = BOT_NUMBER;
console.log({ phoneNumber });
await sock.waitForConnectionUpdate((update) => !!update.qr)
console.log("Requesting pairing code...");
const code = await sock.requestPairingCode(phoneNumber);
console.log(`Pairing code: ${code}`);
}
Thanks. That seemed to work.
Oops, never mind. I just deleted my auth state, "logged out" the device form my phone and tried again. Same error as before.
edit: It does avoid the 5s delay hack I had before though, but doesn't solve the issue.
Oops, never mind. I just deleted my auth state, "logged out" the device form my phone and tried again. Same error as before.
edit: It does avoid the 5s delay hack I had before though, but doesn't solve the issue.
it is possible that you share the error that you are presenting
You need to implement reconnect logic because when the connection is successful to log in the first time, you need to restart the connection https://github.com/WhiskeySockets/Baileys/blob/555cc9b3145ea2a94aeb34eec30eb966154b16f8/Example/example.ts#L149-L162
Ok thanks, that works.
Describe the bug
When entering pairing code on phone, I am getting a 515 code error and the connection closes.
To Reproduce
Baileys 6.4.0. Full reproduction code (just edit
BOT_NUMBER
):Expected behavior
There should be no error.
Environment (please complete the following information):
connectOptions
look like? See reproduction code.Additional context
See reproduction code.