Fix embed formatting for author name and hyphen condition.

This commit is contained in:
Wroclaw 2023-03-17 19:59:46 +01:00
parent 7411648d02
commit d877097517

View file

@ -15,8 +15,8 @@ export function formatMessage(message: DiscordMessage): string {
for (const embed of message.embeds) {
rvalue += ` [Embed:`;
rvalue += embed.title ? ` ${embed.title}` : "";
rvalue += embed.author ? ` by ${embed.author}` : "";
rvalue += embed.title || embed.author ? " -": "";
rvalue += embed.author ? ` by ${embed.author.name}` : "";
rvalue += (embed.title || embed.author) && embed.description ? " -": "";
rvalue += embed.description ? ` ${embed.description}` : "";
rvalue += "]";
}