Improve the formatting of the classUpdate embed

This commit is contained in:
zkldi
2022-03-26 21:00:14 +00:00
parent 544b1b9594
commit 630cc7c637
+5 -3
View File
@@ -1,4 +1,4 @@
import { integer, WebhookEventClassUpdateV1 } from "tachi-common";
import { FormatGame, integer, WebhookEventClassUpdateV1 } from "tachi-common";
import { client } from "../main";
import { GetUserInfo } from "../utils/apiRequests";
import { CreateEmbed } from "../utils/embeds";
@@ -25,11 +25,13 @@ export async function HandleClassUpdateV1(
const newClass = FormatClass(game, playtype, event.set, event.new);
const embed = CreateEmbed()
.setTitle(`${userDoc.username} just achieved ${newClass}.`)
.setTitle(`${userDoc.username} just achieved ${newClass} in ${FormatGame(game, playtype)}!`)
.setThumbnail(PrependTachiUrl(`/users/${userDoc.id}/pfp`));
if (event.old !== null) {
embed.setDescription(`Raised from ${FormatClass(game, playtype, event.set, event.old)}`);
embed.setDescription(
`(This was raised from ${FormatClass(game, playtype, event.set, event.old)}.)`
);
}
await channel.send({ embeds: [embed] });