const Discord = require('discord.js'); const client = new Discord.Client(); client.on('ready', () => { console.log(`Logged in as ${client.user.tag}!`); }); client.on('message', msg => { if (msg.content === 'ping') { msg.reply('Pong!'); // Здесь начинается код бота спама const spamMessages = [ 'Привет!', // 0 'Как дела?', // 1 'Что нового?', // 2 'Доброе утро!', // 3 'Какие планы?' // 4 ]; setInterval(() => { let randomMessageIndex = Math.floor(Math.random() * spamMessages.length); // 0 - 4 msg.channel.send(spamMessages[randomMessageIndex]); }, 3000); } }); // 3000 - 3 секунды JS const Discord = require('discord.js'); const client = new Discord.Client(); client.on('ready', () => { console.log(`Logged in as ${client.user.tag}!`); }); client.on('message', msg => { if (msg.content === 'ping') { msg.reply('Pong!'); // Здесь начинается код бота спама const spamMessages = [ 'Привет!', // 0 'Как дела?', // 1 'Что нового?', // 2 'Доброе утро!', // 3 'Какие планы?' // 4 ]; setInterval(() => { let randomMessageIndex = Math.floor(Math.random() * spamMessages.length); // 0 - 4 msg.channel.send(spamMessages[randomMessageIndex]); }, 3000); } }); // 3000 - 3 секунды