mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-16 18:50:13 +00:00
fix: don't crash in lists when searching for a string longer than 256 characters
This commit is contained in:
parent
84e7e71f88
commit
8ce7465177
3 changed files with 9 additions and 3 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
using Humanizer;
|
||||||
|
|
||||||
using Myriad.Builders;
|
using Myriad.Builders;
|
||||||
|
|
||||||
using PluralKit.Core;
|
using PluralKit.Core;
|
||||||
|
|
@ -134,7 +136,7 @@ public class GroupMember
|
||||||
else
|
else
|
||||||
title.Append($"`{targetSystem.Hid}`");
|
title.Append($"`{targetSystem.Hid}`");
|
||||||
if (opts.Search != null)
|
if (opts.Search != null)
|
||||||
title.Append($" matching **{opts.Search}**");
|
title.Append($" matching **{opts.Search.Truncate(100)}**");
|
||||||
|
|
||||||
await ctx.RenderMemberList(ctx.LookupContextFor(target.System), target.System, title.ToString(),
|
await ctx.RenderMemberList(ctx.LookupContextFor(target.System), target.System, title.ToString(),
|
||||||
target.Color, opts);
|
target.Color, opts);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
using Humanizer;
|
||||||
|
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
|
||||||
using PluralKit.Core;
|
using PluralKit.Core;
|
||||||
|
|
@ -47,7 +49,7 @@ public class ListOptions
|
||||||
|
|
||||||
if (Search != null)
|
if (Search != null)
|
||||||
{
|
{
|
||||||
str.Append($", searching for \"{Search}\"");
|
str.Append($", searching for \"{Search.Truncate(100)}\"");
|
||||||
if (SearchDescription) str.Append(" (including description)");
|
if (SearchDescription) str.Append(" (including description)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
using Humanizer;
|
||||||
|
|
||||||
using PluralKit.Core;
|
using PluralKit.Core;
|
||||||
|
|
||||||
namespace PluralKit.Bot;
|
namespace PluralKit.Bot;
|
||||||
|
|
@ -35,7 +37,7 @@ public class SystemList
|
||||||
title.Append($"`{target.Hid}`");
|
title.Append($"`{target.Hid}`");
|
||||||
|
|
||||||
if (opts.Search != null)
|
if (opts.Search != null)
|
||||||
title.Append($" matching **{opts.Search}**");
|
title.Append($" matching **{opts.Search.Truncate(100)}**");
|
||||||
|
|
||||||
return title.ToString();
|
return title.ToString();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue