const client = require('../index') const Discord = 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) message.channel.awaitMessages(filter, { max: 1000, time: 10000 }).then(collected => { if (message.content === `${text}`) { //if(message.content === `${array2[Random2]}`){ const damnlad = new Discord.MessageEmbed() .setDescription(`${message.author} damn that was fast, ggs on getting that 7k`) .setColor("GREEN") //db.add(`money_${message.author.id}`, 7000) message.channel.send(damnlad) return } else if (message.content !== `${text}`) { message.channel.send('wrong') return } if (!collected) { const probtime = new Discord.MessageEmbed() .setDescription("you ran out of time or an error happened") .setColor("RED") message.channel.send(probtime) return } }).catch(err => { const probtime2 = new Discord.MessageEmbed() .setDescription("you ran out of time or an error happened") .setColor("RED") message.reply(probtime2) }) return } } })