Skip to content

Commit

Permalink
Merge pull request #194 from RikyTales/dino-embed-fix
Browse files Browse the repository at this point in the history
Small dino embed fixes
  • Loading branch information
mmerfort authored Sep 6, 2023
2 parents 80f52b3 + 554ab5e commit a1176c3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/commands/NFD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -1382,6 +1396,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!` +
Expand Down

0 comments on commit a1176c3

Please sign in to comment.