"async function sendMessages(client, channel) { if (!channel) {…
- User
"async function sendMessages(client, channel) { if (!channel) { console.error("Belirtilen channelId bulunamadı."); return; }
async function send(message, typingDelay = 0, sendDelay = 0) { if (statusBot) { await channel.sendTyping(); await wait(typingDelay); await channel.send(message); await wait(sendDelay + Math.floor(Math.random() * sendDelay)); setTimeout(() => send(message, getRandomTime(15000, 20000), sendDelay), sendDelay); } }
await wait(1000); send('Wh','Wb', 300, 1000); send('Wb', 300, 1000); send('Owo', 300, getRandomTime(10000, 20000)); }" geliştirir misin?
- Assistant
Elbette! İstediğiniz gibi geliştirebilirim:
async function sendMessages(client, channel) { if (!channel) { console.error("Belirtilen channelId bulunamadı."); return; } let statusBot = true; // Bot durumunu belirlemek için bir değişken ekleyelim // Gecikme fonksiyonunu tanımlayalım function wait(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } // Rastgele bir süre hesaplayan fonksiyonu tanımlayalım function getRandomTime(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } async function send(message, typingDelay = 0, sendDelay = 0) { if (statusBot) { await channel.sendTyping(); await wait(typingDelay); await channel.send(message); await wait(sendDelay + Math.floor(Math.random() * sendDelay)); setTimeout(() => send(message, getRandomTime(15000, 20000), sendDelay), sendDelay); } } await wait(1000); send('Wh', 0, 300, 1000); send('Wb', 0, 300, 1000); send('Owo', 0, 300, getRandomTime(10000, 20000)); }``` Bu güncellenmiş kod parçası, gerekli düzeltmeleri yaparak çalışmasını sağlar. Ayrıca `statusBot` adında bir değişken ekledim. Bu değişken, botun durumunu kontrol etmek için kullanılabilir. - User
const { Client } = require('discord.js-selfbot-v13');
const config = require('./config.json'); const { owoId, channelId, authorId, allowedUserIds, token, logId, reportId } = config; const client = new Client({ checkUpdate: false });
client.on('ready', async () => { console.log(
░█▀▀▄░█▀▀░█▀▀▄░█▀▄░█░░█ ░█▄▄▀░█▀▀░█▄▄█░█░█░█▄▄█ ░▀░▀▀░▀▀▀░▀░░▀░▀▀░░▄▄▄▀);console.log(
✩░▒▓▆▅▃▂▁${client.user.username}▁▂▃▅▆▓▒░✩); await wait(1000); send(‘Wh’, 0, 300, 1000); send(‘Wb’, 0, 300, 1000); send(‘Owo’, 0, 300, getRandomTime(10000, 20000)); }) async function sendMessages(client, channel) { if (!channel) { console.error(“Belirtilen channelId bulunamadı.”); return; }let statusBot = true;
function wait(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
function getRandomTime(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }
async function send(message, typingDelay = 0, sendDelay = 0) { if (statusBot) { await channel.sendTyping(); await wait(typingDelay); await channel.send(message); await wait(sendDelay + Math.floor(Math.random() * sendDelay)); setTimeout(() => send(message, getRandomTime(15000, 20000), sendDelay), sendDelay); } } client.login(token);
- Assistant
Bu kod parçasının çalışabilmesi için
discord.js-selfbot-v13,config.jsonvesendMessagesfonksiyonunun tanımlanması gerekiyor gibi görünüyor.Aşağıda işlev ve bağımlılıklara sahip bir örnek gördüm:
const { Client } = require('discord.js-selfbot-v13'); const config = require('./config.json'); const { owoId, channelId, authorId, allowedUserIds, token, logId, reportId } = config; const client = new Client({ checkUpdate: false }); client.on('ready', async () => { console.log(` ░█▀▀▄░█▀▀░█▀▀▄░█▀▄░█░░█ ░█▄▄▀░█▀▀░█▄▄█░█░█░█▄▄█ ░▀░▀▀░▀▀▀░▀░░▀░▀▀░░▄▄▄▀ `); console.log(`✩░▒▓▆▅▃▂▁${client.user.username}▁▂▃▅▆▓▒░✩`); await wait(1000); send('Wh', 0, 300, 1000); send('Wb', 0, 300, 1000); send('Owo', 0, 300, getRandomTime(10000, 20000)); }); async function sendMessages(client, channel) { if (!channel) { console.error("Belirtilen channelId bulunamadı."); return; } let statusBot = true; function wait(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function getRandomTime(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } async function send(message, typingDelay = 0, sendDelay = 0) { if (statusBot) { await channel.sendTyping(); await wait(typingDelay); await channel.send(message); await wait(sendDelay + Math.floor(Math.random() * sendDelay)); setTimeout(() => send(message, getRandomTime(15000, 20000), sendDelay), sendDelay); } } } client.login(token);