From 946c0b7b35c7c0d0d7a3069a21c44d316a754130 Mon Sep 17 00:00:00 2001 From: d4n3436 Date: Fri, 17 Nov 2023 20:34:35 -0500 Subject: [PATCH] `wolfram`: Limit field value length --- src/Modules/UtilityModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Modules/UtilityModule.cs b/src/Modules/UtilityModule.cs index 2aa70d4..51c201c 100644 --- a/src/Modules/UtilityModule.cs +++ b/src/Modules/UtilityModule.cs @@ -661,7 +661,8 @@ public async Task WolframAlphaAsync([Autocomplete(typeof(WolframA // If there's data in plain text and there isn't a newline, use that instead if (!string.IsNullOrEmpty(subPod.PlainText) && !subPod.PlainText.Contains('\n')) { - text.AppendLine(subPod.PlainText); + text.Append(subPod.PlainText); + text.Append('\n'); } else { @@ -675,7 +676,7 @@ public async Task WolframAlphaAsync([Autocomplete(typeof(WolframA } if (text.Length > 0) - topEmbed.AddField(pod.Title, text.ToString(), true); + topEmbed.AddField(pod.Title, text.ToString().Truncate(EmbedFieldBuilder.MaxFieldValueLength), true); if (subBuilders.Count > 0) builders.Add(subBuilders);