From fa1caf3ad8ba5d1df6f1f9f43a4300368b3ddc06 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Sat, 18 Mar 2023 04:55:37 +0100 Subject: [PATCH] Add support for stickers in messages The sticker name and description will be now forwarded with the rest of the message content. --- src/toOpenAIMessages.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/toOpenAIMessages.ts b/src/toOpenAIMessages.ts index 5e21a7e..5f97681 100644 --- a/src/toOpenAIMessages.ts +++ b/src/toOpenAIMessages.ts @@ -31,7 +31,14 @@ export function formatMessage(message: DiscordMessage): string { rvalue += "]"; } - return rvalue; + for (const sticker of message.stickers.values()) { + rvalue += ` [Sticker:`; + rvalue += sticker.name; + rvalue += sticker.description ? ` - ${sticker.description}` : ""; + rvalue += "]"; + } + + return rvalue.trim(); } /**