mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
fix(bot): respect character limit for group display names
This commit is contained in:
parent
9f50e055f6
commit
f37a6f4290
1 changed files with 2 additions and 0 deletions
|
|
@ -191,6 +191,8 @@ public class Groups
|
|||
else
|
||||
{
|
||||
var newDisplayName = ctx.RemainderOrNull(false).NormalizeLineEndSpacing();
|
||||
if (newDisplayName.Length > Limits.MaxGroupNameLength)
|
||||
throw new PKError($"Group name too long ({newDisplayName.Length}/{Limits.MaxGroupNameLength} characters).");
|
||||
|
||||
var patch = new GroupPatch { DisplayName = Partial<string>.Present(newDisplayName) };
|
||||
await ctx.Repository.UpdateGroup(target.Id, patch);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue