From 5886fa5e263c1f593c782a9c3d70a32cb6994e0f Mon Sep 17 00:00:00 2001 From: OLC Date: Thu, 14 Aug 2025 18:36:27 +0800 Subject: [PATCH] fix embed content --- .../Modules/AI/AiInteractions.Chatting.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/RitsukageBotForDiscord/Modules/AI/AiInteractions.Chatting.cs b/src/RitsukageBotForDiscord/Modules/AI/AiInteractions.Chatting.cs index d3fa06b..6911959 100644 --- a/src/RitsukageBotForDiscord/Modules/AI/AiInteractions.Chatting.cs +++ b/src/RitsukageBotForDiscord/Modules/AI/AiInteractions.Chatting.cs @@ -133,11 +133,15 @@ await ModifyOriginalResponseAsync(x => var showPreprocessingAction = ChatClientProvider.GetConfig("ShowPreprocessingAction"); if (preprocessingActionData is not null && showPreprocessingAction) { - var embedBuilder = new EmbedBuilder(); - embedBuilder.WithDescription(string.Join(Environment.NewLine, - preprocessingActionData.Select(x => x.Action))); - embedBuilder.WithColor(Color.DarkPurple); - preprocessingEmbed = embedBuilder.Build(); + var preprocessingActionDataStr = string.Join(Environment.NewLine, + preprocessingActionData.Select(x => x.Action)); + if (!string.IsNullOrWhiteSpace(preprocessingActionDataStr)) + { + var embedBuilder = new EmbedBuilder(); + embedBuilder.WithDescription(preprocessingActionDataStr); + embedBuilder.WithColor(Color.DarkPurple); + preprocessingEmbed = embedBuilder.Build(); + } } var generatingEmbed = new EmbedBuilder();