Skip to content

Commit

Permalink
fix(entities/Suggestion): also use identifier in deletion message in …
Browse files Browse the repository at this point in the history
…displayEmbed()
  • Loading branch information
cAttte committed Jan 17, 2021
1 parent f6668a3 commit 879bf95
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/entities/Suggestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,20 @@ export default class Suggestion extends BaseEntity {
}

async displayEmbed(client: Client): Promise<Discord.MessageEmbedOptions> {
const identifier = await this.getIdentifier()

if (this.deletedAt) {
const deleter =
this.deleter === this.author ? "the author" : `<@${this.deleter}>`
return {
color: client.config.colors.error,
description: `**#${this.number}**: The suggestion has been deleted by ${deleter}.`
description: `**#${identifier}**: The suggestion has been deleted by ${deleter}.`
}
}

const displayNumber = await this.getIdentifier()
const embed: Discord.MessageEmbedOptions = {
color: "#999999",
author: { name: `#${displayNumber}${this.title}` },
author: { name: `#${identifier}${this.title}` },
thumbnail: { url: null },
description: this.body,
fields: []
Expand Down

0 comments on commit 879bf95

Please sign in to comment.