const client = require('../index') const Discord = require('discord.js') const { MessageCollector } = require('discord.js') client.on('message', async message => { if (message.content.startsWith('e!')) { const array = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', ] const array2 = [ 'the pig ate my dad', 'This is spaghetti', 'He will eat this', 'The guy Said Fofana', 'The world is rocky', 'Pitcher', 'i love memes', 'Broken', 'Eating', 'crocodile', ] const filter = m => m.author.id === message.author.id const Random = Math.floor(Math.random() * array.length) console.log(array[Random]) if (array[Random] < 5) return; if (array[Random] > 5) { const Random2 = Math.floor(Math.random() * array2.length) const text = array2[Random2] const randomsend = new Discord.MessageEmbed() .setColor('GREEN') .setDescription(`quick! first person to send **\`${text}\`** gets 7,000 coins! you got 10s!`) message.channel.send(randomsend) const collecter = new MessageCollector(message.channel, filter) setTimeout(() => { collecter.on("collect", (msg) => { if (msg.content === text) collecter.stop() }) collecter.on("end", (collected) => { message.channel.send("gg") }) message.channel.send('time up') }, 10000) } } })