From 582dff52435fc3def0b8939bd43c1b6e4d37c6f5 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Sat, 18 Mar 2023 03:38:29 +0100 Subject: [PATCH] Add support for fields in embeds --- src/toOpenAIMessages.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/toOpenAIMessages.ts b/src/toOpenAIMessages.ts index 7d61456..5e21a7e 100644 --- a/src/toOpenAIMessages.ts +++ b/src/toOpenAIMessages.ts @@ -24,6 +24,10 @@ export function formatMessage(message: DiscordMessage): string { rvalue += embed.author ? ` by ${embed.author.name}` : ""; rvalue += (embed.title || embed.author) && embed.description ? " -": ""; rvalue += embed.description ? ` ${embed.description}` : ""; + + for (const field of embed.fields) { + rvalue += ` [${field.name} - ${field.value}]`; + } rvalue += "]"; }