From 0225602576a124614f448d8fbc030d987ba318b9 Mon Sep 17 00:00:00 2001 From: Riccardo Fano Date: Wed, 6 Sep 2023 13:52:29 +0200 Subject: [PATCH 1/2] Update dino embed title too when score is updated --- src/commands/NFD.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/NFD.ts b/src/commands/NFD.ts index 76b6320..a6994e3 100644 --- a/src/commands/NFD.ts +++ b/src/commands/NFD.ts @@ -1382,6 +1382,7 @@ class NFD { const newHotnessScore = this.calculateHotnessScore(covetShunDifference) const editedEmbed = EmbedBuilder.from(message.embeds[0]) + .setTitle(nfd.name) .setFooter({ text: `${nfd.name} is worth ${this.getNFDPrice(nfd).toFixed(2)} Dino Bucks!` + From 554ab5eeaa52f265ffb61ec567a04fda597386d5 Mon Sep 17 00:00:00 2001 From: Riccardo Fano Date: Wed, 6 Sep 2023 14:07:40 +0200 Subject: [PATCH 2/2] Display type of dino shown in collection footer --- src/commands/NFD.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/commands/NFD.ts b/src/commands/NFD.ts index a6994e3..dcd6af1 100644 --- a/src/commands/NFD.ts +++ b/src/commands/NFD.ts @@ -366,6 +366,18 @@ class NFD { const collage = await this.makeCollage(collection) const fauxFileName = `${interaction.id}.png` + let dinoType + switch (type) { + case 'FAVORITES': + dinoType = 'favorite ' + break + case 'TRASH': + dinoType = 'trash ' + break + default: + dinoType = '' + } + const imageAttachment = new AttachmentBuilder(collage, { name: fauxFileName }) const embed = new EmbedBuilder() .setColor(this.NFD_COLOR) @@ -376,7 +388,9 @@ class NFD { .setTitle(ownerName + "'s collection") .setImage(`attachment://${fauxFileName}`) .setFooter({ - text: `${ownerName} owns ${collection.length} dinos worth ${totalValue.toFixed(2)} Dino Bucks in total. 🦖🙌`, + text: `${ownerName} owns ${collection.length} ${dinoType}dinos worth ${totalValue.toFixed( + 2 + )} Dino Bucks in total. 🦖🙌`, }) .setDescription(ostr)