aboutsummaryrefslogtreecommitdiff
path: root/commands/quote.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2023-10-14 00:16:49 -0400
committerAndrew Lee <alee14498@protonmail.com>2023-10-14 00:16:49 -0400
commit0c0155a4d207611fb3d975f9e7e56d04fff63d44 (patch)
treed36af29ecd127f9865118872f6c56d35dcfa2c7b /commands/quote.js
parent1a7a627446edfeb270850f0ed15c9c8d604380b2 (diff)
downloadAleeBot-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.js12
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.');
}