Skip to content

Commit

Permalink
feat: requested changes regarding embed profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
didinele committed Oct 22, 2023
1 parent 7544831 commit b20cff7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/bot/src/struct/AmaManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,22 @@ export class AmaManager {
const baseName = (displayId ? user?.tag : member?.nickname ?? user?.tag) ?? 'Unknown User';
const name = displayId ? `${baseName} (${user?.id ?? 'Unknown - likely deleted user'})` : baseName;

return new EmbedBuilder()
const embed = new EmbedBuilder()
.setDescription(content)
.setImage(imageUrl ?? null)
.setAuthor({
name,
iconURL: member?.displayAvatarURL() ?? user?.displayAvatarURL(),
});

if (displayId) {
embed.setFooter({
text: name,
iconURL: user?.displayAvatarURL(),
});
}

return embed;
}

public async postToModQueue({
Expand Down Expand Up @@ -125,7 +134,7 @@ export class AmaManager {

await channel.send({
allowedMentions: { parse: [] },
embeds: [this.getBaseEmbed(embedData)],
embeds: [this.getBaseEmbed({ ...embedData, displayId: false })],
components: [row],
});

Expand All @@ -136,10 +145,9 @@ export class AmaManager {
question,
stage,
answersChannel,
displayId = false,
...embedData
}: PostToAnswerChannelData): Promise<Result<Message<true>, Error>> {
const embed = this.getBaseEmbed({ ...embedData, displayId });
const embed = this.getBaseEmbed({ ...embedData, displayId: false });
embed.setColor(Colors.Blurple);

// This is deprecated
Expand Down

0 comments on commit b20cff7

Please sign in to comment.