diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2023-10-14 00:16:49 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2023-10-14 00:16:49 -0400 |
| commit | 0c0155a4d207611fb3d975f9e7e56d04fff63d44 (patch) | |
| tree | d36af29ecd127f9865118872f6c56d35dcfa2c7b /commands/quote.js | |
| parent | 1a7a627446edfeb270850f0ed15c9c8d604380b2 (diff) | |
| download | AleeBot-0c0155a4d207611fb3d975f9e7e56d04fff63d44.tar.gz AleeBot-0c0155a4d207611fb3d975f9e7e56d04fff63d44.tar.bz2 AleeBot-0c0155a4d207611fb3d975f9e7e56d04fff63d44.zip | |
Docker; Removed packages; Removed binaryworks refs
Diffstat (limited to 'commands/quote.js')
| -rw-r--r-- | commands/quote.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/commands/quote.js b/commands/quote.js index 81f9142..37f5714 100644 --- a/commands/quote.js +++ b/commands/quote.js @@ -24,23 +24,23 @@ module.exports.run = async (client, message, args) => { if (quoteID === undefined) { const quoteList = await quoteDB.findAll({ attributes: ['id'] }) - quoteID = Math.floor(Math.random() * (quoteList.length - 1)) + 1 + const random = crypto.getRandomValues(new Uint32Array(1)); + quoteID = quoteList[random[0] % quoteList.length].id; } const quote = await quoteDB.findOne({ where: { id: quoteID } }) if (quote) { - const embed = new MessageEmbed() - .setAuthor({ name: quote.author, iconURL: quote.authorImage}) + const quoteEmbed = new MessageEmbed() + .setAuthor({ name: quote.author, iconURL: quote.authorImage }) .setDescription(quote.quote) .setColor('#1fd619') .setFooter('- ' + quote.year); - await message.reply('Alright, here\'s your quote.') - await message.channel.send({embeds:[embed]}); + await message.reply({ content: 'Alright, here\'s your quote.', embeds: [quoteEmbed] }) } else { - message.reply('Cannot find quote'); + message.reply('Cannot find quote, specify the correct quote id.'); } |
