function getRandomString(length) { return [...Array(length)].map(() => Math.floor(Math.random() * 10)).join(''); } function mesajGonder(csrfKey, CHATADI, CHANNEL, baseMessage) { fetch(`https://${CHATADI}.chatovod.ru/ajax/`, { method: 'POST', headers: { 'Content-type': 'application/x-www-form-urlencoded' }, body: `act=send&chat=276854&csrf=${csrfKey}&channel=${CHANNEL}&msg=${encodeURIComponent(baseMessage + " " + getRandomString(5))}` }).catch(err => console.error("Message sending failed:", err)); } onmessage = function(e) { const { csrfKey, CHATADI, CHANNEL, baseMessage, hiz } = e.data; try { setInterval(() => mesajGonder(csrfKey, CHATADI, CHANNEL, baseMessage), hiz); } catch (error) { console.error("Error in worker:", error); } };