Skip to content

Commit

Permalink
wolfram: Limit field value length
Browse files Browse the repository at this point in the history
  • Loading branch information
d4n3436 committed Nov 18, 2023
1 parent ad0a860 commit 946c0b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Modules/UtilityModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,8 @@ public async Task<RuntimeResult> 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
{
Expand All @@ -675,7 +676,7 @@ public async Task<RuntimeResult> 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);
Expand Down

0 comments on commit 946c0b7

Please sign in to comment.