From d87709751783420b1d1a3381387bf32e01aa717d Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Fri, 17 Mar 2023 19:59:46 +0100 Subject: [PATCH] Fix embed formatting for author name and hyphen condition. --- src/toOpenAIMessages.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toOpenAIMessages.ts b/src/toOpenAIMessages.ts index 1e89867..423cadc 100644 --- a/src/toOpenAIMessages.ts +++ b/src/toOpenAIMessages.ts @@ -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 += "]"; }