Open Moneki97 opened 1 year ago
For this type of logout reason you need to restart the socket
For this type of logout reason you need to restart the socket
I handle reconnection on update event:
Nothing to do, the solution is just to restart your socket connection
Nothing to do, the solution is just to restart your socket connection
As I would do it?
This happens when you spend hours without receiving any events, for example: without receiving messages for a long time
Ini terjadi ketika Anda menghabiskan waktu berjam-jam tanpa menerima peristiwa apa pun, misalnya: tanpa menerima pesan dalam waktu lama
hello bro, what if the status code is 408 when using conn.profilePictureUrl
Hello bro, could you clarify how you manage/schedule these restarts in your code to avoid this 428 error?
Nothing to do, the solution is just to restart your socket connection
Nada que hacer, la solución es simplemente reiniciar la conexión del socket.
¿Cómo manejamos el reinicio con el error 428?
Same problem.
Same problem... But, my instances stay in the half 3/4 days connected, and then show error 428 (connection closed)...
I would liked stay connected for the 1 month or plus...
does any one have a solution for it?
does any one have a solution for it?
having the same problem but with the difference that the first sent message breaks it, after a restart it stays connected (I haven't tested for how long)
@Moneki97 @kyraex does any one have a solution for it?
setting syncFullHistory: false
in makeWASocket
and waited for 30 seconds before sending a first message resolved my issue.
setTimeout(async () => {
const jid = '919912345678@s.whatsapp.net';
await socket.presenceSubscribe(jid);
await delay(500);
await socket.sendPresenceUpdate('composing', jid);
await delay(2000);
await socket.sendPresenceUpdate('paused', jid);
await socket.sendMessage(jid, { text: 'Hello from Whatsapp' });
}, 30000);
@sumithemmadi Hello. Did you solve this problem?
En mi caso, con tan solo quitar return false
en el evento messages.upsert
resolvió mi problema (mi error)
antes:
socket.ev.on("messages.upsert", async m => {
const msg = m.messages[0];
let message = msg.message?.conversation;
if(message == "") message = msg.message?.extendedTextMessage?.text;
if(msg.key.fromMe){
let info = await ai.assistants.getInfo();
if(!!info){
if(new RegExp("^"+info.start+"$", "i").test(message!)){
const forbidden = await orm.waForbiddenNumbers.findUnique({where: {phone}});
if(!!forbidden) return false;
await ai.threads.enable(msg.key.remoteJid!);
}
}
}else{
if(!message) return false;
const aiThread = await ai.threads.get(msg.key.remoteJid!);
if(!aiThread) return false;
if(!aiThread.info.enabled) return false;
}
});
Después
socket.ev.on("messages.upsert", async m => {
const msg = m.messages[0];
let message = msg.message?.conversation;
if(message == "") message = msg.message?.extendedTextMessage?.text;
if(msg.key.fromMe){
let info = await ai.assistants.getInfo();
if(!!info){
if(new RegExp("^"+info.start+"$", "i").test(message!)){
const forbidden = await orm.waForbiddenNumbers.findUnique({where: {phone}});
if(!!forbidden) return;
await ai.threads.enable(msg.key.remoteJid!);
}
}
}else{
if(!message) return;
const aiThread = await ai.threads.get(msg.key.remoteJid!);
if(!aiThread) return;
if(!aiThread.info.enabled) return;
}
});
No sé si sea tu caso
Describe the bug When trying to send an image I get error 428.
To Reproduce Steps to reproduce the behavior:
Expected behavior Send the image.
Environment (please complete the following information):
Is this on a server? Yes
What do your
connectOptions
look like?Do you have multiple clients on the same IP? No
Are you using a proxy? No
Additional context My function is:
The error is: