From 1e2292f197ba69cc50d9471c8fac5951bcda4352 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sat, 1 Mar 2025 23:32:43 -0500 Subject: New api endpoint; Now should display the submitter's username --- commands/quote.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'commands/quote.js') diff --git a/commands/quote.js b/commands/quote.js index f19675f..72bd07b 100644 --- a/commands/quote.js +++ b/commands/quote.js @@ -28,14 +28,16 @@ module.exports.run = async (client, message, args) => { quoteID = quoteList[random[0] % quoteList.length].id; } - const quote = await quoteDB.findOne({ where: { id: quoteID } }) + const quote = await quoteDB.findOne({ where: { id: quoteID } }); + + let userSubmitter = await client.users.fetch(quote.submitter); if (quote) { const quoteEmbed = new MessageEmbed() .setAuthor({ name: quote.author, iconURL: quote.authorImage }) .setDescription(quote.quote) .setColor('#1fd619') - .setFooter(`- ${quote.year}\nSubmitted by ${quote.submitter}`); + .setFooter(`- ${quote.year}\nSubmitted by ${userSubmitter.username}`); await message.reply({ embeds: [quoteEmbed] }) } else { -- cgit v1.2.3